feat(core): add top-level thinking configuration to language model calls#12593
Open
giulio-leone wants to merge 1 commit intovercel:mainfrom
Open
feat(core): add top-level thinking configuration to language model calls#12593giulio-leone wants to merge 1 commit intovercel:mainfrom
giulio-leone wants to merge 1 commit intovercel:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
thinkingfield toLanguageModelV3CallOptionsand AI SDKCallSettingsthinkingthroughgenerateText,streamText,generateObject,streamObject, andToolLoopAgentthinkingto provider-specific reasoning controls in OpenAI chat, OpenAI responses, OpenAI-compatible chat, and AnthropicthinkingDetails
LanguageModelV3Thinkingtype:{ type: 'enabled', effort?: 'low' | 'medium' | 'high', budgetTokens?: number }{ type: 'disabled' }thinkinginprepareCallSettings.thinking.budgetTokensis used with OpenAI/OpenAI-compatible where unsupported.Tests
pnpm --filter ai exec vitest --config vitest.node.config.js --run src/prompt/prepare-call-settings.test.ts src/middleware/default-settings-middleware.test.ts src/agent/tool-loop-agent.test.ts src/generate-text/generate-text.test.ts src/generate-text/stream-text.test.ts src/generate-object/generate-object.test.ts src/generate-object/stream-object.test.tspnpm --filter @ai-sdk/openai exec vitest --config vitest.node.config.js --run src/chat/openai-chat-language-model.test.ts src/responses/openai-responses-language-model.test.tspnpm --filter @ai-sdk/openai-compatible exec vitest --config vitest.node.config.js --run src/chat/openai-compatible-chat-language-model.test.tspnpm --filter @ai-sdk/anthropic exec vitest --config vitest.node.config.js --run src/anthropic-messages-language-model.test.tspnpm --filter ai type-checkpnpm --filter @ai-sdk/provider type-checkpnpm --filter @ai-sdk/openai type-checkpnpm --filter @ai-sdk/openai-compatible type-checkpnpm --filter @ai-sdk/anthropic type-checkCloses #12516
Attribution request
If this pull request is merged, I would be grateful if contributor credit could be included in the related changelog or release notes for implementing this fix (@g97iulio1609).