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 across all language code samples.
    • Improved sample formatting for readability without changing usage.
  • Chores

    • Marked several public API endpoints as deprecated in the API specification to signal upcoming retirement and guide migration planning.

@coderabbitai
Copy link

coderabbitai bot commented Sep 19, 2025

Walkthrough

Added deprecated: true to multiple OpenAPI path items in src/libs/Cohere/openapi.yaml. Updated image-related documentation samples (TS, Python, Java, Go, PHP) to clarify that image_url accepts base64 data URIs or web URLs, with minor stylistic adjustments.

Changes

Cohort / File(s) Summary of Changes
OpenAPI path deprecations
src/libs/Cohere/openapi.yaml
Marked several public API endpoints as deprecated by adding deprecated: true across multiple path-item sections, typically alongside existing 503/504 response references.
Docs sample clarifications (Images)
src/libs/Cohere/openapi.yaml
Updated language-specific examples (TypeScript, Python, Java, Go, PHP) to include inline comments stating image_url may be a base64 data URI or a web URL; minor formatting tweaks only.

Sequence Diagram(s)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

A hop, a bop, I mark what’s old,
Little flags of “deprecated” bold.
Samples whisper, clear and bright:
“Base64 or URL—both are right!”
I twitch my nose, PR complete—
Docs in order, tidy and neat. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The title "feat:@coderabbitai" is vague and does not describe the primary change in this PR (which adds deprecated: true flags to many OpenAPI paths and updates image sample comments), so it doesn't give teammates clear context when scanning history. Please rename the PR to a concise, descriptive single sentence that highlights the main change, for example "openapi: mark multiple endpoints as deprecated" or "chore(openapi): add deprecated flags to several paths and update image samples".
✅ 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_202509190140

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 01:41
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Mark OpenAPI paths deprecated; clarify image_url base64 and web URLs 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 (2)
src/libs/Cohere/openapi.yaml (2)

66-66: Deprecation applied to array items, not the property.

If the intent is to deprecate the entire connectors field, move deprecated: true from under items: to the schema for the connectors property; many tools ignore deprecation flags on item schemas.

Apply within this hunk:

-                  deprecated: true

Then (outside this hunk), put deprecated: true alongside the type: array for connectors.


8775-8775: Minor: prefer standard “Bearer” casing in cURL Authorization header.

HTTP schemes are case‑sensitive in practice; “Bearer” is the conventional form.

-  --header "Authorization: bearer $CO_API_KEY" \
+  --header "Authorization: Bearer $CO_API_KEY" \
📜 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 9bb237f.

⛔ 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 (10)
src/libs/Cohere/openapi.yaml (10)

1131-1131: Same as above: operation marked deprecated. Provide replacement guidance.

Use the script in the prior comment to list all deprecated operations and verify coverage.


1201-1201: Operation deprecated. Ensure API lifecycle comms (alt endpoint + EOL date).


1274-1274: Operation deprecated. Verify SDKs surface deprecation clearly (e.g., warnings).


1346-1346: Operation deprecated. Consider adding a Sunset response header in runtime, too.


1424-1424: Operation deprecated. Double-check auth/scopes parity on the replacement.


1504-1504: Operation deprecated. Ensure docs nav hides or labels this route accordingly.


6626-6626: Operation deprecated. Validate no SDK example still calls this route.


7181-7181: Operation deprecated. Add a brief rationale (performance, security, superseded, etc.).


171-171: Document replacement for deprecated search_queries_only.

Marking search_queries_only deprecated is fine; add the recommended replacement in the property's description or add an x-deprecation-message to guide SDKs/users.
Location: src/libs/Cohere/openapi.yaml (lines 169–171)


1007-1007: Action: Confirm deprecations and add migration notes.

  • src/libs/Cohere/openapi.yaml — 'deprecated: true' present at lines: 66, 171, 862, 919, 959, 1007, 1131, 1201, 1274, 1346, 1424, 1504, 6626, 7181.
  • For each deprecated operation/parameter: confirm intent and update the operation's description (or an x- vendor field) to reference the replacement endpoint/model and include a brief migration note (what to call instead and expected timeline).

Comment on lines +8784 to 8786
- 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
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 sample uses a non‑vision model with image input.

command-a-03-2025 is unlikely to support image_url content. Use the vision model to avoid 4xx errors.

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

Optional nit: keep model names consistent across all language samples.

📝 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: "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
Model: "command-a-vision-07-2025",
🤖 Prompt for AI Agents
In src/libs/Cohere/openapi.yaml around lines 8784 to 8786, the Go sample is
sending image_url content while specifying a non‑vision model
(`command-a-03-2025`), which will cause 4xx errors; update the sample to use the
appropriate vision model (replace `command-a-03-2025` with the project's vision
model, e.g., `command-v1` or the canonical vision model name) and align the
model name with other language samples for consistency.

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