mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-11 04:58:51 +01:00
🪙 fix: Max Output Tokens Refactor for Responses API (#8972)
🪙 fix: Max Output Tokens Refactor for Responses API (#8972) chore: Remove `max_output_tokens` from model kwargs in `titleConvo` if provided
This commit is contained in:
parent
da3730b7d6
commit
21e00168b1
7 changed files with 143 additions and 4 deletions
|
|
@ -373,7 +373,7 @@ describe('getOpenAIConfig', () => {
|
|||
text: {
|
||||
verbosity: Verbosity.medium,
|
||||
},
|
||||
max_completion_tokens: 1500,
|
||||
max_output_tokens: 1500,
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -300,7 +300,9 @@ export function getOpenAIConfig(
|
|||
}
|
||||
|
||||
if (llmConfig.model && /\bgpt-[5-9]\b/i.test(llmConfig.model) && llmConfig.maxTokens != null) {
|
||||
modelKwargs.max_completion_tokens = llmConfig.maxTokens;
|
||||
const paramName =
|
||||
llmConfig.useResponsesApi === true ? 'max_output_tokens' : 'max_completion_tokens';
|
||||
modelKwargs[paramName] = llmConfig.maxTokens;
|
||||
delete llmConfig.maxTokens;
|
||||
hasModelKwargs = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue