Skip to content

docs: Add native Cohere Python SDK support for OCI Generative AI#740

Open
fede-kamel wants to merge 7 commits intocohere-ai:mainfrom
fede-kamel:docs/oci-sdk-integration
Open

docs: Add native Cohere Python SDK support for OCI Generative AI#740
fede-kamel wants to merge 7 commits intocohere-ai:mainfrom
fede-kamel:docs/oci-sdk-integration

Conversation

@fede-kamel
Copy link
Copy Markdown
Contributor

@fede-kamel fede-kamel commented Apr 11, 2026

Summary

Updates the OCI documentation to reflect the new native Cohere Python SDK integration with OCI Generative AI, contributed via cohere-ai/cohere-python#718.

Changes

oracle-cloud-infrastructure-oci.mdx — Complete rewrite:

  • Installation instructions (pip install cohere[oci])
  • Quick start examples for chat (V1 + V2), embeddings, and streaming
  • All 5 authentication methods: config file, custom profile, session tokens, direct credentials, instance principal, resource principal
  • V1 vs V2 API comparison table (OciClient vs OciClientV2)
  • Advanced features: tool use, thinking/reasoning (Command A Reasoning)
  • Supported features table
  • Removed stale "deploy on the AWS cloud computing platform" copy-paste error

cohere-works-everywhere.mdx (v1):

  • Changed OCI Python SDK status from "soon" to "docs" in the supported environments table
  • Fixed generate and generate_stream as unsupported on OCI (they were incorrectly marked as supported)
  • Added OCI V1 code snippet section

cohere-works-everywhere.mdx (v2):

  • Removed outdated note saying "v2 API is not yet supported for OCI"
  • Changed OCI Python SDK status from "soon" to "docs"
  • Fixed generate and generate_stream as unsupported on OCI
  • Added OCI V2 code snippet section

Context

The Cohere Python SDK now natively supports OCI Generative AI via OciClient (V1 API for Command R family) and OciClientV2 (V2 API for Command A family). The SDK handles URL rewriting, request/response format translation, OCI cryptographic request signing, and streaming event transformation transparently.

Test plan

  • Verify the OCI page renders correctly on docs.cohere.com
  • Verify code snippets in the OCI page are syntactically correct
  • Verify the "cohere-works-everywhere" tables render correctly in both v1 and v2 docs
  • Verify the OCI snippet sections link correctly from the table anchors (#oci)

Note

Low Risk
Low risk: changes are documentation updates plus a GitHub Actions permission/checkout tweak; main risk is broken docs rendering or incorrect code snippets/feature tables.

Overview
Adds native OCI Generative AI documentation for the Cohere Python SDK, including install (cohere[oci]), V1/V2 client usage (OciClient/OciClientV2), auth options, streaming, and advanced examples (tools/vision/embed).

Updates the "Cohere works everywhere" pages (v1 and v2) to mark Python-on-OCI as supported with docs, add OCI code snippets, clarify that OCI supports v2 via OciClientV2, and correct the feature matrix to show generate/generate_stream as not supported on OCI.

Hardens the check-python-code-snippets workflow by reducing permissions and checking out fork PRs via the PR head repo + SHA.

Reviewed by Cursor Bugbot for commit 84a8791. Bugbot is set up for automated code reviews on this repo. Configure here.

@fede-kamel fede-kamel requested review from a team as code owners April 11, 2026 06:37
@github-actions
Copy link
Copy Markdown

@fede-kamel
Copy link
Copy Markdown
Contributor Author

@daniel-cohere I've updated the OCI documentation to cover the new native Cohere Python SDK integration (OciClient and OciClientV2). This includes installation, quick start examples for chat/embed/streaming, all authentication methods, V1 vs V2 comparison, and a supported features table. Let me know if anything needs adjusting.

@github-actions
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

@fede-kamel fede-kamel force-pushed the docs/oci-sdk-integration branch from 391eb1e to 2810a7e Compare April 11, 2026 14:49
@github-actions
Copy link
Copy Markdown

Complete rewrite of the OCI documentation page to cover the new
OciClient and OciClientV2 classes:

- Installation (pip install cohere[oci])
- Quick start: V2 chat, V1 chat, embeddings, V2/V1 streaming
- All authentication methods (config, profile, session, direct,
  instance principal, resource principal)
- V1 vs V2 API comparison table
- Tool use, vision, and embed v4 snippets
- Supported features table
- End-to-end example: embed → search → grounded chat → tool calling
  (multi-turn) → vision → streaming

All code snippets verified against live OCI Generative AI.
- Change OCI Python from "soon" to "docs" in supported environments
- Fix generate/generate_stream as unsupported on OCI
- Add OCI V1 code snippet section
@fede-kamel fede-kamel force-pushed the docs/oci-sdk-integration branch from 2810a7e to fb933c8 Compare April 11, 2026 14:58
@github-actions
Copy link
Copy Markdown

- Remove stale "v2 not supported for OCI" note
- Change OCI Python from "soon" to "docs"
- Fix generate/generate_stream as unsupported on OCI
- Add OCI V2 code snippet section
@fede-kamel fede-kamel force-pushed the docs/oci-sdk-integration branch from fb933c8 to 9b88dbd Compare April 11, 2026 15:10
@github-actions
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

- [OCI Generative AI Documentation](https://docs.oracle.com/en-us/iaas/Content/generative-ai/home.htm)
- [OCI Generative AI Pretrained Models](https://docs.oracle.com/en-us/iaas/Content/generative-ai/pretrained-models.htm)

You can also work with Cohere models on OCI through the [OCI Console](https://docs.oracle.com/en-us/iaas/Content/generative-ai/use-playground-chat.htm), the [OCI CLI](https://docs.oracle.com/en-us/iaas/Content/generative-ai/use-playground-embed.htm), or the [OCI API](https://docs.oracle.com/en-us/iaas/api/#/en/generative-ai-inference/) directly.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these correct links - the links look like info for chat/embed rather than specifically info on OCI Console/OCI CLI?

Replace incorrect playground links with proper documentation URLs:
- OCI Console now points to the Generative AI overview page
- OCI CLI now points to the CLI command reference for generative-ai-inference
@fede-kamel
Copy link
Copy Markdown
Contributor Author

@daniel-cohere Updated the OCI Console and CLI links — they now point to the correct documentation pages. All links verified.

@github-actions
Copy link
Copy Markdown

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