feat(ask_sb): Add reasoningEffort option to openai provider#446
feat(ask_sb): Add reasoningEffort option to openai provider#446brendan-kellam merged 3 commits intomainfrom
Conversation
WalkthroughThis change introduces a new optional Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant API (chat/route.ts)
participant OpenAIProvider
User->>API (chat/route.ts): Send chat request with config
API (chat/route.ts)->>API (chat/route.ts): Read `reasoningEffort` from config (default: "medium")
API (chat/route.ts)->>OpenAIProvider: Instantiate with `reasoningEffort`
OpenAIProvider-->>API (chat/route.ts): Processed response
API (chat/route.ts)-->>User: Return chat response
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Suggested reviewers
Poem
Note 🔌 MCP (Model Context Protocol) integration is now available in Early Access!Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context. ✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Actionable comments posted: 4
♻️ Duplicate comments (3)
docs/snippets/schemas/v3/languageModel.schema.mdx (1)
1434-1443: See comment on Lines 618-627 – the sameenumrestriction should be applied here as well.packages/schemas/src/v3/languageModel.schema.ts (1)
1434-1443: Duplicate of the previous comment – apply the sameenum/defaultadjustment here.docs/snippets/schemas/v3/index.schema.mdx (1)
2638-2646: Same schema issue duplicatedThe identical
reasoningEffortblock in themodels.oneOfsection has the same lax validation and missing default; apply the fix above or factor out a shared definition to keep the schema DRY.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (10)
CHANGELOG.md(1 hunks)docs/docs/configuration/language-model-providers.mdx(1 hunks)docs/snippets/schemas/v3/index.schema.mdx(2 hunks)docs/snippets/schemas/v3/languageModel.schema.mdx(2 hunks)packages/schemas/src/v3/index.schema.ts(2 hunks)packages/schemas/src/v3/index.type.ts(1 hunks)packages/schemas/src/v3/languageModel.schema.ts(2 hunks)packages/schemas/src/v3/languageModel.type.ts(1 hunks)packages/web/src/app/api/(server)/chat/route.ts(1 hunks)schemas/v3/languageModel.json(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*
📄 CodeRabbit Inference Engine (.cursor/rules/style.mdc)
Filenames should always be camelCase. Exception: if there are filenames in the same directory with a format other than camelCase, use that format to keep things consistent.
Files:
docs/docs/configuration/language-model-providers.mdxCHANGELOG.mdpackages/web/src/app/api/(server)/chat/route.tspackages/schemas/src/v3/languageModel.type.tspackages/schemas/src/v3/index.type.tsschemas/v3/languageModel.jsonpackages/schemas/src/v3/index.schema.tsdocs/snippets/schemas/v3/languageModel.schema.mdxdocs/snippets/schemas/v3/index.schema.mdxpackages/schemas/src/v3/languageModel.schema.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (7)
CHANGELOG.md (1)
12-12: LGTM!The changelog entry properly documents the new
reasoningEffortoption for the OpenAI provider with correct formatting and PR reference.docs/docs/configuration/language-model-providers.mdx (1)
251-252: LGTM!The documentation correctly showcases the new
reasoningEffortparameter with proper JSON formatting and helpful default value information.packages/schemas/src/v3/index.type.ts (1)
795-798: LGTM!The TypeScript interface correctly adds the optional
reasoningEffortproperty with proper typing and helpful documentation comment referencing the OpenAI docs.packages/schemas/src/v3/languageModel.type.ts (1)
366-369: LGTM!The TypeScript interface correctly adds the optional
reasoningEffortproperty with consistent typing and documentation.packages/web/src/app/api/(server)/chat/route.ts (1)
443-443: LGTM!The implementation correctly makes
reasoningEffortconfigurable by reading from the language model configuration, with proper fallback to the documented default value of 'medium'.packages/schemas/src/v3/index.schema.ts (2)
1821-1830: Well-structured schema property addition.The
reasoningEffortproperty is correctly defined with appropriate type, description, and examples. The reference to OpenAI documentation enhances clarity for users.
2637-2646: Consistent schema definition maintained.The
reasoningEffortproperty definition in the oneOf array is identical to the definitions section, ensuring proper schema consistency.
Summary by CodeRabbit
New Features
Documentation