-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat:Deprecate endpoints and /chat params; update image URL samples #281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughDeprecates 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
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests
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. Comment |
There was a problem hiding this 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
⛔ Files ignored due to path filters (21)
src/libs/Cohere/Generated/Cohere.CohereClient.Chat.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.CohereClient.Classify.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.CohereClient.Generate.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.CohereClient.Summarize.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.ConnectorsClient.CreateConnector.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.ConnectorsClient.DeleteConnector.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.ConnectorsClient.GetConnector.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.ConnectorsClient.ListConnectors.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.ConnectorsClient.OAuthAuthorizeConnector.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.ConnectorsClient.UpdateConnector.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.ICohereClient.Chat.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.ICohereClient.Classify.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.ICohereClient.Generate.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.ICohereClient.Summarize.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.IConnectorsClient.CreateConnector.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.IConnectorsClient.DeleteConnector.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.IConnectorsClient.GetConnector.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.IConnectorsClient.ListConnectors.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.IConnectorsClient.OAuthAuthorizeConnector.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.IConnectorsClient.UpdateConnector.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.Models.ChatRequest.g.csis 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
Summary by CodeRabbit
Chores
Documentation