Skip to content

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Sep 20, 2025

Summary by CodeRabbit

  • Documentation
    • Marked several API endpoints and responses as deprecated in the public API reference to guide upcoming migrations.
    • Updated multi-language code samples (Node.js/TypeScript, Python, Java, Go, cURL) to clarify that image_url accepts either a base64 data URI or a web URL, with explicit comments.
    • Replaced an older Node.js example with a clearer variant highlighting image_url options.
    • No runtime behavior changes; action only needed if you depend on newly deprecated endpoints.

@coderabbitai
Copy link

coderabbitai bot commented Sep 20, 2025

Walkthrough

Deprecated flags were added to multiple paths and responses in the OpenAPI spec. Documentation code samples were updated to clarify that image_url accepts base64 data URIs or web URLs across several languages. No API signatures were changed.

Changes

Cohort / File(s) Summary of Changes
OpenAPI deprecations
src/libs/Cohere/openapi.yaml
Marked various endpoints and response objects as deprecated: true.
Docs sample clarifications
src/libs/Cohere/openapi.yaml
Updated code samples (Node.js/TypeScript, Python, Java, Go, cURL) to note image_url can be a base64 data URI or a web URL; added clarifying comments.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

I thump my paws at YAML lines,
Deprecated paths draw tidy signs.
Samples whisper, “URLs or base64,”
Clear as moonlight on the clover floor.
With gentle hops through docs I go—
A rabbit keeping APIs in tow. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The provided title "feat:@coderabbitai" is a short tag-like label that does not describe the primary change in this PR; it fails to convey that the OpenAPI spec marks multiple endpoints/responses as deprecated and that sample code comments for image_url were updated. Because the title is non-descriptive, a reviewer scanning history cannot infer the main intent or contents of the changeset. Please rename the PR to a concise, descriptive title that summarizes the main change, for example "feat(openapi): mark multiple endpoints deprecated and clarify image_url samples" or "chore(openapi): deprecate endpoints and update example comments", and update the PR description with a short list of affected paths so reviewers can quickly see the intent.
✅ 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_202509201238

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 20, 2025 12:39
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Add deprecation flags in OpenAPI spec; clarify image_url input Sep 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: 2

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

171-171: Schema-level deprecation: OK — add guidance to consumers.

deprecated: true on the search_queries_only boolean is valid. Add a short note in the property description with migration guidance (what to use instead) to help client generators and users.

-                  description: "Defaults to `false`.\n\nWhen `true`, the response will only contain a list of generated search queries, but no search will take place, and no reply from the model to the user's `message` will be generated.\n\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n"
+                  description: "Defaults to `false`.\n\nWhen `true`, the response will only contain a list of generated search queries, but no search will take place, and no reply from the model to the user's `message` will be generated.\n\nDeprecated: use <replacement-flag> instead. This field will be removed after the sunset date.\n\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n"

1007-1007: Operation deprecation: add replacement pointer and (optional) sunset metadata.

Marking the operation as deprecated is fine. Add a one-line description with the replacement path and consider an extension like x-sunset: 2025-12-31 or x-deprecation-reason.

       deprecated: true
+      description: "Deprecated. Use <new-endpoint> instead."
+      x-deprecation-reason: "Consolidated into <new-endpoint>."
+      x-sunset: "2025-12-31"

1131-1131: Same as above: document the migration path.

Repeat the replacement pointer and optional sunset fields for consistency across deprecated operations.

       deprecated: true
+      description: "Deprecated. Use <new-endpoint> instead."
+      x-deprecation-reason: "Consolidated into <new-endpoint>."
+      x-sunset: "2025-12-31"

1201-1201: Add deprecation rationale and successor endpoint.

       deprecated: true
+      description: "Deprecated. Use <new-endpoint> instead."
+      x-deprecation-reason: "Replaced by <new-endpoint> for performance and consistency."
+      x-sunset: "2025-12-31"

1274-1274: Consistent deprecation metadata.

       deprecated: true
+      description: "Deprecated. Use <new-endpoint> instead."
+      x-deprecation-reason: "Unified behavior under <new-endpoint>."
+      x-sunset: "2025-12-31"

1346-1346: Consistent deprecation metadata.

       deprecated: true
+      description: "Deprecated. Use <new-endpoint> instead."
+      x-deprecation-reason: "Superseded by <new-endpoint>."
+      x-sunset: "2025-12-31"

1424-1424: Consistent deprecation metadata.

       deprecated: true
+      description: "Deprecated. Use <new-endpoint> instead."
+      x-deprecation-reason: "API surface cleanup."
+      x-sunset: "2025-12-31"

1504-1504: Consistent deprecation metadata.

       deprecated: true
+      description: "Deprecated. Use <new-endpoint> instead."
+      x-deprecation-reason: "Functionality moved."
+      x-sunset: "2025-12-31"

6626-6626: Consistent deprecation metadata.

       deprecated: true
+      description: "Deprecated. Use <new-endpoint> instead."
+      x-deprecation-reason: "Consolidation."
+      x-sunset: "2025-12-31"

7181-7181: Consistent deprecation metadata.

       deprecated: true
+      description: "Deprecated. Use <new-endpoint> instead."
+      x-deprecation-reason: "Consolidation."
+      x-sunset: "2025-12-31"
📜 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 1f69eff.

⛔ 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

items:
$ref: '#/components/schemas/ChatConnector'
description: "Accepts `{\"id\": \"web-search\"}`, and/or the `\"id\"` for a custom [connector](https://docs.cohere.com/docs/connectors), if you've [created](https://docs.cohere.com/v1/docs/creating-and-deploying-a-connector) one.\n\nWhen specified, the model's reply will be enriched with information found by querying each of the connectors (RAG).\n\nCompatible Deployments: Cohere Platform\n"
deprecated: true
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Deprecation should be on the property, not the array items.

Placing deprecated: true under items deprecates each element’s schema (ChatConnector), not the connectors parameter/property itself. If the whole connectors field is deprecated, move deprecated: true up one level (sibling to items).

Apply this diff (adjust indentation to your YAML structure):

-                  deprecated: true
+                deprecated: true

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

🤖 Prompt for AI Agents
In src/libs/Cohere/openapi.yaml around line 66, the `deprecated: true` was
placed under `items` which deprecates each element schema instead of the entire
`connectors` property; remove the `deprecated` key from the `items` block and
add `deprecated: true` as a sibling to `items` on the `connectors` property
level (i.e., move `deprecated: true` up one indentation so it sits next to
`items` under the `connectors` field).

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

Code samples: unify model names and verify SDK field casing.

  • Use a consistent model across TS/Python/Java/Go/cURL (currently mixes command-a-vision-07-2025 and command-a-03-2025).
  • Confirm per-SDK casing for the image URL field: TS uses imageUrl, Python uses image_url, Go uses ImageUrl struct — these must match each SDK’s types.
  • Consider adding a data URI example alongside the web URL.

Proposed tweaks (illustrative):

-    model: 'command-a-vision-07-2025',
+    model: 'command-a-vision-07-2025',
@@
-              // Can be either a base64 data URI or a web URL.
+              // Can be either a base64 data URI (e.g., "data:image/png;base64,....") or a web URL.

To verify SDK field casing and client names, please confirm with current SDK docs:


🌐 Web query:

Cohere Node SDK v2: confirm client name (`CohereClientV2`) and image content field casing (`imageUrl.url` vs alternatives). Also verify Python SDK v2 uses `ClientV2()` and `image_url.url`.

💡 Result:

Short answers:

  • Cohere Node/TypeScript SDK v2 client class is CohereClientV2. [1][2]
  • Image content uses snake_case image_url with a nested url field (e.g. image_url: { url: "..." }); you should not use camelCase imageUrl.url. (Docs show the image content block as "type": "image_url" and "image_url": {"url": ...}). [3]
  • Cohere Python SDK v2 uses cohere.ClientV2() (and image content uses image_url with image_url["url"]). [4]

Sources:

  1. Cohere TypeScript SDK repo / npm usage (CohereClientV2).
  2. Cohere API reference / TypeScript examples (CohereClientV2).
  3. Cohere Image Inputs / Command A Vision docs showing "image_url": {"url": "..."} (snake_case).
  4. Cohere docs “Creating a client” and Python examples showing cohere.ClientV2().

If you want, I can paste the exact code snippets for Node and Python.


Unify model names and correct SDK image field casing

  • TS: use CohereClientV2 and send image content as snake_case image_url: { url: "..." } — do not use imageUrl.url.
  • Python: use cohere.ClientV2() and image_url["url"].
  • Go/Java/cURL: ensure language-specific types/JSON tags serialize to image_url (e.g., Go struct json:"image_url").
  • Unify the model string across all samples (currently mixes "command-a-vision-07-2025" and "command-a-03-2025").
  • Add a data URI example (e.g., "data:image/png;base64,...") alongside the web-URL example.

Location: src/libs/Cohere/openapi.yaml (around lines 8775–8787).

🤖 Prompt for AI Agents
In src/libs/Cohere/openapi.yaml around lines 8775 to 8787, example snippets use
inconsistent model names and incorrect image field casing and client names
across languages; update TypeScript to use CohereClientV2 and send images as
snake_case image_url: { url: "..." } (replace any imageUrl.url usage), update
Python to use cohere.ClientV2() and image_url["url"], ensure Go/Java/cURL
types/JSON tags serialize to image_url (e.g., Go struct json:"image_url"), unify
the model string across all samples to a single model identifier (pick one,
e.g., "command-a-vision-07-2025") and add an additional image example using a
data URI ("data:image/png;base64,...") alongside the existing web URL example.

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