Skip to content

Conversation

HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Sep 19, 2025

Summary by CodeRabbit

  • Documentation
    • Marked several API endpoints and a parameter as deprecated in the public API specification, surfacing deprecation notices to API consumers.
    • Updated multi-language code samples to clarify that image_url accepts either a base64 data URI or a web URL.
  • Chores
    • Refreshed API definition with deprecation flags across affected operations and responses to align with current support status.

Copy link

coderabbitai bot commented Sep 19, 2025

Walkthrough

OpenAPI spec updated to mark numerous endpoints, parameters, and responses as deprecated, including web-search and search_queries_only. Image-related sample blocks were edited to clarify that image_url may be a base64 data URI or a web URL across multiple language examples and curl.

Changes

Cohort / File(s) Summary
OpenAPI deprecations
src/libs/Cohere/openapi.yaml
Added deprecated: true to multiple path items/operations and parameters (including web-search and search_queries_only). Marked several response blocks (e.g., 503/504 ServiceUnavailable/GatewayTimeout) as deprecated across the spec.
Image examples clarifications
src/libs/Cohere/openapi.yaml
Updated Images section examples (TypeScript, Python, Java, Go, curl) to comment that image_url accepts base64 data URIs or web URLs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

I hop through specs with gentle care,
Tagging deprecations here and there.
A URL or base64—both okay!
The images now have clearer say.
Ears up, paws down, I sign this feat—
A tidy YAML, crisp and neat. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The PR title "feat:@coderabbitai" is not descriptive of the actual changes; the diff mainly marks many OpenAPI paths/responses as deprecated and updates image_url examples in documentation, but the title only contains a bot/mention token and does not communicate the primary change to reviewers or in history. This makes it too vague for a clear commit/PR summary. Please rename the PR to a concise, descriptive title such as "chore: deprecate multiple OpenAPI endpoints and update image_url examples" or "feat(cohere): mark several paths deprecated and clarify image examples" and add a one-line PR description summarizing the main intent and affected files so reviewers can quickly understand the change.
✅ 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_202509191828

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 18:29
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Deprecate endpoints in OpenAPI; clarify image_url formats in samples 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: 0

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

63-69: Add a deprecation message and migration hint for connectors.

Marking the connectors array as deprecated is fine, but please include an explicit deprecation note pointing to the replacement (e.g., remove usage or alternative param) so SDKs/docs surface guidance. Many generators respect a custom x-deprecation-message/x-sunset.

If there’s a specific alternative, append it to the property description or add:

                   description: "Accepts … (RAG). Compatible Deployments: Cohere Platform"
+                  x-deprecation-message: "This field is deprecated. Use <new-thing> or see the migration guide."

1004-1010: Operation deprecation: also publish a deprecation rationale/timeline.

deprecated: true is valid on Operation. Consider adding x-deprecation-message and documenting a sunset timeline (or model a “Sunset” response header) so clients can plan.

-      deprecated: true
+      deprecated: true
+      x-deprecation-message: "This operation will be removed on <date>. See <link>."

1128-1134: Repeat: include x-deprecation-message for consistent UX across SDKs.

-      deprecated: true
+      deprecated: true
+      x-deprecation-message: "Deprecated. See migration guide."

1198-1204: Repeat: expose a migration path for this deprecated operation.

-      deprecated: true
+      deprecated: true
+      x-deprecation-message: "Use <new endpoint>."

1271-1277: Repeat: add deprecation message/timeline.

-      deprecated: true
+      deprecated: true
+      x-deprecation-message: "Will be removed on <date>."

1343-1349: Repeat: add deprecation message.

-      deprecated: true
+      deprecated: true
+      x-deprecation-message: "See <link> for alternatives."

1421-1427: Repeat: add deprecation message for clarity.

-      deprecated: true
+      deprecated: true
+      x-deprecation-message: "Deprecated; migrate to <new op>."

1501-1507: Repeat: add deprecation message.

-      deprecated: true
+      deprecated: true
+      x-deprecation-message: "Sunsetting; see migration."

7178-7184: Repeat: add x-deprecation-message to improve generated SDK annotations.

-      deprecated: true
+      deprecated: true
+      x-deprecation-message: "Deprecated; see migration guide."

168-174: Add deprecation metadata to the OpenAPI schema for search_queries_only

Verified: src/libs/Cohere/openapi.yaml contains the schema property search_queries_only (lines ~168–170); the generated model src/libs/Cohere/Generated/Cohere.Models.ChatRequest.g.cs already has JsonPropertyName + [Obsolete] (lines ~199–201). No other matches from rg -nC2 '\bsearch_queries_only\b'.

Action: add deprecated: true and an x-deprecation-message to the OpenAPI schema (generator-side Obsolete can remain).

Proposed addition:

                 description: "Defaults to `false`. …"
                 deprecated: true
+                x-deprecation-message: "Use <replacement> or see the migration guide."
📜 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 769343c.

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

6623-6629: Add deprecation message and consider a Sunset header in responses.
OpenAPI validation passed; ensure the suggested x-deprecation-message is present and optionally add a Sunset response header.
File: src/libs/Cohere/openapi.yaml — lines 6623-6629

-      deprecated: true
+      deprecated: true
+      x-deprecation-message: "Deprecated; removal on <date>."

8772-8787: Unify model name in Go sample, add explicit data‑URI curl example, and standardize image_url usage

  • Change Go sample model to match others (src/libs/Cohere/openapi.yaml ≈ lines 8775–8787). Apply diff:
-            Model: "command-a-03-2025",
+            Model: "command-a-vision-07-2025",
  • Add a second curl example (no comments) demonstrating a data URI, e.g.:
curl --request POST \
  --url https://api.cohere.com/v2/chat \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --header "Authorization: bearer $CO_API_KEY" \
  --data '{
    "model":"command-a-vision-07-2025",
    "messages":[
      {
        "role":"user",
        "content":[
          {"type":"text","text":"Describe the logo!"},
          {"type":"image_url","image_url":{"url":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA...","detail":"auto"}}
        ]
      }
    ]
  }'
  • Repo contains mixed usage: the JS/TS snippet uses camelCase imageUrl while schemas/generated code use snake_case "image_url". Confirm whether the TypeScript/JS SDK serializes camelCase → snake_case; if not, make examples consistently use the JSON field "image_url" (or document SDK-specific mapping).

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