Skip to content

Conversation

HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Sep 21, 2025

Summary by CodeRabbit

  • Documentation

    • Marked multiple API endpoints and response types as deprecated in the API reference.
    • Updated Images section examples across TypeScript, Python, Java, Go, and JavaScript to clarify that image_url accepts either a base64 data URI or a web URL.
    • Minor formatting improvements for clarity and consistency.
  • Chores

    • General cleanup of API specification annotations without altering functional behavior.

@HavenDV HavenDV enabled auto-merge (squash) September 21, 2025 18:27
Copy link

coderabbitai bot commented Sep 21, 2025

Walkthrough

Marked multiple OpenAPI paths and responses as deprecated and updated Images section code examples across SDKs with a note clarifying that image_url can be a base64 data URI or a web URL. Minor formatting adjustments; no functional API signature changes.

Changes

Cohort / File(s) Summary
OpenAPI spec deprecations and example comments
src/libs/Cohere/openapi.yaml
Added deprecated: true to various paths/responses; updated Images examples for TypeScript, Python, Java, Go, and JavaScript with clarifying comments about image_url formats; minor formatting/structural tweaks only.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

I thump my paws on YAML plains,
Deprecation flags like gentle rains.
Examples whisper, “URLs or base64,”
Clarity hopped to every shore.
A tidy spec, ears up high—
Ship it swift beneath the sky. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The title "feat:@coderabbitai" does not describe the changes in this PR (which predominantly mark multiple OpenAPI paths/responses as deprecated and add clarifying comments to Images SDK examples) and appears to be a bot/mention tag rather than a concise summary of the primary change, so it is not helpful for reviewers or history scanning. Please rename the PR to a concise, descriptive title that reflects the main change, for example "openapi: deprecate multiple paths/responses and clarify Images example image_url usage" or "Mark OpenAPI endpoints as deprecated and add image_url clarification in SDK examples"; if the "@coderabbitai" tag is important, include it in the description or body rather than the title. This will make the PR easier to review and find in project history.
✅ 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_202509211827

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.

@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Deprecate OpenAPI paths/responses; clarify image_url in examples Sep 21, 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: 1

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

63-69: Confirm deprecation scope for connectors array property.

Placing deprecated: true at the schema level is valid, but please confirm it’s the property (not just its items) you intend to deprecate. Consider adding x-deprecation-reason and a pointer to the replacement field/flow for migration.


168-174: Deprecation needs migration guidance.

search_queries_only is deprecated; add a short note (or x-deprecation-reason/x-replaced-by) to direct users to the preferred parameter/flow so SDK docs and portal render a clear path forward.


1004-1010: Operation deprecated: add sunset metadata.

Good to mark deprecated. Recommend adding an x-sunset (date) and brief x-deprecation-reason, and optionally prefix the summary with “[Deprecated] …” for clearer docs and SDKs.


1128-1134: Mirror deprecation hygiene on this operation.

Add x-sunset and a one‑line migration hint (replacement operation/param) to reduce breakage.


1198-1204: Deprecated operation: document the replacement.

Please include x-deprecation-reason and the new path/operation to aid automated doc generation and client hints.


1271-1277: Consistent deprecation metadata.

Apply the same x-sunset/x-deprecation-reason pattern here to keep docs uniform.


1343-1349: Add sunset date and summary prefix.

Helps SDKs surface warnings at compile time and in IDEs.


1421-1427: Deprecation is fine; add migration note.

A brief “Use /v2/… instead” greatly reduces support tickets.


1501-1507: Round out deprecation metadata for consistency.

x-sunset + x-deprecation-reason recommended.


6623-6629: Docs clarity for deprecated operation.

Consider “[Deprecated] …” in summary and an examples block note that this route will be removed after the sunset date.


7178-7184: Add explicit replacement pointer.

Call out the new path/param to avoid confusion during upgrade.


8772-8787: Use standard “Bearer” capitalization in cURL Authorization header.

While headers are case‑insensitive, “Bearer” is the conventional scheme token.

Apply this diff in the cURL snippet:

-  --header "Authorization: bearer $CO_API_KEY" \
+  --header "Authorization: Bearer $CO_API_KEY" \

8772-8787: Optional parity: include detail in Java sample.

Other SDK samples set detail: "auto". Consider adding the equivalent in Java for consistency.


8772-8787: Optional: print assistant text in Python sample for parity.

Other samples print the assistant text; Python prints the whole response. Consider:

-print(response)
+print(response.message.content[0].text)
📜 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 7b448f9.

⛔ 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)
🔇 Additional comments (1)
src/libs/Cohere/openapi.yaml (1)

63-69: Validate OpenAPI after deprecation edits and configure Spectral ruleset
Spectral failed with “No ruleset has been found.” Add a .spectral.(yaml|yml|json) at the project root or pass --ruleset (e.g. Stoplight’s OAS ruleset) so linting actually runs. Then:

  • Run
    npx @stoplight/spectral-cli@6 lint --ruleset <path-to-ruleset> src/libs/Cohere/openapi.yaml
  • List all operations with deprecated: true and ensure each has a summary plus either x-sunset or x-deprecation-reason
  • Verify no examples (x-fern-examples, code-samples) under deprecated operations reference the old endpoints

Re-run lint and confirm all deprecation metadata is valid.

Comment on lines 8772 to 8787
type: message-end
event: message-end
- code-samples:
- 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 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"
- 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

Go example uses a non‑vision model with image content.

The sample sends image_url but sets Model to command-a-03-2025. Use a vision‑capable model for correctness and cross‑language parity.

Apply this diff in the Go snippet:

-        Model: "command-a-03-2025",
+        Model: "command-a-vision-07-2025",

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

🤖 Prompt for AI Agents
In src/libs/Cohere/openapi.yaml around lines 8772 to 8787, the Go example sends
image_url but sets the non‑vision model "command-a-03-2025"; replace the model
with a vision‑capable model (for example "command-xlarge-vision" or another
documented vision model), i.e., update the Model field in the Go snippet to a
vision model so the request matches the image content and keeps parity with
other language 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