-
-
Notifications
You must be signed in to change notification settings - Fork 195
chore(adapters): move common options to model options #499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
harry-whorlow
wants to merge
9
commits into
main
Choose a base branch
from
move-baseoptions-to-model-options
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f603e73
chore(adapters): move base model options into model options
harry-whorlow cd5d212
chore: update open router
harry-whorlow 32ccfe5
chore: update openai
harry-whorlow 10f1691
chore: update gemini
harry-whorlow ac42bfe
chore: update groq
harry-whorlow 20e72e7
chore: update grok
harry-whorlow 398bd93
chore: update gemini
harry-whorlow 2663f0f
chore: clean up
harry-whorlow 5f0ee08
chore: remove termianl artifact
harry-whorlow File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: TanStack/ai
Length of output: 11787
🏁 Script executed:
cat -n packages/typescript/ai-gemini/src/text/text-provider-options.ts | head -100Repository: TanStack/ai
Length of output: 5727
🏁 Script executed:
Repository: TanStack/ai
Length of output: 5836
🏁 Script executed:
rg -n "mapCommonOptionsToGemini" packages/typescript/ai-gemini/src --context 20 -A 30Repository: TanStack/ai
Length of output: 8331
🏁 Script executed:
rg -n "ExternalTextProviderOptions" packages/typescript/ai-gemini/srcRepository: TanStack/ai
Length of output: 447
🏁 Script executed:
sed -n '253,260p' packages/typescript/ai-gemini/src/text/text-provider-options.tsRepository: TanStack/ai
Length of output: 299
🏁 Script executed:
cat -n packages/typescript/ai-gemini/src/text/text-provider-options.ts | tail -50Repository: TanStack/ai
Length of output: 1928
🏁 Script executed:
rg -n "maxTokens" packages/typescript/ai-gemini/src/adapters/text.ts -B 2 -A 2Repository: TanStack/ai
Length of output: 37
🏁 Script executed:
grep -n "maxOutputTokens" packages/typescript/ai-gemini/src/text/text-provider-options.tsRepository: TanStack/ai
Length of output: 370
🏁 Script executed:
grep -n "maxTokens" packages/typescript/ai-gemini/tests/gemini-adapter.test.ts -B 3 -A 3Repository: TanStack/ai
Length of output: 492
🏁 Script executed:
rg -n "maxTokens\|maxOutputTokens" packages/typescript/ai-gemini/src/adapters/ -B 2 -A 2Repository: TanStack/ai
Length of output: 37
🏁 Script executed:
Repository: TanStack/ai
Length of output: 37
🏁 Script executed:
Repository: TanStack/ai
Length of output: 795
🏁 Script executed:
Repository: TanStack/ai
Length of output: 1315
🏁 Script executed:
Repository: TanStack/ai
Length of output: 130
🏁 Script executed:
Repository: TanStack/ai
Length of output: 108
🏁 Script executed:
Repository: TanStack/ai
Length of output: 177
🏁 Script executed:
cat -n packages/typescript/ai/src/activities/chat/adapter.ts | head -150Repository: TanStack/ai
Length of output: 5884
🏁 Script executed:
rg -n "maxTokens" packages/typescript/ai/src/activities/chat/adapter.ts -B 3 -A 3Repository: TanStack/ai
Length of output: 37
🏁 Script executed:
Repository: TanStack/ai
Length of output: 1576
🏁 Script executed:
Repository: TanStack/ai
Length of output: 37
🏁 Script executed:
Repository: TanStack/ai
Length of output: 37
🏁 Script executed:
Repository: TanStack/ai
Length of output: 1522
🏁 Script executed:
Repository: TanStack/ai
Length of output: 1352
🏁 Script executed:
rg -n "maxTokens.*maxOutputTokens\|maxOutputTokens.*maxTokens" packages/typescript/ai-gemini/ --type tsRepository: TanStack/ai
Length of output: 37
🏁 Script executed:
rg -n "const.*maxOutputTokens\|maxOutputTokens.*=" packages/typescript/ai-gemini/src --type ts -B 2 -A 2Repository: TanStack/ai
Length of output: 37
🏁 Script executed:
Repository: TanStack/ai
Length of output: 1964
🏁 Script executed:
rg -n "maxTokens.*maxOutputTokens" packages/typescript/ai-gemini/ -B 5 -A 5Repository: TanStack/ai
Length of output: 37
🏁 Script executed:
Repository: TanStack/ai
Length of output: 1395
🏁 Script executed:
rg -n "temperature\|topP" packages/typescript/ai-gemini/src/adapters/text.ts -B 2 -A 2Repository: TanStack/ai
Length of output: 37
🏁 Script executed:
Repository: TanStack/ai
Length of output: 37
Add
maxOutputTokenstoGeminiCommonConfigOptionsto support token limiting throughmodelOptions.The adapter's
mapCommonOptionsToGeminimethod spreadsmodelOptionsdirectly into Gemini'sconfigobject (line 814). SincetemperatureandtopPare now part ofGeminiCommonConfigOptions, the provider-native fieldmaxOutputTokensshould be exposed alongside them for type-safe token-limit control throughmodelOptions.🔧 Proposed fix
export interface GeminiCommonConfigOptions { /** * Controls the randomness of the output. Range: [0.0, 2.0]. Higher values produce more random output. */ temperature?: number /** * Nucleus sampling probability threshold. Range: (0.0, 1.0). Alter this or temperature, not both. */ topP?: number + /** + * Maximum number of tokens that can be generated in the response. + */ + maxOutputTokens?: number /** * The set of character sequences (up to 5) that will stop output generation. If specified, the API will stop at the first appearance of a stop_sequence. The stop sequence will not be included as part of the response. */ stopSequences?: Array<string>📝 Committable suggestion
🤖 Prompt for AI Agents