Skip to content

Commit 5fe160d

Browse files
committed
fix(ai): possibilité de désactiver maxTokens dans le YAML
1 parent 80ea18d commit 5fe160d

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

app/js/ai/getAnswerFromLLM.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,13 @@ export function getAnswerFromLLM(chatbot, userPrompt, options) {
6060
let bodyObject = {
6161
model: yaml.useLLM.model,
6262
stream: shouldStreamLLMresponse,
63-
max_tokens: yaml.useLLM.maxTokens,
6463
frequency_penalty: 0,
6564
presence_penalty: 0,
6665
temperature: 0.7,
6766
};
67+
if (yaml.useLLM.maxTokens) {
68+
bodyObject.max_tokens = yaml.useLLM.maxTokens;
69+
}
6870
if (RAGinformations.length > 0) {
6971
RAGinformations = RAGprompt + RAGinformations;
7072
}

app/script.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/script.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)