-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat:Add ChatThinkingContent, extend ChatTextContent, update descriptions #247
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
WalkthroughAdds a new ChatThinkingContent schema and integrates it into content unions. Extends ChatTextContent with an optional thinking field. Updates descriptions for reasoning configuration and type behavior (including how to disable reasoning). All changes are confined to src/libs/Cohere/openapi.yaml. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant API Server
participant Model
Client->>API Server: POST /chat (thinking: enabled/disabled)
API Server->>Model: Generate response (with reasoning config)
alt thinking enabled
Model-->>API Server: Stream chunks [thinking, text, ...]
API Server-->>Client: oneOf(ChatThinkingContent | ChatTextContent | ...)
note over Client: Client must handle both "thinking" and "text" content types
else thinking disabled
Model-->>API Server: Stream chunks [text, ...]
API Server-->>Client: ChatTextContent only
note over Client: No "thinking" content present
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ 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/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 0
🧹 Nitpick comments (3)
src/libs/Cohere/openapi.yaml (3)
12625-12632: Avoid duplicating “thinking” on ChatTextContent to prevent schema overlapAdding a thinking field to ChatTextContent creates two ways to carry “thinking” (as type=text with a thinking field, and as type=thinking via ChatThinkingContent). This overlap can complicate SDKs and client logic keyed off the discriminator. Recommend keeping “thinking” confined to ChatThinkingContent.
properties: text: type: string - thinking: - type: string type: enum: - textIf there was a separate reason to surface “thinking” on text items (e.g., legacy compatibility), please document it on the property and in the union description to guide client handling.
13057-13069: Add Fern metadata for SDK generation; fix minor grammar in description
- Consider marking the new schema public for parity with related content types and adding a stable Fern type name.
- Grammar: “models internal reasoning” → “model’s internal reasoning”.
ChatThinkingContent: required: - type - thinking type: object properties: thinking: type: string type: enum: - thinking type: string - description: 'Thinking content of the message. This will be present when `thinking` is enabled, and will contain the models internal reasoning.' + description: "Thinking content of the message. This will be present when `thinking` is enabled and will contain the model's internal reasoning." + x-fern-audiences: + - public + x-fern-type-name: ChatThinkingContent
17670-17677: Tighten YAML descriptions (avoid escaped quotes and stray newlines)Purely a formatting/readability nit:
- Prefer quoting that avoids escaping inside the YAML string.
- Remove the explicit “\n” at the end of description strings.
type: string - description: "Reasoning is enabled by default for models that support it, but can be turned off by setting `\"type\": \"disabled\"`.\n" + description: 'Reasoning is enabled by default for models that support it, but can be turned off by setting "type": "disabled".' x-fern-audiences: - public - description: "Configuration for [reasoning features](https://docs.cohere.com/docs/reasoning).\n" + description: "Configuration for [reasoning features](https://docs.cohere.com/docs/reasoning)."
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (17)
src/libs/Cohere/Generated/Cohere..JsonSerializerContext.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.CohereClient.Chatv2.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.ICohereClient.Chatv2.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.JsonConverters.ChatThinkingContentType.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.JsonConverters.ChatThinkingContentTypeNullable.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.JsonConverters.ContentItem.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.JsonConverters.ContentVariant2Item.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.JsonSerializerContextTypes.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.Models.ChatContentStartEventVariant2DeltaMessageContent.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.Models.ChatThinkingContent.Json.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.Models.ChatThinkingContent.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.Models.ChatThinkingContentType.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.Models.Chatv2Request.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.Models.ContentItem.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.Models.ContentVariant2Item.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.Models.Thinking.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.Models.ThinkingType.g.csis excluded by!**/generated/**
📒 Files selected for processing (1)
src/libs/Cohere/openapi.yaml(5 hunks)
⏰ 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: Test / Build, test and publish
🔇 Additional comments (2)
src/libs/Cohere/openapi.yaml (2)
12386-12392: Discriminator mapping forthinkingis already presentVerified that in
src/libs/Cohere/openapi.yamlthe discriminator blocks at lines 12390–12394 and 12426–12430 include:mapping: text: '#/components/schemas/ChatTextContent' thinking: '#/components/schemas/ChatThinkingContent'No changes needed.
12422-12428: No missing discriminator mappings for “thinking”Both occurrences of the ChatTextContent → ChatThinkingContent union already include the explicit
thinkingdiscriminator mapping:
- AssistantMessageResponse schema (around lines 12388–12392)
- AssistantMessageV2 schema (around lines 12422–12426)
No further updates are required here—please disregard the earlier suggestion.
Likely an incorrect or invalid review comment.
Summary by CodeRabbit
New Features
Documentation