Skip to content

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Sep 19, 2025

Summary by CodeRabbit

  • Chores

    • Deprecated multiple API endpoints: text-generation, summarize, classify, embed, detect-language, similarity, and anomaly-detection.
    • Deprecated several chat parameters, including conversation_id and search_queries_only.
  • Documentation

    • Updated chat examples to clarify image inputs, supporting both base64 data URIs and web URLs.

@coderabbitai
Copy link

coderabbitai bot commented Sep 19, 2025

Walkthrough

Deprecates multiple endpoints and several parameters on /chat within src/libs/Cohere/openapi.yaml. Updates /chat code samples to clarify image URL usage, supporting both base64 data URIs and web URLs.

Changes

Cohort / File(s) Summary
OpenAPI Endpoint Deprecations
src/libs/Cohere/openapi.yaml
Marks entire endpoints as deprecated: /text-generation, /summarize, /classify, /embed, /detect-language, /similarity, /anomaly-detection.
/chat Parameter Deprecations
src/libs/Cohere/openapi.yaml
Deprecates specific /chat parameters including conversation_id, search_queries_only, and others.
/chat Code Sample Updates
src/libs/Cohere/openapi.yaml
Revises code samples to show image input via base64 data URIs and standard web URLs.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Client
  participant API as Cohere API (/chat)
  rect rgba(230,245,255,0.6)
    note right of Client: Prepare chat request
    Client->>API: POST /chat { messages, images:[{type:url|base64, value}] }
  end
  alt Image URL (web)
    API->>API: Fetch/validate external image URL
  else Base64 data URI
    API->>API: Decode and validate image payload
  end
  API->>Client: 200 OK { reply, citations?, warnings? }
  opt Error paths
    API-->>Client: 4xx/5xx { error }
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

A bunny taps the spec with care,
Retiring roads that led nowhere.
New chat paths hop clear and bright,
With image links in tidy light.
Base64 or web—both fine!
Thump-thump—release day’s right on time. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The PR title "feat:@coderabbitai" is a terse mention that does not describe the primary changes in the diff. The changeset updates src/libs/Cohere/openapi.yaml to deprecate multiple Cohere API endpoints and adjust chat examples. Because the title is non‑descriptive, it’s not possible to confirm it summarizes the main change from a reviewer’s perspective. Please rename the PR to a concise, descriptive title such as "chore(openapi): deprecate multiple Cohere endpoints and update chat examples" and add a one-line scope (e.g., src/libs/Cohere/openapi.yaml) plus a short rationale in the PR description so reviewers can immediately see the intent. If you prefer to emphasize a single primary change, state which endpoint or change should be the focus in the title.
✅ 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_202509190333

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 03:34
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Deprecate endpoints and /chat params; update image URL 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 (12)
src/libs/Cohere/openapi.yaml (12)

63-69: Add explicit deprecation rationale and migration path for connectors.

Marking the property as deprecated is fine, but please include a reason and the recommended alternative so SDKs/docs surface actionable guidance.

Proposed augmentation:

                   description: "Accepts {\"id\": \"web-search\"}, and/or the \"id\" for a custom connector..."
                   deprecated: true
+                  x-deprecation-reason: "Connectors on /chat are being phased out."
+                  x-replacement: "Describe the supported alternative (e.g., tools/tool_choice or new endpoint)."
+                  x-sunset: "REPLACE_WITH_YYYY-MM-DD"
                   x-fern-audiences:
                     - public

168-174: Deprecation lacks replacement guidance for search_queries_only.

Please document how to achieve “queries only” behavior post‑deprecation, and add sunset metadata.

                 description: "Defaults to `false`. When `true`, the response will only contain a list of generated search queries..."
                 deprecated: true
+                x-deprecation-reason: "search_queries_only is being removed."
+                x-replacement: "Document the new parameter/flow to retrieve queries."
+                x-sunset: "REPLACE_WITH_YYYY-MM-DD"
                 x-fern-audiences:
                   - public

1004-1010: Operation-level deprecation OK; add sunset and migration note.

Add explicit deprecation reason, replacement, and target removal date so client SDKs can warn properly.

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Endpoint is superseded."
+      x-replacement: "Point to the successor endpoint/flow."
+      x-sunset: "REPLACE_WITH_YYYY-MM-DD"
       x-fern-audiences:
         - public

1128-1134: Mirror deprecation metadata here as well.

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Endpoint is superseded."
+      x-replacement: "Successor endpoint/flow."
+      x-sunset: "REPLACE_WITH_YYYY-MM-DD"
       x-fern-audiences:
         - public

1198-1204: Same deprecation hygiene needed (reason/replacement/sunset).

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Endpoint is superseded."
+      x-replacement: "Successor endpoint/flow."
+      x-sunset: "REPLACE_WITH_YYYY-MM-DD"

1271-1277: Add deprecation context to aid SDK consumers.

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Endpoint is superseded."
+      x-replacement: "Successor endpoint/flow."
+      x-sunset: "REPLACE_WITH_YYYY-MM-DD"

1343-1349: Repeat deprecation metadata (reason/replacement/sunset).

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Endpoint is superseded."
+      x-replacement: "Successor endpoint/flow."
+      x-sunset: "REPLACE_WITH_YYYY-MM-DD"

1421-1427: Provide consumers a clear migration path.

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Endpoint is superseded."
+      x-replacement: "Successor endpoint/flow."
+      x-sunset: "REPLACE_WITH_YYYY-MM-DD"

1501-1507: Add deprecation rationale, replacement, and sunset date.

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Endpoint is superseded."
+      x-replacement: "Successor endpoint/flow."
+      x-sunset: "REPLACE_WITH_YYYY-MM-DD"

6623-6629: Consistent deprecation metadata is missing.

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Endpoint is superseded."
+      x-replacement: "Successor endpoint/flow."
+      x-sunset: "REPLACE_WITH_YYYY-MM-DD"

7178-7184: Same here—add reason, replacement, and sunset.

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Endpoint is superseded."
+      x-replacement: "Successor endpoint/flow."
+      x-sunset: "REPLACE_WITH_YYYY-MM-DD"

8775-8787: Code samples: naming and model inconsistencies.

  • TypeScript uses imageUrl (camelCase) while others use image_url (snake_case). This can confuse users since payload keys must match the API. Align TS with the JSON schema or explicitly note SDK key-mapping.
  • Go sample uses a non‑vision model despite sending image_url content.
-          { 
-            type: 'image_url',
-            imageUrl: {
+          {
+            type: 'image_url',
+            image_url: {
               // Can be either a base64 data URI or a web URL.
               url: 'https://cohere.com/favicon-32x32.png',
               detail: 'auto',
             },
           },
-        Cohere cohere = Cohere.builder().clientName("snippet").build();
+        Cohere cohere = Cohere.builder().clientName("snippet").build(); // Confirm token loading behavior in docs/sample header.
-        ChatResponse response
+        ChatResponse response
           = cohere
-        Model: "command-a-03-2025",
+        Model: "command-a-vision-07-2025",

If the TS SDK intentionally uses camelCase keys and maps to snake_case on the wire, add a one‑line note in the sample preceding the payload to prevent confusion.

📜 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 cd4b45c.

⛔ 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

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