-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat:Deprecate endpoints in OpenAPI; clarify image_url formats in samples #286
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
WalkthroughOpenAPI 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 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 (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 forsearch_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 fromrg -nC2 '\bsearch_queries_only\b'
.Action: add
deprecated: true
and anx-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
⛔ 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).
Summary by CodeRabbit