Skip to content

Conversation

HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Sep 19, 2025

Summary by CodeRabbit

  • Documentation
    • Clarified that image_url accepts either a base64 data URI or a web URL in Images examples for TypeScript, Python, Java, and Go.
    • Marked select parameters and responses as deprecated in the public API documentation to improve clarity around sunset features.
  • Chores
    • Added deprecation annotations to several API operations and parameters to reflect current support status, including items related to chat connectors, search flags, and certain ServiceUnavailable/GatewayTimeout mappings.

Copy link

coderabbitai bot commented Sep 19, 2025

Walkthrough

OpenAPI spec updated to mark specific parameters, operations, and certain path-level responses as deprecated. Documentation examples for Images across TypeScript, Python, Java, and Go now include comments clarifying accepted image_url formats (base64 data URI or web URL). curl example remains unchanged.

Changes

Cohort / File(s) Summary of Changes
OpenAPI deprecations
src/libs/Cohere/openapi.yaml
Added deprecated: true to a parameter referencing ChatConnector and to the search_queries_only parameter; annotated multiple operations as deprecated (after 504 GatewayTimeout blocks); marked certain path-level ServiceUnavailable and GatewayTimeout responses as deprecated.
Images examples comments
src/docs/openapi/examples/...
Updated TypeScript, Python, Java, and Go Images samples to add inline comments noting image_url accepts base64 data URIs or web URLs; TypeScript includes an inline comment within the imageUrl object. curl sample unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

A hop and a mark, “deprecated,” I cheer,
Carrots of comments make formats clear. 🥕
TS, Py, Java, Go—notes in a row,
While curl stands still, a steady show.
I thump my paw—specs tidy and bright,
Bounding toward clarity, into the night.

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The PR title "feat:@coderabbitai" is opaque and does not describe the primary changes made in the changeset; it reads like an automated tag rather than a concise summary. The changes actually mark multiple parameters and operations as deprecated in src/libs/Cohere/openapi.yaml and add clarifying comments to Images examples, which the current title does not convey. Because it lacks descriptive content, a teammate scanning history would not quickly understand the PR's main purpose. Please replace the title with a short, descriptive sentence such as "Mark deprecated responses and parameters in Cohere OpenAPI; clarify image_url usage in examples" or "chore(openapi): deprecate GatewayTimeout responses and update Images examples", and update the PR description to briefly list the key files changed (e.g., src/libs/Cohere/openapi.yaml and Images examples); I can help draft a one-line title and summary if you want.
✅ 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_202509191242

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 12:43
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Deprecate params/operations/responses in OpenAPI; image_url format doc 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: 1

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

63-69: Schema-level deprecation — confirm intent and placement

deprecated: true is added alongside items and description. That deprecates this schema/property (array) rather than a Parameter Object. If your goal is to deprecate the request property itself, this is fine. If you meant to deprecate a query/header/path parameter, set deprecated on the Parameter Object instead. Also consider adding a brief replacement note in description for SDKs and docs.


168-174: Deprecating search_queries_only — add “what to use instead”

The deprecation is correct at the schema/property level. Add a short replacement pointer (e.g., new field or behavior) into the description so generators and users get an actionable migration path.


1004-1010: Operation-level deprecations validated — add explicit deprecation notices & sunset policy

OpenAPI validation: OK. Deprecated operations found: /v1/classify (POST, operationId: classify), /v1/connectors (GET, list-connectors), /v1/connectors (POST, create-connector), /v1/connectors/{id} (DELETE, delete-connector), /v1/connectors/{id} (GET, get-connector), /v1/connectors/{id} (PATCH, update-connector), /v1/connectors/{id}/oauth/authorize (POST, oAuthAuthorize-connector), /v1/generate (POST, generate), /v1/summarize (POST, summarize).

  • Prepend “[Deprecated]” to operation summaries or append a clear deprecation note to each operation’s description; document a concrete sunset/removal date and the replacement endpoint (if any).
  • If you intend deprecated endpoints to be hidden from generated SDKs, verify whether vendor extensions (e.g., x-fern-*) are required and add them as needed.
📜 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 ea8aad8.

⛔ 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

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

Images samples: model mismatch in Go; align with vision model

Go sample uses command-a-03-2025 while the others use the vision model. If this sample includes image_url, the non‑vision model may fail. Align it:

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

Minor: ensure the TS require style is supported in the current JS SDK; if ESM is preferred, switch to import { CohereClientV2 } from "cohere-ai".


I need to verify the claims in this review comment by examining the codebase. Let me search for the relevant code samples and model usage patterns.


🏁 Script executed:

#!/bin/bash
# First, let's find the OpenAPI file and examine the specific lines mentioned
cat src/libs/Cohere/openapi.yaml | sed -n '8770,8790p'

Length of output: 7250


🏁 Script executed:

#!/bin/bash
# Let's also search for code samples in the OpenAPI file that mention models and images
rg -n -A5 -B5 "command-a-03-2025\|command-a-vision-07-2025" src/libs/Cohere/openapi.yaml

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Search for image_url references in the OpenAPI file to understand the context
rg -n -A5 -B5 "image_url" src/libs/Cohere/openapi.yaml

Length of output: 13143


🏁 Script executed:

#!/bin/bash
# Look for Go code samples in the OpenAPI file
rg -n -A10 -B5 "go\|golang\|Go" src/libs/Cohere/openapi.yaml

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Search for TypeScript/JavaScript samples and import patterns
rg -n -A10 -B5 "require.*cohere\|import.*cohere" src/libs/Cohere/openapi.yaml

Length of output: 0


Images samples: model mismatch in Go — align with vision model

Go sample uses "command-a-03-2025" while other samples use "command-a-vision-07-2025". This sample includes image_url, so update the Go snippet in src/libs/Cohere/openapi.yaml (lines 8775–8787; Go block at ~8784):

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

Minor: ensure the TS require style is supported in the current JS SDK; if ESM is preferred, switch to import { CohereClientV2 } from "cohere-ai".

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- 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"
Model: "command-a-vision-07-2025",
🤖 Prompt for AI Agents
In src/libs/Cohere/openapi.yaml around lines 8775–8787, the Go sample uses model
"command-a-03-2025" but includes an image_url so it must be updated to the
vision model "command-a-vision-07-2025"; update the Go code block to reference
"command-a-vision-07-2025" and ensure any request fields match the vision usage
(e.g., image_url present). Also address the minor JS/TS note: if the repository
uses ESM, change the TypeScript/JavaScript example to use "import {
CohereClientV2 } from \"cohere-ai\"" otherwise confirm that the current
require(...) style is supported by the published SDK and adjust the example
accordingly.

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