Update stream-text.ts dynamic model max Token updated

This commit is contained in:
Raiyan Hasan 2024-11-21 11:49:09 +05:30 committed by GitHub
parent 4269d57ea8
commit e1c3d603df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -68,10 +68,12 @@ export function streamText(
const modelDetails = MODEL_LIST.find((m) => m.name === currentModel);
const dynamicMaxTokens =
modelDetails && modelDetails.maxTokenAllowed
? Math.min(MAX_TOKENS, modelDetails.maxTokenAllowed)
: MAX_TOKENS;
const dynamicMaxTokens =
modelDetails && modelDetails.maxTokenAllowed
? modelDetails.maxTokenAllowed
: MAX_TOKENS;
return _streamText({
model: getModel(currentProvider, currentModel, env, apiKeys),