Skip to content

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Aug 20, 2025

Summary by CodeRabbit

  • New Features

    • Added support for “thinking” content in chat responses, enabling separate reasoning streams alongside text.
    • Extended text content to optionally include a thinking field.
    • Clarified that reasoning is on by default for supported models and can be disabled via type set to “disabled”.
  • Documentation

    • Simplified and clarified reasoning configuration descriptions.
    • Added a direct link to reasoning feature documentation.
    • Documented when thinking content appears and what it represents.

@coderabbitai
Copy link

coderabbitai bot commented Aug 20, 2025

Walkthrough

Adds 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

Cohort / File(s) Summary of Changes
OpenAPI schema updates
src/libs/Cohere/openapi.yaml
Added ChatThinkingContent schema; added thinking:string to ChatTextContent; included ChatThinkingContent in two oneOf content unions; updated reasoning/type descriptions; shortened thinking-related description with link to reasoning docs.

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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

I twitch my ears at schemas new,
A thinking stream now hopping through—
With text and thoughts in tidy rows,
The unions bloom like garden prose.
If reasoning naps, just say “disabled,”
I’ll nibble docs while flows are labeled. 🐇✨

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
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bot/update-openapi_202508201831

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@HavenDV HavenDV enabled auto-merge (squash) August 20, 2025 18:32
@HavenDV HavenDV merged commit 9fb30e6 into main Aug 20, 2025
3 of 4 checks passed
@HavenDV HavenDV deleted the bot/update-openapi_202508201831 branch August 20, 2025 18:34
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Add ChatThinkingContent, extend ChatTextContent, update descriptions Aug 20, 2025
Copy link

@coderabbitai coderabbitai bot left a 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 overlap

Adding 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:
                             - text

If 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.

📥 Commits

Reviewing files that changed from the base of the PR and between c23d795 and d678569.

⛔ Files ignored due to path filters (17)
  • src/libs/Cohere/Generated/Cohere..JsonSerializerContext.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.CohereClient.Chatv2.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.ICohereClient.Chatv2.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.JsonConverters.ChatThinkingContentType.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.JsonConverters.ChatThinkingContentTypeNullable.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.JsonConverters.ContentItem.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.JsonConverters.ContentVariant2Item.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.JsonSerializerContextTypes.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.Models.ChatContentStartEventVariant2DeltaMessageContent.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.Models.ChatThinkingContent.Json.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.Models.ChatThinkingContent.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.Models.ChatThinkingContentType.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.Models.Chatv2Request.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.Models.ContentItem.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.Models.ContentVariant2Item.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.Models.Thinking.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.Models.ThinkingType.g.cs is 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 for thinking is already present

Verified that in src/libs/Cohere/openapi.yaml the 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 thinking discriminator 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants