-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat:Add thinking chat content type, mapping, and optional thinking field #244
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 “thinking” variant to chat content type-discriminator and introduces a corresponding ChatThinkingContent mapping. Extends ChatContentDeltaEventDeltaMessageContent with an optional thinking string field, alongside the existing text field, in src/libs/Cohere/openapi.yaml. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant API (Cohere)
participant Consumer (SDK/Server)
Client->>API (Cohere): Send/receive Chat content
API (Cohere)->>API (Cohere): Type-discriminate content (text | thinking)
API (Cohere)-->>Consumer (SDK/Server): Emit content delta (text and/or thinking)
Consumer (SDK/Server)->>Consumer (SDK/Server): Parse 'thinking' when present
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
✨ 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 (1)
src/libs/Cohere/openapi.yaml (1)
12425-12428
: Unable to locateChatThinkingContent
schemaI wasn’t able to find
ChatThinkingContent
undercomponents/schemas
insrc/libs/Cohere/openapi.yaml
. Please verify that you have:
- Defined a
ChatThinkingContent
schema:
- Includes a
type
property (string) with enumthinking
, andtype
listed inrequired
- Sets
additionalProperties: false
- Updated the discriminator mapping to include
thinking:#/components/schemas/ChatThinkingContent
- (Optional) Added a brief description and example for
ChatThinkingContent
semantics
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
src/libs/Cohere/Generated/Cohere.Models.AssistantMessageV2ContentVariant2ItemDiscriminatorType.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.ChatContentDeltaEventVariant2DeltaMessageContent.g.cs
is excluded by!**/generated/**
📒 Files selected for processing (1)
src/libs/Cohere/openapi.yaml
(2 hunks)
🔇 Additional comments (1)
src/libs/Cohere/openapi.yaml (1)
12585-12590
: Delta schema: enforce exclusivity ofthinking
vstext
In src/libs/Cohere/openapi.yaml (lines 12586–12589) theChatContentDeltaEventDeltaMessageContent
object currently declares bothtext
andthinking
as plain strings with no validation or mutual-exclusion—whereas the full‐message payload (around lines 12390–12393) uses a discriminator to enforce oneOf betweenChatTextContent
andChatThinkingContent
.Suggestions:
• If you intend that each delta carries either text or thinking (but never both), replace the flatproperties
block with a oneOf that mirrors the full‐payload schemas. For example:oneOf: - $ref: '#/components/schemas/ChatTextContentDelta' - $ref: '#/components/schemas/ChatThinkingContentDelta' additionalProperties: falseThen define each
*Delta
schema with a requiredtext
orthinking
field andminLength: 1
.• If you intend to keep the current shape, at minimum tighten the new field in place:
- thinking: - type: string + thinking: + type: string + description: "Streaming delta of model thinking/rationale." + minLength: 1 + # consider readOnly: true if response-onlyPlease also verify:
• That the full-message schemas (ChatTextContent
,ChatThinkingContent
) and any non-delta events consistently include athinking
branch.
• Whether SDKs should exposethinking
by default or gate it behind a feature flag to avoid breaking existing clients.Once you confirm the desired exclusivity and client expectations, I’ll update all affected OpenAPI blocks and add examples.
Summary by CodeRabbit
New Features
Chores