-
Notifications
You must be signed in to change notification settings - Fork 134
feat(ask_sb): Add reasoningEffort option to openai provider #446
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
♻️ Duplicate comments (3)
docs/snippets/schemas/v3/languageModel.schema.mdx (1)
1434-1443
: See comment on Lines 618-627 – the sameenum
restriction should be applied here as well.packages/schemas/src/v3/languageModel.schema.ts (1)
1434-1443
: Duplicate of the previous comment – apply the sameenum
/default
adjustment here.docs/snippets/schemas/v3/index.schema.mdx (1)
2638-2646
: Same schema issue duplicatedThe identical
reasoningEffort
block in themodels.oneOf
section 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.mdx
CHANGELOG.md
packages/web/src/app/api/(server)/chat/route.ts
packages/schemas/src/v3/languageModel.type.ts
packages/schemas/src/v3/index.type.ts
schemas/v3/languageModel.json
packages/schemas/src/v3/index.schema.ts
docs/snippets/schemas/v3/languageModel.schema.mdx
docs/snippets/schemas/v3/index.schema.mdx
packages/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
reasoningEffort
option 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
reasoningEffort
parameter 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
reasoningEffort
property 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
reasoningEffort
property with consistent typing and documentation.packages/web/src/app/api/(server)/chat/route.ts (1)
443-443
: LGTM!The implementation correctly makes
reasoningEffort
configurable 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
reasoningEffort
property 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
reasoningEffort
property definition in the oneOf array is identical to the definitions section, ensuring proper schema consistency.
Summary by CodeRabbit
New Features
Documentation