Limit max output tokens to 32k

This commit is contained in:
Mario Zechner 2025-10-30 15:47:36 +01:00
parent 9e50bb2c37
commit cac353b3fe
2 changed files with 100 additions and 83 deletions

View file

@ -117,7 +117,7 @@ function mapOptionsForApi<TApi extends Api>(
): OptionsForApi<TApi> {
const base = {
temperature: options?.temperature,
maxTokens: options?.maxTokens || model.maxTokens,
maxTokens: options?.maxTokens || Math.min(model.maxTokens, 32000),
signal: options?.signal,
apiKey: apiKey || options?.apiKey,
};