Skip to content

Conversation

HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Sep 19, 2025

Summary by CodeRabbit

  • Deprecations

    • Multiple API endpoints are now marked as deprecated in the OpenAPI specification.
    • Specific parameters, including a ChatConnector-related parameter and search_queries_only, are marked as deprecated.
    • Certain error response sections (e.g., Service Unavailable/Gateway Timeout) indicate deprecation status.
  • Documentation

    • Updated Images code samples (Node.js, TypeScript, Python, Go, Java) to clarify that image_url accepts either a base64 data URI or a web URL.
    • No changes to the curl sample.

Copy link

coderabbitai bot commented Sep 19, 2025

Walkthrough

OpenAPI spec updated to mark multiple operations and parameters as deprecated, including ChatConnector-related and search_queries_only. Certain responses include deprecated: true. Sample snippets for Images now annotate image_url to accept base64 data URIs or web URLs. No runtime or control-flow changes.

Changes

Cohort / File(s) Summary
OpenAPI deprecations and sample notes
src/libs/Cohere/openapi.yaml
Added deprecated: true to several operations and parameters (including ChatConnector-related and search_queries_only), and to certain response blocks (e.g., 503/504). Updated Images samples to comment that image_url may be a base64 data URI or a web URL.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

I thump my paws on parchment clean,
Deprecated trails now clearly seen;
Image URLs, base64 or streams,
The spec now whispers cautious themes.
I hop through YAML, ears held high—
Marked paths fade, while new ones try. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The PR title "feat:@coderabbitai" is a terse bot/mention label that does not describe the substantive changes in this changeset. The diff updates the OpenAPI spec—marking several operations and parameters deprecated and adding image_url example comments—so the title fails to summarize the main change. As written it is too vague for a reviewer to understand intent or scope. Please rewrite the title to a concise single sentence that highlights the primary change; for example "openapi: mark ChatConnector param and multiple endpoints deprecated" or "openapi: deprecate search_queries_only and several operations; update image_url examples". Use a scope prefix (e.g., openapi or docs) and an action verb (deprecate/mark) so the intent is clear. Also add a short PR description body listing the affected paths and rationale for the deprecations.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ 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_202509190631

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@HavenDV HavenDV enabled auto-merge (squash) September 19, 2025 06:32
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Mark OpenAPI operations/params deprecated and update Images image_url Sep 19, 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: 2

🧹 Nitpick comments (6)
src/libs/Cohere/openapi.yaml (6)

168-174: Good: explicit deprecation on search_queries_only. Add guidance.

Marking the property deprecated is fine. Add a deprecation rationale and a replacement hint (e.g., x-deprecation-reason, x-replaced-by) so SDKs/docs can surface migration paths.

If you have a replacement, append:

x-deprecation-reason: "Explain why."
x-replaced-by: "new_parameter_name"

1128-1134: Same as above: deprecation is fine; add rationale/sunset.

Run the same lint as in the prior comment.


1198-1204: Same pattern—looks good; add deprecation metadata.

Confirm lint passes and that operationId remains stable for SDKs.


1271-1277: OK to deprecate; communicate replacement and timelines.

Add:

x-deprecation-reason: ""
x-sunset-date: "2026-03-31"

1501-1507: Deprecation OK; consider 410 plan post-sunset.

Plan to flip to 410 Gone after the sunset date.


6623-6629: LGTM; ensure monitoring/alerts for residual traffic.

Add alerts to track traffic to deprecated operation before removal.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 111c2a6 and d134434.

⛔ Files ignored due to path filters (21)
  • src/libs/Cohere/Generated/Cohere.CohereClient.Chat.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.CohereClient.Classify.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.CohereClient.Generate.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.CohereClient.Summarize.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.ConnectorsClient.CreateConnector.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.ConnectorsClient.DeleteConnector.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.ConnectorsClient.GetConnector.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.ConnectorsClient.ListConnectors.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.ConnectorsClient.OAuthAuthorizeConnector.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.ConnectorsClient.UpdateConnector.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.ICohereClient.Chat.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.ICohereClient.Classify.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.ICohereClient.Generate.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.ICohereClient.Summarize.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.IConnectorsClient.CreateConnector.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.IConnectorsClient.DeleteConnector.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.IConnectorsClient.GetConnector.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.IConnectorsClient.ListConnectors.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.IConnectorsClient.OAuthAuthorizeConnector.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.IConnectorsClient.UpdateConnector.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.Models.ChatRequest.g.cs is excluded by !**/generated/**
📒 Files selected for processing (1)
  • src/libs/Cohere/openapi.yaml (12 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 (4)
src/libs/Cohere/openapi.yaml (4)

1343-1349: Operation marked deprecated—LGTM; check tags/docs sync.

Ensure changelog/release notes reflect this endpoint’s deprecation.


1421-1427: Consistent deprecation—nice. Validate no breaking SDK regen.

If codegen is automated, gate SDK release with a deprecation notice rather than removal.


7178-7184: Deprecation consistent—verify SDKs treat as warn, not error.

Some generators break on deprecated fields if configured strictly; ensure config is warning-only.


63-69: Fix invalid $ref siblings and clarify deprecation target.

Ran npx -y @redocly/cli@latest lint src/libs/Cohere/openapi.yaml — validation failed (1 error, 20 warnings). Top error: Schema type mismatch at src/libs/Cohere/openapi.yaml:13949 (#/components/schemas/EmbedByTypeResponse/properties/embeddings/items). Resolve that validation error first; then address the $ref/deprecated placement below.

Placing description/deprecated alongside $ref under items is illegal in OAS 3.0 and ambiguous in 3.1. If the intent is to deprecate the connectors parameter (not the item schema), move deprecated to the parameter/property level.

Apply one of the following:

Option A — deprecate the field (preferred):

 items:
-  $ref: '#/components/schemas/ChatConnector'
-  description: "Accepts …"
-  deprecated: true
+  $ref: '#/components/schemas/ChatConnector'
+  description: "Accepts …"
+deprecated: true  # move to the connectors parameter/property node

Option B — keep on items but avoid $ref siblings:

 items:
-  $ref: '#/components/schemas/ChatConnector'
-  description: "Accepts …"
-  deprecated: true
+  allOf:
+    - $ref: '#/components/schemas/ChatConnector'
+  description: "Accepts …"
+  deprecated: true

Run a validator again after fixes:

#!/bin/bash
npx -y @redocly/cli@latest lint src/libs/Cohere/openapi.yaml

Comment on lines 1004 to 1010
$ref: '#/components/responses/ServiceUnavailable'
'504':
$ref: '#/components/responses/GatewayTimeout'
deprecated: true
x-fern-audiences:
- public
x-fern-examples:
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

🧩 Analysis chain

Operation deprecation OK; confirm indentation and surface migration.

deprecated: true at the operation level is correct. Ensure indentation places it as a sibling of responses, not inside it. Add x-deprecation-reason/x-sunset-date for docs.


🏁 Script executed:

#!/bin/bash
npx -y @redocly/cli@latest lint src/libs/Cohere/openapi.yaml
rg -nC2 -P '^\s*deprecated:\s*true\s*$' src/libs/Cohere/openapi.yaml

Length of output: 11747


Fix blocking OpenAPI lint errors; confirm deprecation placement & add deprecation metadata.

  • Blocking error: src/libs/Cohere/openapi.yaml:13949 — components/schemas/EmbedByTypeResponse/properties/embeddings/items: Schema type mismatch ('object' type should not contain 'items'). Fix this schema first.
  • Resolve undefined required-property warnings (examples): CreateConnectorOAuth required keys missing at 13572–13575 (clientId, clientSecret, authorizeUrl, tokenUrl); api_version required but undefined at 13943 and 15255; address other linter warnings.
  • Deprecation: operation-level deprecated: true is present (examples ~lines 66, 171, 862). Ensure deprecated: true is a sibling of responses (not nested) and add x-deprecation-reason and x-sunset-date on deprecated operations for documentation.
🤖 Prompt for AI Agents
In src/libs/Cohere/openapi.yaml around lines 1004 to 1010, fix multiple OpenAPI
linter errors: change components/schemas/EmbedByTypeResponse so that the
embeddings property uses a valid schema (if embeddings is an array declare type:
array with items: {type: object/...} or if it is an object remove items and use
properties/type: object), ensure every name in CreateConnectorOAuth's required
array (clientId, clientSecret, authorizeUrl, tokenUrl) actually exists under its
properties (add those property definitions or remove them from required), define
the missing api_version property where it's marked required (or remove it from
required) at the noted locations, resolve any other undefined-required warnings
by adding matching property definitions, and move deprecated: true to be a
sibling of responses for operation-level deprecations and add
x-deprecation-reason and x-sunset-date metadata to those deprecated operations
to satisfy linting and documentation requirements.

Comment on lines +8775 to 8787
- code: "const { CohereClientV2 } = require('cohere-ai');\n\nconst cohere = new CohereClientV2({});\n\n(async () => {\n const response = await cohere.chat({\n model: 'command-a-vision-07-2025',\n messages: [\n {\n role: 'user',\n content: [\n { type: 'text', text: 'Describe the logo!' },\n {\n type: 'image_url',\n imageUrl: {\n // Can be either a base64 data URI or a web URL.\n url: 'https://cohere.com/favicon-32x32.png',\n detail: 'auto',\n },\n },\n ],\n },\n ],\n });\n console.log(response.message.content[0].text);\n})();\n"
name: Images
sdk: typescript
- code: "import cohere\n\nco = cohere.ClientV2()\n\nresponse = co.chat(\n model=\"command-a-vision-07-2025\",\n messages=[\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Describe the logo!\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"https://cohere.com/favicon-32x32.png\",\n \"detail\": \"auto\"\n }\n }\n ]\n \n }\n ]\n)\n\nprint(response)"
- code: "import cohere\n\nco = cohere.ClientV2()\n\nresponse = co.chat(\n model=\"command-a-vision-07-2025\",\n messages=[\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Describe the logo!\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n # Can be either a base64 data URI or a web URL.\n \"url\": \"https://cohere.com/favicon-32x32.png\",\n \"detail\": \"auto\"\n }\n }\n ]\n \n }\n ]\n)\n\nprint(response)"
name: Images
sdk: python
- code: "/* (C)2024 */\npackage chatv2post;\n\nimport java.util.List;\n\nimport com.cohere.api.Cohere;\nimport com.cohere.api.resources.v2.requests.V2ChatRequest;\nimport com.cohere.api.types.ChatMessageV2;\nimport com.cohere.api.types.ChatResponse;\nimport com.cohere.api.types.Content;\nimport com.cohere.api.types.ImageContent;\nimport com.cohere.api.types.ImageUrl;\nimport com.cohere.api.types.TextContent;\nimport com.cohere.api.types.UserMessage;\nimport com.cohere.api.types.UserMessageContent;\n\npublic class Image {\n\n public static void main(String[] args) {\n Cohere cohere = Cohere.builder().clientName(\"snippet\").build();\n\n ChatResponse response\n = cohere\n .v2()\n .chat(\n V2ChatRequest.builder()\n .model(\"command-a-vision-07-2025\")\n .messages(\n List.of(\n ChatMessageV2.user(\n UserMessage.builder()\n .content(\n UserMessageContent.of(\n List.of(\n Content.text(\n TextContent.builder()\n .text(\"Describe the logo!\")\n .build()),\n Content.imageUrl(\n ImageContent.builder()\n .imageUrl(\n ImageUrl.builder()\n .url(\n \"https://cohere.com/favicon-32x32.png\")\n .build())\n .build()))))\n .build())))\n .build());\n System.out.println(response);\n }\n}\n"
- code: "/* (C)2024 */\npackage chatv2post;\n\nimport java.util.List;\n\nimport com.cohere.api.Cohere;\nimport com.cohere.api.resources.v2.requests.V2ChatRequest;\nimport com.cohere.api.types.ChatMessageV2;\nimport com.cohere.api.types.ChatResponse;\nimport com.cohere.api.types.Content;\nimport com.cohere.api.types.ImageContent;\nimport com.cohere.api.types.ImageUrl;\nimport com.cohere.api.types.TextContent;\nimport com.cohere.api.types.UserMessage;\nimport com.cohere.api.types.UserMessageContent;\n\npublic class Image {\n\n public static void main(String[] args) {\n Cohere cohere = Cohere.builder().clientName(\"snippet\").build();\n\n ChatResponse response\n = cohere\n .v2()\n .chat(\n V2ChatRequest.builder()\n .model(\"command-a-vision-07-2025\")\n .messages(\n List.of(\n ChatMessageV2.user(\n UserMessage.builder()\n .content(\n UserMessageContent.of(\n List.of(\n Content.text(\n TextContent.builder()\n .text(\"Describe the logo!\")\n .build()),\n Content.imageUrl(\n ImageContent.builder()\n .imageUrl(\n ImageUrl.builder()\n // Can be either a base64 data URI or a web URL.\n .url(\n \"https://cohere.com/favicon-32x32.png\")\n .build())\n .build()))))\n .build())))\n .build());\n System.out.println(response);\n }\n}\n"
name: Images
sdk: java
- code: "package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tcohere \"github.com/cohere-ai/cohere-go/v2\"\n\tclient \"github.com/cohere-ai/cohere-go/v2/client\"\n)\n\nfunc main() {\n\tco := client.NewClient(client.WithToken(os.Getenv(\"CO_API_KEY\")))\n\n\tresp, err := co.V2.Chat(\n\t\tcontext.TODO(),\n\t\t&cohere.V2ChatRequest{\n\t\t\tModel: \"command-a-03-2025\",\n\t\t\tMessages: cohere.ChatMessages{\n\t\t\t\t{\n\t\t\t\t\tRole: \"user\",\n\t\t\t\t\tUser: &cohere.UserMessageV2{Content: &cohere.UserMessageV2Content{\n\t\t\t\t\t\tContentList: []*cohere.Content{\n\t\t\t\t\t\t\t{Type: \"text\", Text: &cohere.ChatTextContent{Text: \"Describe the logo!\"}},\n\t\t\t\t\t\t\t{Type: \"image_url\", ImageUrl: &cohere.ImageContent{\n\t\t\t\t\t\t\t\tImageUrl: &cohere.ImageUrl{\n\t\t\t\t\t\t\t\t\tUrl: \"https://cohere.com/favicon-32x32.png\",\n\t\t\t\t\t\t\t\t\tDetail: cohere.ImageUrlDetailAuto.Ptr(),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}},\n\t\t\t\t\t\t}}},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tlog.Printf(\"%+v\", resp)\n}\n"
- code: "package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tcohere \"github.com/cohere-ai/cohere-go/v2\"\n\tclient \"github.com/cohere-ai/cohere-go/v2/client\"\n)\n\nfunc main() {\n\tco := client.NewClient(client.WithToken(os.Getenv(\"CO_API_KEY\")))\n\n\tresp, err := co.V2.Chat(\n\t\tcontext.TODO(),\n\t\t&cohere.V2ChatRequest{\n\t\t\tModel: \"command-a-03-2025\",\n\t\t\tMessages: cohere.ChatMessages{\n\t\t\t\t{\n\t\t\t\t\tRole: \"user\",\n\t\t\t\t\tUser: &cohere.UserMessageV2{Content: &cohere.UserMessageV2Content{\n\t\t\t\t\t\tContentList: []*cohere.Content{\n\t\t\t\t\t\t\t{Type: \"text\", Text: &cohere.ChatTextContent{Text: \"Describe the logo!\"}},\n\t\t\t\t\t\t\t{Type: \"image_url\", ImageUrl: &cohere.ImageContent{\n\t\t\t\t\t\t\t\tImageUrl: &cohere.ImageUrl{\n\t\t\t\t\t\t\t\t\t// Can be either a base64 data URI or a web URL.\n\t\t\t\t\t\t\t\t\tUrl: \"https://cohere.com/favicon-32x32.png\",\n\t\t\t\t\t\t\t\t\tDetail: cohere.ImageUrlDetailAuto.Ptr(),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}},\n\t\t\t\t\t\t}}},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tlog.Printf(\"%+v\", resp)\n}\n"
name: Images
sdk: go
- code: "curl --request POST \\\n --url https://api.cohere.com/v2/chat \\\n --header 'accept: application/json' \\\n --header 'content-type: application/json' \\\n --header \"Authorization: bearer $CO_API_KEY\" \\\n --data '{\n \"model\": \"command-a-vision-07-2025\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Describe the logo!\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"https://cohere.com/favicon-32x32.png\",\n \"detail\": \"auto\"\n }\n }\n ]\n }\n ]\n }'\n"
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

🧩 Analysis chain

Sample updates: verify field casing and model consistency across SDKs.

  • TS uses imageUrl under type: 'image_url'; Python/curl use image_url. Confirm SDK expects camelCase vs snake_case for the nested field.
  • Models vary (command-a-vision-07-2025 vs command-a-03-2025). Consider aligning to one for clarity.

🌐 Web query:

For Cohere V2 SDKs, what is the correct field name for the image URL content in:
- Node/TS Content items (imageUrl vs image_url)?
- Python SDK (image_url)?
Do official docs provide a canonical sample?

💡 Result:

  • Node/TypeScript content items: use image_url (snake_case), not imageUrl. [1][2]
  • Python SDK: use image_url (snake_case). [1][3]
  • Official canonical samples: yes — Cohere's docs (Chat API / Image Inputs) show the image content part as {"type":"image_url", "image_url": {"url": "..."} } (see Chat and Image Inputs pages). [1][2]

Sources:
[1] Cohere — Using Cohere's Models to Work with Image Inputs (examples showing "type":"image_url" and "image_url": {"url": ...}).
[2] Cohere — Chat API reference (chat message content examples use "image_url").
[3] Cohere — Embed / SDK docs and SDK repo (Python examples use "image_url").


Use snake_case "image_url" for image inputs and unify model id

Cohere docs/SDKs use image_url (snake_case) for Content items; canonical sample: {"type":"image_url","image_url":{"url":"..."}}.

  • Replace any imageUrl keys in src/libs/Cohere/openapi.yaml (≈ lines 8775–8787) with image_url and update nested schemas/examples to match the canonical sample.
  • Standardize the model identifier across the spec (choose and use either command-a-vision-07-2025 or command-a-03-2025) and update all references/examples.

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.

1 participant