feat(web): add per-model temperature configuration#1103
Conversation
Adds an optional `temperature` field to all language model provider schemas, allowing temperature to be configured per model instead of globally via environment variable. The per-model setting takes precedence, with the env var as a fallback. Also deprecates SOURCEBOT_CHAT_MODEL_TEMPERATURE (now defaults to undefined instead of 0.3) in favor of the per-model config. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Caution Review failedPull request was closed or merged during review WalkthroughThis PR adds a per-model Changes
Sequence DiagramsequenceDiagram
participant RouteHandler as Route Handler
participant UtilsServer as getAISDKLanguageModelAndOptions
participant Agent as createMessageStream/Agent
participant StreamText as streamText (AI SDK)
RouteHandler->>UtilsServer: getAISDKLanguageModelAndOptions(languageModelConfig)
UtilsServer-->>RouteHandler: { model, providerOptions, temperature }
RouteHandler->>Agent: createMessageStream({ model, modelTemperature: temperature, ... })
Agent->>StreamText: streamText({ ..., temperature: temperature ?? env.SOURCEBOT_CHAT_MODEL_TEMPERATURE })
StreamText-->>Agent: stream response
Agent-->>RouteHandler: message stream
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
…ation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
temperaturefield to all 12 language model provider schemas, allowing temperature to be set per modelSOURCEBOT_CHAT_MODEL_TEMPERATUREenv var, which is now deprecated and defaults toundefinedtemperaturethroughgetAISDKLanguageModelAndOptions→createMessageStream→createAgentStream→streamText🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Changed
SOURCEBOT_CHAT_MODEL_TEMPERATUREenvironment variable is deprecated. Use per-model temperature configuration instead. When not configured, temperature defaults to API provider settings.