Skip to content

armgit / my-yt

Public Imported from GitHub
0

A clean and minimal youtube frontend, without all the ads and whistles

JavaScript

feat: support maxTokens in generic llm provider

Christian Feiee067fb693d0
diff --git a/lib/llm/providers/generic.js b/lib/llm/providers/generic.js
index 620b35d..ba60e62 100644
--- a/lib/llm/providers/generic.js
+++ b/lib/llm/providers/generic.js
@@ -7,6 +7,7 @@ export class Generic {
endpoint,
apiKey,
temperature,
+ maxTokens
}) {
this.system = system
this.model = model
@@ -14,6 +15,7 @@ export class Generic {
this.endpoint = endpoint
this.apiKey = apiKey
this.temperature = temperature
+ this.maxTokens = maxTokens || MAX_TOKENS
}
getHeaders () {
@@ -26,6 +28,7 @@ export class Generic {
return JSON.stringify({
model: this.model,
temperature: Number(this.temperature),
+ maxTokens: this.maxTokens,
messages: [
{ role: "system", content: this.system },
{ role: "user", content: prompt }