Skip to content

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Aug 8, 2025

Summary by CodeRabbit

  • New Features
    • Introduced a new property to the API specification, enabling support for an additional response attribute.

@coderabbitai
Copy link

coderabbitai bot commented Aug 8, 2025

Walkthrough

A new property named thinking was introduced at the same hierarchical level as tool_choice in the OpenAPI specification file located at src/libs/Cohere/openapi.yaml. No other changes were made to the schema or its existing structure.

Changes

Cohort / File(s) Change Summary
OpenAPI Schema Update
src/libs/Cohere/openapi.yaml
Added a new property thinking alongside tool_choice in the OpenAPI schema.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant API (OpenAPI Spec)
    Client->>API (OpenAPI Spec): Send request with/without 'thinking' property
    API (OpenAPI Spec)-->>Client: Responds according to updated schema
Loading

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Poem

A rabbit thought, “What’s new to bring?”
In OpenAPI, we add some spring:
A property called thinking appears,
To organize thoughts for future years.
Hop, hop, hop—schema grows bright,
With every change, the docs feel light! 🐇✨

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

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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
  • 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 src/utils.ts and explain its main purpose.
    • @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 comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

Documentation and Community

  • 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 8, 2025 12:52
@HavenDV HavenDV merged commit 9c7fa48 into main Aug 8, 2025
3 of 4 checks passed
@HavenDV HavenDV deleted the bot/update-openapi_202508081251 branch August 8, 2025 12:54
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Add thinking property alongside tool_choice in OpenAPI specification Aug 8, 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: 3

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 467bf72 and 0424b4b.

📒 Files selected for processing (1)
  • src/libs/Cohere/openapi.yaml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
src/libs/Cohere/openapi.yaml

[error] 7486-7486: trailing spaces

(trailing-spaces)

format: float
x-fern-audiences:
- public
thinking:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix YAML lint: remove trailing whitespace after key.

The yamllint error is due to the trailing space after thinking:. This will fail CI if linting is enforced.

Apply this diff:

-                thinking: 
+                thinking:
🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 7486-7486: trailing spaces

(trailing-spaces)

🤖 Prompt for AI Agents
In src/libs/Cohere/openapi.yaml at line 7486, there is trailing whitespace after
the key `thinking:` which causes YAML linting errors. Remove the trailing space
immediately following `thinking:` to fix the lint issue and ensure the file
passes CI checks.

🛠️ Refactor suggestion

Define the schema for thinking (type, description, defaults).

Right now thinking: has no schema attributes. In OpenAPI this becomes an unconstrained/“any” type, which hurts validation and codegen.

Consider one of these options:

  • If it’s a boolean flag:
-                thinking:
+                thinking:
+                  type: boolean
+                  description: Enable model internal thinking behavior; thinking content is not returned.
+                  default: false
+                  x-fern-audiences:
+                    - public
  • If it’s a string mode:
-                thinking:
+                thinking:
+                  type: string
+                  description: Controls the model's thinking behavior.
+                  enum: [disabled, enabled, auto]
+                  default: disabled
+                  x-fern-audiences:
+                    - public

Confirm the intended semantics and I can update the spec accordingly.

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 7486-7486: trailing spaces

(trailing-spaces)

🤖 Prompt for AI Agents
In src/libs/Cohere/openapi.yaml at line 7486, the `thinking` property lacks a
defined schema, making it an unconstrained type that impairs validation and code
generation. Determine whether `thinking` is intended as a boolean flag or a
string mode, then update its schema accordingly by specifying the type (boolean
or string), adding a description, and setting any default values if applicable.

Comment on lines +7486 to 7489
thinking:
tool_choice:
enum:
- REQUIRED
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

❓ Verification inconclusive

Verify placement/indentation: ensure thinking is under the correct properties node.

Given the nearby format: float and x-fern-audiences, double‑check that thinking is a sibling property (e.g., alongside tool_choice) and not accidentally nested under another property like temperature. A small indent mistake will change the schema meaning and may pass YAML parse while breaking the OpenAPI structure.

Run structural validation and confirm thinking has a defined type:

Also update the required: array if thinking must be mandatory for this schema.


🏁 Script executed:

#!/bin/bash
set -euo pipefail

pip install --quiet "openapi-spec-validator>=0.7" "pyyaml>=6"

python - <<'PY'
from openapi_spec_validator import validate_spec
from openapi_spec_validator.readers import read_from_filename

fn = "src/libs/Cohere/openapi.yaml"
spec_dict, _ = read_from_filename(fn)
validate_spec(spec_dict)
print("OpenAPI spec structurally valid.")

# Walk the spec to find 'thinking' and report its path and type.
def walk(obj, path):
    if isinstance(obj, dict):
        for k, v in obj.items():
            new_path = path + [k]
            if k == "thinking" and isinstance(v, dict):
                t = v.get("type")
                print("Found 'thinking' at path:", ".".join(new_path), "type:", t)
                # Basic guard that it's under a 'properties' subtree
                if "properties" not in new_path:
                    print("WARNING: 'thinking' is not under a 'properties' mapping.")
            walk(v, new_path)
    elif isinstance(obj, list):
        for i, v in enumerate(obj):
            walk(v, path + [str(i)])

walk(spec_dict, [])
PY

Length of output: 85182


Fix thinking property indentation and type declaration

The OpenAPI spec is failing validation because thinking is defined as null. It must be a sibling under properties (alongside temperature, tool_choice, etc.) and include a type. For example:

• File: src/libs/Cohere/openapi.yaml (around lines 7486–7489)
• Under the POST /v2/chat requestBody schema → properties

Suggested diff:

   temperature:
     maximum: 1
     minimum: 0
     type: number
     format: float
     x-fern-audiences: ['public']
-  thinking: 
+  thinking:
+    type: boolean
+    description: "<brief description of what thinking represents>"
+    x-fern-audiences: ['public']
   tool_choice:
     enum:
       - REQUIRED
       - NONE
     description: "…"

If thinking must be mandatory, add "thinking" to the schema’s required: array.

🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 7486-7486: trailing spaces

(trailing-spaces)

🤖 Prompt for AI Agents
In src/libs/Cohere/openapi.yaml around lines 7486 to 7489, the `thinking`
property is incorrectly defined as null and not properly indented under
`properties` in the POST `/v2/chat` requestBody schema. Move `thinking` to be a
sibling under `properties` alongside `temperature` and `tool_choice`, define its
`type` explicitly (e.g., string or boolean as appropriate), and if `thinking` is
mandatory, add it to the schema's `required` array.

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