| import type { LanguageModelCallOptions } from '../prompt/language-model-call-options'; | ||
| import { prepareLanguageModelCallOptions } from '../prompt/prepare-language-model-call-options'; | ||
| /** | ||
| * Resolves model call settings for a single step. | ||
| * | ||
| * Undefined step settings intentionally fall back to the outer call settings, | ||
| * while defined falsy values such as `temperature: 0` and `seed: 0` are kept. | ||
| */ | ||
| export function prepareStepCallSettings({ | ||
| callSettings, | ||
| stepSettings, | ||
| }: { | ||
| callSettings: LanguageModelCallOptions; | ||
| stepSettings: LanguageModelCallOptions | undefined; | ||
| }): LanguageModelCallOptions { | ||
| return prepareLanguageModelCallOptions({ | ||
| maxOutputTokens: | ||
| stepSettings?.maxOutputTokens ?? callSettings.maxOutputTokens, | ||
| temperature: stepSettings?.temperature ?? callSettings.temperature, | ||
| topP: stepSettings?.topP ?? callSettings.topP, | ||
| topK: stepSettings?.topK ?? callSettings.topK, | ||
| presencePenalty: | ||
| stepSettings?.presencePenalty ?? callSettings.presencePenalty, | ||
| frequencyPenalty: | ||
| stepSettings?.frequencyPenalty ?? callSettings.frequencyPenalty, | ||
| stopSequences: stepSettings?.stopSequences ?? callSettings.stopSequences, | ||
| seed: stepSettings?.seed ?? callSettings.seed, | ||
| reasoning: stepSettings?.reasoning ?? callSettings.reasoning, | ||
| }); | ||
| } |
+3
-3
| { | ||
| "name": "ai", | ||
| "version": "7.0.41", | ||
| "version": "7.0.42", | ||
| "type": "module", | ||
@@ -45,5 +45,5 @@ "description": "AI SDK by Vercel - build apps like ChatGPT, Claude, Gemini, and more with a single interface for any model using the Vercel AI Gateway or go direct to OpenAI, Anthropic, Google, or any other model provider.", | ||
| "dependencies": { | ||
| "@ai-sdk/gateway": "4.0.31", | ||
| "@ai-sdk/gateway": "4.0.32", | ||
| "@ai-sdk/provider": "4.0.4", | ||
| "@ai-sdk/provider-utils": "5.0.14" | ||
| "@ai-sdk/provider-utils": "5.0.15" | ||
| }, | ||
@@ -50,0 +50,0 @@ "devDependencies": { |
@@ -43,3 +43,5 @@ import type { Context, ToolSet } from '@ai-sdk/provider-utils'; | ||
| /** | ||
| * The text that was generated in the final step. | ||
| * The concatenation of all text parts generated in the final step. | ||
| * It is an empty string if the final step contains no text parts. | ||
| * Inspect `finalStep.content` to distinguish that case. | ||
| */ | ||
@@ -46,0 +48,0 @@ readonly text: string; |
@@ -10,2 +10,3 @@ import type { | ||
| import type { Instructions } from '../prompt'; | ||
| import type { LanguageModelCallOptions } from '../prompt/language-model-call-options'; | ||
| import type { LanguageModel, ToolChoice } from '../types/language-model'; | ||
@@ -99,3 +100,7 @@ import type { ActiveTools } from './active-tools'; | ||
| * The result type returned by a {@link PrepareStepFunction}, | ||
| * allowing per-step overrides of model, tools, instructions, or messages. | ||
| * allowing per-step overrides of model call settings, model, tools, | ||
| * instructions, or messages. | ||
| * | ||
| * Model call setting overrides apply only to the current step. Undefined | ||
| * settings fall back to the outer call settings. | ||
| */ | ||
@@ -106,3 +111,3 @@ export type PrepareStepResult< | ||
| > = | ||
| | { | ||
| | ({ | ||
| /** | ||
@@ -181,3 +186,3 @@ * Optionally override which LanguageModel instance is used for this step. | ||
| providerOptions?: ProviderOptions; | ||
| } | ||
| } & LanguageModelCallOptions) | ||
| | undefined; |
@@ -179,3 +179,4 @@ import type { | ||
| /** | ||
| * The generated text. Can be an empty string if the model has not generated any text. | ||
| * The concatenation of all text parts generated in this step. | ||
| * It is an empty string if the step contains no text parts. | ||
| */ | ||
@@ -182,0 +183,0 @@ readonly text: string; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
6531562
0.25%619
0.16%67242
0.14%+ Added
+ Added
+ Added
- Removed
- Removed
Updated