-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat:Deprecate Cohere API operations and clarify image_url data URI/URL #283
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
WalkthroughMarked multiple public API operations in src/libs/Cohere/openapi.yaml as deprecated and updated Images example code comments across languages to clarify that image_url accepts a base64 data URI or a web URL. No new endpoints or models were added. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
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: 1
🧹 Nitpick comments (1)
src/libs/Cohere/openapi.yaml (1)
66-66: Consider adding deprecation notices with migration guidance.The
connectorsparameter andsearch_queries_onlyparameter are marked as deprecated but lack explicit deprecation notices in their descriptions. This could leave users uncertain about alternatives or timelines.Consider updating the descriptions to include deprecation notices:
- description: "Accepts `{\"id\": \"web-search\"}`, and/or the `\"id\"` for a custom [connector](https://docs.cohere.com/docs/connectors), if you've [created](https://docs.cohere.com/v1/docs/creating-and-deploying-a-connector) one.\n\nWhen specified, the model's reply will be enriched with information found by querying each of the connectors (RAG).\n\nCompatible Deployments: Cohere Platform\n" + description: "**DEPRECATED:** This parameter is deprecated and will be removed in a future version. Please use [alternative approach] instead.\n\nAccepts `{\"id\": \"web-search\"}`, and/or the `\"id\"` for a custom [connector](https://docs.cohere.com/docs/connectors), if you've [created](https://docs.cohere.com/v1/docs/creating-and-deploying-a-connector) one.\n\nWhen specified, the model's reply will be enriched with information found by querying each of the connectors (RAG).\n\nCompatible Deployments: Cohere Platform\n"And similarly for
search_queries_only:- description: "Defaults to `false`.\n\nWhen `true`, the response will only contain a list of generated search queries, but no search will take place, and no reply from the model to the user's `message` will be generated.\n\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" + description: "**DEPRECATED:** This parameter is deprecated and will be removed in a future version. Please use [alternative approach] instead.\n\nDefaults to `false`.\n\nWhen `true`, the response will only contain a list of generated search queries, but no search will take place, and no reply from the model to the user's `message` will be generated.\n\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n"Also applies to: 171-171
📜 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
🔇 Additional comments (3)
src/libs/Cohere/openapi.yaml (3)
8775-8775: LGTM! Clear documentation improvement for image URL parameter.The added comments in the code examples clearly explain that
image_url/urlcan accept both base64 data URIs and web URLs across all language SDKs. This improves developer experience by eliminating ambiguity about acceptable input formats.Also applies to: 8778-8778, 8781-8781, 8784-8784
8784-8786: Model difference is intentional — vision model for image samples, standard model for non‑vision samplesImage-capable examples use
command-a-vision-07-2025(see src/libs/Cohere/openapi.yaml:8774–8788); non-image examples (including Go/other SDK chat/tokenize/detokenize samples) usecommand-a-03-2025(e.g., src/libs/Cohere/openapi.yaml:2120–2123, 7343, 7552). No change required unless you intended a Go image example to use the vision model.
1007-1007: Confirm intended deprecations & provide migration planFound 9 operation-level deprecations in src/libs/Cohere/openapi.yaml:
- POST /v1/classify
- POST /v1/generate
- POST /v1/summarize
- GET /v1/connectors
- POST /v1/connectors
- DELETE /v1/connectors/{id}
- GET /v1/connectors/{id}
- PATCH /v1/connectors/{id}
- POST /v1/connectors/{id}/oauth/authorize
Required actions:
- Confirm these deprecations are intentional.
- For each endpoint, state replacement (if any) and migration steps.
- Publish a concrete deprecation timeline/sunset date and backward-compat window.
- Update SDKs/examples/changelog/docs (examples live in this file) and ensure client libraries handle deprecation.
- Communicate changes to users (docs, release notes, and API responses).
| items: | ||
| $ref: '#/components/schemas/ChatConnector' | ||
| description: "Accepts `{\"id\": \"web-search\"}`, and/or the `\"id\"` for a custom [connector](https://docs.cohere.com/docs/connectors), if you've [created](https://docs.cohere.com/v1/docs/creating-and-deploying-a-connector) one.\n\nWhen specified, the model's reply will be enriched with information found by querying each of the connectors (RAG).\n\nCompatible Deployments: Cohere Platform\n" | ||
| deprecated: true | ||
| x-fern-audiences: | ||
| - public |
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.
🛠️ Refactor suggestion
🧩 Analysis chain
Verify that all deprecated operations are consistently documented.
Multiple API operations are being marked as deprecated in this file. Ensure that there's clear documentation or migration guidance for users of these deprecated endpoints.
Let me search for documentation patterns and check the consistency of deprecation markings:
🏁 Script executed:
#!/bin/bash
# Description: Verify consistency of deprecated operations and check for migration documentation
# Find all deprecated operations in the OpenAPI spec
echo "=== All deprecated operations ==="
rg -n "deprecated: true" --type yaml -A 3 -B 3
echo -e "\n=== Check for migration or replacement documentation ==="
rg -n -i "migration|replace|alternative|instead" --type yaml -C 2
echo -e "\n=== Check for consistent deprecation patterns ==="
rg -n "deprecated: true" --type yaml -A 10 | rg "description|summary" || echo "No descriptions found for deprecated operations"Length of output: 149801
Add consistent deprecation notices and migration guidance
Verification: many deprecated: true occurrences found; a few endpoints already include migration links (Generate/Summarize/Chat v2), but numerous schema fields and response entries lack replacement/migration guidance.
- Action: for every deprecated item add a summary-level deprecation note (e.g. "Deprecated — use ") and a link to a central migration guide or replacement API; if no replacement exists, state removal timeline or rationale.
- Priority locations to update: src/libs/Cohere/openapi.yaml — ~lines 63–68 (ChatConnector schema), 168–171 (search_queries_only), 859–865 (playground preset id), 916–962 (prediction/confidence fields), and the deprecated response blocks around ~1007, 1131, 1201, 1274, 1346, 1424, 1504, 6626, 7181.
- Keep/standardize existing migration messages (e.g. generate/summarize/chat v2) so deprecation UX is uniform across the spec.
Summary by CodeRabbit