Conversation
🦋 Changeset detectedLatest commit: 33fd3bd The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| type OpenRouterChatCompletionParams = OpenAI.Chat.ChatCompletionCreateParams & { | ||
| transforms?: string[] | ||
| include_reasoning?: boolean | ||
| thinking?: BetaThinkingConfigParam |
There was a problem hiding this comment.
Per OpenRouter's Discord, this is supported now. I tested it as well. It defaults to max(min(max_tokens * 0.8, 32000), 1024) if omitted.
src/api/providers/anthropic.ts
Outdated
| const maxTokens = this.getModel().info.maxTokens || 8192 | ||
| let { id: modelId, info: modelInfo } = this.getModel() | ||
| const maxTokens = modelInfo.maxTokens || 8192 | ||
| const budgetTokens = this.options.anthropicThinking ?? Math.min(maxTokens - 1, 8192) |
There was a problem hiding this comment.
I think openrouter had some comment about making this at least 1024 smaller than max tokens
There was a problem hiding this comment.
There was a problem hiding this comment.
Oh I see you mention this below - but maybe want better fallback settings? 🤷
There was a problem hiding this comment.
Right - I think you want to allow for non-thinking output tokens. Will fix.
mrubens
left a comment
There was a problem hiding this comment.
Looks good!
I guess the people currently on Anthropic with thinking would lose it temporarily? Not sure if worth trying to handle somehow.
Yeah - thinking will flip off, but hopefully easy to figure out how to flip it back on, and it will be more consistent with the various routers. |
Description
thinkingparams that OpenRouter is temporarily supportingType of change
How Has This Been Tested?
Checklist:
Additional context
Related Issues
Reviewers
Important
Support 'thinking' params for OpenRouter, split Claude 3.7 Sonnet into two models, and always show Thinking Budget for thinking models.
thinkingparams to OpenRouter inopenrouter.ts.claude-3-7-sonnetinto two models inanthropic.tsandapi.ts.ApiOptions.tsxfor thinking models.claude-3-7-sonnet:thinkingmodel inapi.tswith specific attributes.ApiOptions.tsxand directly shows Thinking Budget slider.This description was created by
for 33fd3bd. It will automatically update as commits are pushed.