crewai - ✅(Solved) Fix [FEATURE] Native Oracle Cloud (OCI) Generative AI Integration [9 pull requests, 1 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
crewAIInc/crewAI#4944Fetched 2026-04-08 01:01:22
View on GitHub
Comments
1
Participants
1
Timeline
46
Reactions
0
Participants
Timeline (top)
referenced ×36cross-referenced ×9commented ×1

Fix Action

Fix / Workaround

OCI GenAI is one of the few cloud platforms hosting multiple model families under one roof — Meta Llama, Google Gemini, OpenAI GPT (4o, 5, OSS), xAI Grok, and Cohere — all accessible through a single API surface. Enterprise teams on OCI currently have no native path to use these models with CrewAI without custom workarounds.

PR fix notes

PR #4885: Add OCI LLM, embeddings, and Oracle integrations

Description (problem / solution / changelog)

Summary

This PR adds first-class OCI support across CrewAI’s native LLM and embedding paths, plus OCI and Oracle DB tool integrations in crewai-tools.

What’s included

crewai

  • Add native OCI LLM provider support for:
    • chat completions
    • async calls
    • batch calls
    • streaming
    • structured output
    • tool calling
    • multimodal input handling
  • Add OCI embedding support for:
    • text embeddings
    • image embeddings
  • Add live and SDK-surface coverage for OCI provider and embedding paths
  • Add a small OCI agent profiling entrypoint for repeatable local profiling

crewai-tools

  • Add OCI tools for:
    • Generative AI agent invocation
    • Knowledge Base retrieval
    • Object Storage read/write
  • Add Oracle DB tools for:
    • text retrieval
    • vector retrieval
    • hybrid retrieval
  • Add live integration coverage for OCI tools and Oracle DB retrieval paths

Key fixes

  • Preserve input ordering in OCICompletion.abatch()
  • Guard shared OCI client access
  • Fix OCI live test parametrization so unsupported/unconfigured live cases skip cleanly
  • Fix Oracle hybrid retrieval JSON bind handling
  • Fix Oracle hybrid retrieval LOB JSON parsing
  • Correct the OCI image embedding live fixture to use a valid image payload
  • Tighten OCI/Oracle type annotations to satisfy strict mypy

Validation

This PR was validated with targeted unit and live integration coverage against real OCI profiles and a real Oracle Autonomous Database.

Validated live paths include:

  • OCI chat/basic/async/batch/stream/structured flows
  • OCI tool calling, including repeated sequential asks with the same agent
  • OCI multimodal image, PDF, audio, and video flows
  • OCI text embeddings
  • OCI image embeddings
  • OCI Knowledge Base tool
  • Oracle Text search
  • Oracle vector search using OCI-produced embeddings
  • Oracle hybrid search using an installed DB-local ONNX model

Final targeted checks:

  • Ruff on touched OCI/Oracle source: clean
  • Mypy on touched crewai OCI source: clean
  • Mypy on touched crewai-tools OCI/Oracle source: clean

Targeted test results:

  • crewai OCI slice: 5 passed, 5 skipped
  • crewai-tools OCI/Oracle slice: 9 passed, 4 skipped

The remaining skips in those targeted reruns are expected live-env/model-selection skips from the integration harness, not product failures.

Notes

  • Oracle hybrid vector index creation is distinct from OCI embedding model usage. The Oracle DB test fixture documents the DB-local vectorizer requirement and the prior ORA-40284 behavior.
  • OCI agent profiling support is included via lib/crewai/tests/llms/oci/profile_oci_agent.py.

Commit split

  1. 7cfb5f7 Add OCI LLM and embedding support to crewai
  2. d6ae839 Add OCI and Oracle DB tools integrations
<!-- CURSOR_SUMMARY -->

[!NOTE] High Risk Adds a new native LLM provider with streaming/tool-calling/structured-output and introduces new OCI/Oracle optional dependencies and DB query execution paths; issues here could impact core LLM behavior and production integrations.

Overview Adds first-class Oracle Cloud Infrastructure support across CrewAI: a new native oci LLM provider (OCICompletion) with chat, async, streaming, tool calling, structured outputs, and multimodal message translation, plus token/metadata tracking and client access serialization.

Extends the RAG stack with an OCI embeddings provider (text + image embeddings) and wires oci into provider routing/validation, optional deps (crewai[oci]), and improved optional RAG factory import errors.

Introduces new crewai-tools integrations: OCI tools for Object Storage read/write, OCI agent endpoint invocation, and an OCI-backed RagTool knowledge base; plus Oracle DB retrieval tools (text, vector, hybrid search) with identifier validation and live/unit test coverage. Documentation is updated with an OCI provider accordion and new tool pages/overviews.

<sup>Written by Cursor Bugbot for commit 24a7c66d2d3b3822eaa69afb30883ac1fae4f518. This will update automatically on new commits. Configure here.</sup>

<!-- /CURSOR_SUMMARY -->

Changed files

  • docs/en/concepts/llms.mdx (modified, +218/-0)
  • docs/en/tools/cloud-storage/ociknowledgebasetool.mdx (added, +111/-0)
  • docs/en/tools/cloud-storage/ociobjectstoragereadertool.mdx (added, +38/-0)
  • docs/en/tools/cloud-storage/ociobjectstoragewritertool.mdx (added, +36/-0)
  • docs/en/tools/cloud-storage/overview.mdx (modified, +25/-2)
  • docs/en/tools/integration/ociinvokeagenttool.mdx (added, +43/-0)
  • docs/en/tools/integration/overview.mdx (modified, +13/-4)
  • docs/en/tools/overview.mdx (modified, +6/-0)
  • docs/en/tools/tool-integrations/overview.mdx (modified, +9/-1)
  • lib/crewai-tools/pyproject.toml (modified, +6/-0)
  • lib/crewai-tools/src/crewai_tools/__init__.py (modified, +16/-0)
  • lib/crewai-tools/src/crewai_tools/oci/__init__.py (added, +12/-0)
  • lib/crewai-tools/src/crewai_tools/oci/agents/README.md (added, +19/-0)
  • lib/crewai-tools/src/crewai_tools/oci/agents/__init__.py (added, +4/-0)
  • lib/crewai-tools/src/crewai_tools/oci/agents/invoke_agent_tool.py (added, +131/-0)
  • lib/crewai-tools/src/crewai_tools/oci/common.py (added, +69/-0)
  • lib/crewai-tools/src/crewai_tools/oci/knowledge_base/__init__.py (added, +4/-0)
  • lib/crewai-tools/src/crewai_tools/oci/knowledge_base/retriever_tool.py (added, +112/-0)
  • lib/crewai-tools/src/crewai_tools/oci/object_storage/README.md (added, +23/-0)
  • lib/crewai-tools/src/crewai_tools/oci/object_storage/__init__.py (added, +8/-0)
  • lib/crewai-tools/src/crewai_tools/oci/object_storage/reader_tool.py (added, +104/-0)
  • lib/crewai-tools/src/crewai_tools/oci/object_storage/writer_tool.py (added, +93/-0)
  • lib/crewai-tools/src/crewai_tools/oracle_db/__init__.py (added, +12/-0)
  • lib/crewai-tools/src/crewai_tools/oracle_db/common.py (added, +85/-0)
  • lib/crewai-tools/src/crewai_tools/oracle_db/knowledge_base/__init__.py (added, +12/-0)
  • lib/crewai-tools/src/crewai_tools/oracle_db/knowledge_base/retriever_tool.py (added, +402/-0)
  • lib/crewai-tools/tests/tools/conftest.py (added, +1/-0)
  • lib/crewai-tools/tests/tools/oci_tools_test.py (added, +88/-0)
  • lib/crewai-tools/tests/tools/oracle_db/conftest.py (added, +438/-0)
  • lib/crewai-tools/tests/tools/oracle_db_tools_test.py (added, +140/-0)
  • lib/crewai-tools/tests/tools/test_oci_knowledge_base_tool_integration.py (added, +57/-0)
  • lib/crewai-tools/tests/tools/test_oracle_hybrid_search_tool_integration.py (added, +35/-0)
  • lib/crewai-tools/tests/tools/test_oracle_text_search_tool_integration.py (added, +33/-0)
  • lib/crewai-tools/tests/tools/test_oracle_vector_search_tool_integration.py (added, +34/-0)
  • lib/crewai/pyproject.toml (modified, +3/-0)
  • lib/crewai/src/crewai/llm.py (modified, +13/-0)
  • lib/crewai/src/crewai/llms/base_llm.py (modified, +42/-1)
  • lib/crewai/src/crewai/llms/providers/oci/__init__.py (added, +20/-0)
  • lib/crewai/src/crewai/llms/providers/oci/completion.py (added, +1496/-0)
  • lib/crewai/src/crewai/llms/providers/oci/vision.py (added, +57/-0)
  • lib/crewai/src/crewai/rag/embeddings/factory.py (modified, +9/-0)
  • lib/crewai/src/crewai/rag/embeddings/providers/oci/__init__.py (added, +18/-0)
  • lib/crewai/src/crewai/rag/embeddings/providers/oci/embedding_callable.py (added, +209/-0)
  • lib/crewai/src/crewai/rag/embeddings/providers/oci/oci_provider.py (added, +88/-0)
  • lib/crewai/src/crewai/rag/embeddings/providers/oci/types.py (added, +30/-0)
  • lib/crewai/src/crewai/rag/embeddings/types.py (modified, +3/-0)
  • lib/crewai/src/crewai/rag/factory.py (modified, +15/-3)
  • lib/crewai/src/crewai/utilities/oci.py (added, +72/-0)
  • lib/crewai/tests/llms/oci/conftest.py (added, +447/-0)
  • lib/crewai/tests/llms/oci/profile_oci_agent.py (added, +160/-0)
  • lib/crewai/tests/llms/oci/test_oci.py (added, +817/-0)
  • lib/crewai/tests/llms/oci/test_oci_integration_async_batch.py (added, +55/-0)
  • lib/crewai/tests/llms/oci/test_oci_integration_basic.py (added, +41/-0)
  • lib/crewai/tests/llms/oci/test_oci_integration_multimodal.py (added, +165/-0)
  • lib/crewai/tests/llms/oci/test_oci_integration_streaming.py (added, +21/-0)
  • lib/crewai/tests/llms/oci/test_oci_integration_structured.py (added, +31/-0)
  • lib/crewai/tests/llms/oci/test_oci_integration_tools.py (added, +108/-0)
  • lib/crewai/tests/llms/oci/test_oci_sdk_surface.py (added, +155/-0)
  • lib/crewai/tests/rag/embeddings/conftest.py (added, +73/-0)
  • lib/crewai/tests/rag/embeddings/test_factory_oci.py (added, +211/-0)
  • lib/crewai/tests/rag/embeddings/test_oci_embedding_integration.py (added, +23/-0)
  • lib/crewai/tests/rag/embeddings/test_oci_image_embedding_integration.py (added, +45/-0)
  • uv.lock (modified, +72/-2)

PR #4959: feat: add OCI Generative AI provider — basic text completion

Description (problem / solution / changelog)

Summary

  • Add native OCI Generative AI text completion provider (OCICompletion) supporting generic (Meta, Google, OpenAI, xAI) and Cohere model families
  • Shared OCI auth utilities (utilities/oci.py) for API key, security token, instance principal, and resource principal auth
  • OCI registered as optional dependency (crewai[oci])
  • 15 unit tests (mocked SDK) + 2 parametrized integration tests (tested live against meta.llama-3.3-70b-instruct, cohere.command-r-plus-08-2024, google.gemini-2.5-flash, openai.gpt-5.2-chat-latest)

This is PR 1 of a series — follow-up PRs will add streaming, tool calling, structured output, multimodal, and embeddings support.

Supersedes #4885 (closed per reviewer feedback to split by scope). Tracking issue: #4944

What's included

FileLinesWhat
utilities/oci.py72Shared get_oci_module() + create_oci_client_kwargs()
llms/providers/oci/completion.py505OCICompletion(BaseLLM) — init, message building, basic call/acall
llm.py+13Provider registration (routing, pattern matching, import)
pyproject.toml+3oci optional dependency
Tests491conftest + 15 unit + 2 integration (parametrized across models)

What's NOT included (deferred to follow-up PRs)

  • Streaming (iter_stream, astream)
  • Tool calling / function calling
  • Structured output (response_model)
  • Multimodal (vision, documents, audio, video)
  • OCI embeddings provider
  • OCI tools (will be a standalone PyPI package per community tools guidelines)

Test plan

  • 15 unit tests pass (mocked OCI SDK, no credentials needed)
  • Integration tests pass against 4 model families via OCI GenAI API:
    • meta.llama-3.3-70b-instruct
    • cohere.command-r-plus-08-2024
    • google.gemini-2.5-flash
    • openai.gpt-5.2-chat-latest
  • Both sync (call) and async (acall) paths verified
<!-- CURSOR_SUMMARY -->

[!NOTE] Medium Risk Adds a new native LLM provider with multiple OCI authentication modes and new routing/pattern matching, which could affect model selection and introduce integration/auth edge cases. Changes are mostly additive and isolated, but involve external SDK calls and credential handling.

Overview Adds first-class support for Oracle Cloud Infrastructure (OCI) Generative AI as a native LLM provider, including provider routing (oci/...) and model-pattern validation for OCI model IDs and dedicated endpoint OCIDs.

Introduces OCICompletion for basic synchronous/async chat-based text completion (generic + Cohere formats), plus shared OCI SDK utilities for lazy importing and building client auth kwargs (API key, security token, instance/resource principals). Also registers oci as an optional dependency (crewai[oci]) and adds mocked unit tests plus live integration tests for the new provider.

<sup>Reviewed by Cursor Bugbot for commit 7ef6c024eb5bb91dcb144a920f5b2d32f4a4043a. Bugbot is set up for automated code reviews on this repo. Configure here.</sup>

<!-- /CURSOR_SUMMARY -->

Changed files

  • lib/crewai/pyproject.toml (modified, +3/-0)
  • lib/crewai/src/crewai/llm.py (modified, +11/-1)
  • lib/crewai/src/crewai/llms/providers/oci/__init__.py (added, +5/-0)
  • lib/crewai/src/crewai/llms/providers/oci/completion.py (added, +473/-0)
  • lib/crewai/src/crewai/utilities/oci.py (added, +72/-0)
  • lib/crewai/tests/llms/oci/__init__.py (added, +0/-0)
  • lib/crewai/tests/llms/oci/conftest.py (added, +189/-0)
  • lib/crewai/tests/llms/oci/test_oci.py (added, +269/-0)
  • lib/crewai/tests/llms/oci/test_oci_integration_basic.py (added, +33/-0)

PR #4961: feat: add streaming support to OCI Generative AI provider

Description (problem / solution / changelog)

Summary

  • Add streaming text completion via OCI SSE events (stream=True)
  • iter_stream() — sync generator yielding raw text chunks
  • astream() — async generator wrapping sync stream via thread + queue
  • _stream_chat_events holds ordered client lock for full stream duration
  • SSE event parsing handles both string and mapping payloads

Depends on #4959 (basic text completion provider). Draft until #4959 merges. Tracking issue: #4944

Diff breakdown

ChangeLines
completion.py (streaming methods)+230
test_oci_streaming.py (4 unit tests)+150
test_oci_integration_streaming.py (2 parametrized integration tests)+40
Total+420

Test plan

  • 4 unit tests (mocked SSE events): stream call, iter_stream, astream, client lock
  • Integration tests pass against 4 model families:
    • meta.llama-3.3-70b-instruct
    • cohere.command-r-plus-08-2024
    • google.gemini-2.5-flash
    • openai.gpt-5.2-chat-latest
  • All 15 existing PR 1 unit tests still pass (no regressions)

Changed files

  • lib/crewai/pyproject.toml (modified, +3/-0)
  • lib/crewai/src/crewai/llm.py (modified, +13/-0)
  • lib/crewai/src/crewai/llms/providers/oci/__init__.py (added, +5/-0)
  • lib/crewai/src/crewai/llms/providers/oci/completion.py (added, +726/-0)
  • lib/crewai/src/crewai/utilities/oci.py (added, +72/-0)
  • lib/crewai/tests/llms/oci/__init__.py (added, +0/-0)
  • lib/crewai/tests/llms/oci/conftest.py (added, +189/-0)
  • lib/crewai/tests/llms/oci/test_oci.py (added, +269/-0)
  • lib/crewai/tests/llms/oci/test_oci_integration_basic.py (added, +33/-0)
  • lib/crewai/tests/llms/oci/test_oci_integration_streaming.py (added, +40/-0)
  • lib/crewai/tests/llms/oci/test_oci_streaming.py (added, +150/-0)

PR #4962: feat: add tool calling support to OCI Generative AI provider

Description (problem / solution / changelog)

Summary

  • Native function calling for generic (Meta, Google, OpenAI, xAI) and Cohere model families
  • Tool formatting: CrewAI specs → OCI SDK FunctionDefinition / CohereTool
  • Tool call extraction: normalize OCI responses back to CrewAI shape (sync + streaming)
  • Recursive tool execution loop with max_sequential_tool_calls safety limit
  • Cohere-specific: trailing tool results handling, CohereToolCall/CohereToolResult mapping
  • Tool choice control (auto/none/required/function name)
  • Passthrough parameter filtering via SDK introspection (attribute_map/swagger_types)
  • supports_function_calling()True

Depends on #4961 (streaming) and #4959 (basic text). Draft until both merge. Tracking issue: #4944

Diff breakdown (vs streaming PR)

ChangeLines
completion.py (tool methods + message updates)+511/-16
test_oci_tools.py (9 unit tests)+291
test_oci_integration_tools.py (2 integration tests)+100
Total+902

Source is ~527 lines — slightly over 500 but tool calling is one cohesive feature that can't be meaningfully split further.

Test plan

  • 9 unit tests: tool formatting (generic + Cohere), tool call extraction, recursive execution, parallel tool rejection, max depth limit, passthrough filtering, supports_function_calling
  • 2 integration tests against meta.llama-3.3-70b-instruct: raw tool call return + recursive execution with add_numbers
  • All 19 prior unit tests (PR 1 + PR 2) still pass

Changed files

  • lib/crewai/pyproject.toml (modified, +3/-0)
  • lib/crewai/src/crewai/llm.py (modified, +13/-0)
  • lib/crewai/src/crewai/llms/providers/oci/__init__.py (added, +5/-0)
  • lib/crewai/src/crewai/llms/providers/oci/completion.py (added, +1221/-0)
  • lib/crewai/src/crewai/utilities/oci.py (added, +72/-0)
  • lib/crewai/tests/llms/oci/__init__.py (added, +0/-0)
  • lib/crewai/tests/llms/oci/conftest.py (added, +189/-0)
  • lib/crewai/tests/llms/oci/test_oci.py (added, +269/-0)
  • lib/crewai/tests/llms/oci/test_oci_integration_basic.py (added, +33/-0)
  • lib/crewai/tests/llms/oci/test_oci_integration_streaming.py (added, +40/-0)
  • lib/crewai/tests/llms/oci/test_oci_integration_tools.py (added, +100/-0)
  • lib/crewai/tests/llms/oci/test_oci_streaming.py (added, +150/-0)
  • lib/crewai/tests/llms/oci/test_oci_tools.py (added, +291/-0)

PR #4963: feat: add structured output support to OCI Generative AI provider

Description (problem / solution / changelog)

Summary

  • response_model (Pydantic BaseModel) support for structured JSON output
  • _build_response_format: converts Pydantic schema → OCI JsonSchemaResponseFormat (generic) or CohereResponseJsonFormat (Cohere)
  • _parse_structured_response: validates model output and returns typed Pydantic instance
  • response_model threaded through call()_call_impl / _stream_call_impl_handle_tool_calls for full coverage
  • Handles JSON wrapped in markdown fences via base class _validate_structured_output

Depends on #4962, #4961, #4959. Draft until all merge. Tracking issue: #4944

Diff breakdown (vs tool calling PR)

ChangeLines
completion.py (structured output methods + threading)+96/-2
test_oci_structured.py (5 unit tests)+197
test_oci_integration_structured.py (1 parametrized test)+38
Total+333

Test plan

  • 5 unit tests: generic structured output, Cohere structured output, fenced JSON, None model, schema creation
  • Integration tests against meta.llama-3.3-70b-instruct and google.gemini-2.5-flash
  • All 28 prior unit tests (PR 1-3) still pass

Changed files

  • lib/crewai/pyproject.toml (modified, +3/-0)
  • lib/crewai/src/crewai/llm.py (modified, +13/-0)
  • lib/crewai/src/crewai/llms/providers/oci/__init__.py (added, +5/-0)
  • lib/crewai/src/crewai/llms/providers/oci/completion.py (added, +1315/-0)
  • lib/crewai/src/crewai/utilities/oci.py (added, +72/-0)
  • lib/crewai/tests/llms/oci/__init__.py (added, +0/-0)
  • lib/crewai/tests/llms/oci/conftest.py (added, +189/-0)
  • lib/crewai/tests/llms/oci/test_oci.py (added, +269/-0)
  • lib/crewai/tests/llms/oci/test_oci_integration_basic.py (added, +33/-0)
  • lib/crewai/tests/llms/oci/test_oci_integration_streaming.py (added, +40/-0)
  • lib/crewai/tests/llms/oci/test_oci_integration_structured.py (added, +33/-0)
  • lib/crewai/tests/llms/oci/test_oci_integration_tools.py (added, +100/-0)
  • lib/crewai/tests/llms/oci/test_oci_streaming.py (added, +150/-0)
  • lib/crewai/tests/llms/oci/test_oci_structured.py (added, +204/-0)
  • lib/crewai/tests/llms/oci/test_oci_tools.py (added, +291/-0)

PR #4964: feat: add multimodal support to OCI Generative AI provider

Description (problem / solution / changelog)

Summary

  • vision.py: vision model lists, to_data_uri, load_image, encode_image, is_vision_model helpers
  • _build_generic_content handles image_url, document_url, video_url, audio_url content types → OCI SDK ImageContent, DocumentContent, VideoContent, AudioContent
  • _message_has_multimodal_content detects non-text payloads for Cohere rejection
  • Cohere models reject multimodal with clear error (text-only)
  • supports_multimodal()True

Depends on #4963, #4962, #4961, #4959. Draft until all merge. Tracking issue: #4944

Diff breakdown (vs structured output PR)

ChangeLines
vision.py (new file)+62
completion.py (multimodal content + checks)+58/-4
__init__.py (vision exports)+15/-1
test_oci_multimodal.py (10 unit tests)+195
test_oci_integration_multimodal.py (1 live test)+106
Total+440

Test plan

  • 10 unit tests: image/document/video/audio content building, unsupported type rejection, Cohere multimodal rejection, multimodal detection, supports_multimodal, vision helpers
  • Live integration: sent 2x2 red PNG to google.gemini-2.5-flash via data URI — correctly identified color
  • All 33 prior unit tests still pass (no regressions)

Changed files

  • lib/crewai/pyproject.toml (modified, +3/-0)
  • lib/crewai/src/crewai/llm.py (modified, +13/-0)
  • lib/crewai/src/crewai/llms/providers/oci/__init__.py (added, +19/-0)
  • lib/crewai/src/crewai/llms/providers/oci/completion.py (added, +1375/-0)
  • lib/crewai/src/crewai/llms/providers/oci/vision.py (added, +57/-0)
  • lib/crewai/src/crewai/utilities/oci.py (added, +72/-0)
  • lib/crewai/tests/llms/oci/__init__.py (added, +0/-0)
  • lib/crewai/tests/llms/oci/conftest.py (added, +189/-0)
  • lib/crewai/tests/llms/oci/test_oci.py (added, +269/-0)
  • lib/crewai/tests/llms/oci/test_oci_integration_basic.py (added, +33/-0)
  • lib/crewai/tests/llms/oci/test_oci_integration_multimodal.py (added, +106/-0)
  • lib/crewai/tests/llms/oci/test_oci_integration_streaming.py (added, +40/-0)
  • lib/crewai/tests/llms/oci/test_oci_integration_structured.py (added, +33/-0)
  • lib/crewai/tests/llms/oci/test_oci_integration_tools.py (added, +100/-0)
  • lib/crewai/tests/llms/oci/test_oci_multimodal.py (added, +195/-0)
  • lib/crewai/tests/llms/oci/test_oci_streaming.py (added, +150/-0)
  • lib/crewai/tests/llms/oci/test_oci_structured.py (added, +204/-0)
  • lib/crewai/tests/llms/oci/test_oci_tools.py (added, +291/-0)

PR #4966: feat: add OCI Generative AI embeddings provider

Description (problem / solution / changelog)

Summary

  • OCIEmbeddingFunction: ChromaDB-compatible embedding callable with batching, config serialization, and image embedding support
  • OCIProvider: Pydantic-based provider with AliasChoices for env var and config key validation
  • Factory registration in embeddings/factory.py + types.py (provider name: "oci")
  • Supports text and image embeddings, configurable output dimensions, custom endpoints, all 4 OCI auth modes
  • Shared auth via utilities/oci.py (from PR 1)

Depends on #4964, #4963, #4962, #4961, #4959. Draft until all merge. Tracking issue: #4944

Diff breakdown (vs multimodal PR)

ChangeLines
embedding_callable.py (new)+181
oci_provider.py (new)+75
types.py (new)+30
__init__.py (new)+17
factory.py (registration + overload)+9
types.py (ProviderSpec + Literal)+3
test_factory_oci.py (5 unit tests)+207
test_oci_embedding_integration.py (2 live tests)+66
Total+588

Test plan

  • 5 unit tests: factory wiring, batching, output dimensions, config serialization, image embeddings
  • 2 live integration tests against cohere.embed-english-v3.0 (API_KEY_AUTH): single text + batch
  • All 42 prior LLM unit tests still pass

Changed files

  • lib/crewai/pyproject.toml (modified, +3/-0)
  • lib/crewai/src/crewai/llm.py (modified, +13/-0)
  • lib/crewai/src/crewai/llms/providers/oci/__init__.py (added, +19/-0)
  • lib/crewai/src/crewai/llms/providers/oci/completion.py (added, +1375/-0)
  • lib/crewai/src/crewai/llms/providers/oci/vision.py (added, +57/-0)
  • lib/crewai/src/crewai/rag/embeddings/factory.py (modified, +9/-0)
  • lib/crewai/src/crewai/rag/embeddings/providers/oci/__init__.py (added, +17/-0)
  • lib/crewai/src/crewai/rag/embeddings/providers/oci/embedding_callable.py (added, +181/-0)
  • lib/crewai/src/crewai/rag/embeddings/providers/oci/oci_provider.py (added, +75/-0)
  • lib/crewai/src/crewai/rag/embeddings/providers/oci/types.py (added, +30/-0)
  • lib/crewai/src/crewai/rag/embeddings/types.py (modified, +3/-0)
  • lib/crewai/src/crewai/utilities/oci.py (added, +72/-0)
  • lib/crewai/tests/llms/oci/__init__.py (added, +0/-0)
  • lib/crewai/tests/llms/oci/conftest.py (added, +189/-0)
  • lib/crewai/tests/llms/oci/test_oci.py (added, +269/-0)
  • lib/crewai/tests/llms/oci/test_oci_integration_basic.py (added, +33/-0)
  • lib/crewai/tests/llms/oci/test_oci_integration_multimodal.py (added, +106/-0)
  • lib/crewai/tests/llms/oci/test_oci_integration_streaming.py (added, +40/-0)
  • lib/crewai/tests/llms/oci/test_oci_integration_structured.py (added, +33/-0)
  • lib/crewai/tests/llms/oci/test_oci_integration_tools.py (added, +100/-0)
  • lib/crewai/tests/llms/oci/test_oci_multimodal.py (added, +195/-0)
  • lib/crewai/tests/llms/oci/test_oci_streaming.py (added, +150/-0)
  • lib/crewai/tests/llms/oci/test_oci_structured.py (added, +204/-0)
  • lib/crewai/tests/llms/oci/test_oci_tools.py (added, +291/-0)
  • lib/crewai/tests/rag/embeddings/test_factory_oci.py (added, +207/-0)
  • lib/crewai/tests/rag/embeddings/test_oci_embedding_integration.py (added, +66/-0)

PR #4982: feat: add true async support to OCI provider via aiohttp

Description (problem / solution / changelog)

Summary

Replace asyncio.to_thread wrappers with true async I/O for acall() and astream(). The OCI SDK is synchronous, so we bypass it for HTTP and use its signer for request authentication directly via aiohttp.

  • oci_async.py: OCIAsyncClient — aiohttp-based HTTP client with OCI request signing, native SSE parsing, connection pooling
  • acall(): true async chat completion, no thread pool
  • astream(): true async SSE streaming, no thread+queue bridge
  • Graceful fallback to asyncio.to_thread when aiohttp is unavailable or the client is mocked
  • aiohttp + certifi added to crewai[oci] optional deps

Temporary measure until the OCI SDK ships native async. Based on the same pattern used in langchain-oracle.

Depends on #4966, #4964, #4963, #4962, #4961, #4959. Draft until all merge. Tracking issue: #4944

Diff breakdown (vs embeddings PR)

ChangeLines
oci_async.py (new — async client)+178
completion.py (async paths + fallback)+226/-39
pyproject.toml (aiohttp dep)+2
test_oci_async.py (4 live integration tests)+93
Total+499

Test plan

  • 42 prior unit tests still pass (fallback path)
  • 4 live integration tests against meta.llama-3.3-70b-instruct:
    • True async client initialization verified
    • acall returns text response
    • astream yields chunks
    • Concurrent asyncio.gather with 2 simultaneous calls

Changed files

  • lib/crewai/pyproject.toml (modified, +5/-0)
  • lib/crewai/src/crewai/llm.py (modified, +13/-0)
  • lib/crewai/src/crewai/llms/providers/oci/__init__.py (added, +19/-0)
  • lib/crewai/src/crewai/llms/providers/oci/completion.py (added, +1523/-0)
  • lib/crewai/src/crewai/llms/providers/oci/vision.py (added, +57/-0)
  • lib/crewai/src/crewai/rag/embeddings/factory.py (modified, +9/-0)
  • lib/crewai/src/crewai/rag/embeddings/providers/oci/__init__.py (added, +17/-0)
  • lib/crewai/src/crewai/rag/embeddings/providers/oci/embedding_callable.py (added, +181/-0)
  • lib/crewai/src/crewai/rag/embeddings/providers/oci/oci_provider.py (added, +75/-0)
  • lib/crewai/src/crewai/rag/embeddings/providers/oci/types.py (added, +30/-0)
  • lib/crewai/src/crewai/rag/embeddings/types.py (modified, +3/-0)
  • lib/crewai/src/crewai/utilities/oci.py (added, +72/-0)
  • lib/crewai/src/crewai/utilities/oci_async.py (added, +178/-0)
  • lib/crewai/tests/llms/oci/__init__.py (added, +0/-0)
  • lib/crewai/tests/llms/oci/conftest.py (added, +189/-0)
  • lib/crewai/tests/llms/oci/test_oci.py (added, +269/-0)
  • lib/crewai/tests/llms/oci/test_oci_async.py (added, +93/-0)
  • lib/crewai/tests/llms/oci/test_oci_integration_basic.py (added, +33/-0)
  • lib/crewai/tests/llms/oci/test_oci_integration_multimodal.py (added, +106/-0)
  • lib/crewai/tests/llms/oci/test_oci_integration_streaming.py (added, +40/-0)
  • lib/crewai/tests/llms/oci/test_oci_integration_structured.py (added, +33/-0)
  • lib/crewai/tests/llms/oci/test_oci_integration_tools.py (added, +100/-0)
  • lib/crewai/tests/llms/oci/test_oci_multimodal.py (added, +195/-0)
  • lib/crewai/tests/llms/oci/test_oci_streaming.py (added, +150/-0)
  • lib/crewai/tests/llms/oci/test_oci_structured.py (added, +204/-0)
  • lib/crewai/tests/llms/oci/test_oci_tools.py (added, +291/-0)
  • lib/crewai/tests/rag/embeddings/test_factory_oci.py (added, +207/-0)
  • lib/crewai/tests/rag/embeddings/test_oci_embedding_integration.py (added, +66/-0)

PR #1804: Add OCI LangChain support for hosted Nemotron workflows

Description (problem / solution / changelog)

Summary

  • add a first-class OCI LLM config to NAT core and register it alongside the existing providers
  • add LangChain wrapper support for OCI via langchain-oci, matching the workflow-layer integration shape used by AWS Bedrock in this repo
  • add OCI docs and tests, with live integration coverage centered on an OCI-hosted Nemotron inference endpoint
  • declare the necessary uv extra conflicts so the workspace remains solvable when langchain-oci introduces openai>=2 alongside existing strands and vanna surfaces

What Was Tested

  • PYTHONPATH=$(pwd)/packages/nvidia_nat_core/src:$(pwd)/packages/nvidia_nat_langchain/src:$(pwd)/packages/nvidia_nat_test/src .venv/bin/pytest packages/nvidia_nat_core/tests/nat/llm/test_oci_llm.py packages/nvidia_nat_langchain/tests/test_llm_langchain.py -q -k 'OCI or oci'
  • OCI_NEMOTRON_BASE_URL=http://127.0.0.1:8080/v1 OCI_NEMOTRON_MODEL=nvidia/Llama-3.1-Nemotron-Nano-8B-v1 PYTHONPATH=$(pwd)/packages/nvidia_nat_core/src:$(pwd)/packages/nvidia_nat_langchain/src:$(pwd)/packages/nvidia_nat_test/src .venv/bin/pytest packages/nvidia_nat_langchain/tests/test_langchain_agents.py -q --run_integration -k oci_hosted_nemotron_openai_compatible_agent
  • uv lock

Notes

  • all live validation in this PR is centered on nvidia/Llama-3.1-Nemotron-Nano-8B-v1
  • the live Nemotron endpoint is served from an OKE + vLLM inference layer in Phoenix
  • this closes the main OCI workflow-layer gap relative to the existing AWS Bedrock path in nvidia_nat_langchain
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

Summary by CodeRabbit

  • New Features

    • Added an OCI-hosted LLM provider with LangChain client support and Nemotron-compatible model option.
  • Documentation

    • New OCI Generative AI integration guide, config examples, TOC entry, and documentation redirects; OCI added to supported providers list.
  • Tests

    • Added unit and integration tests for the OCI provider and LangChain wrapper, plus a pytest fixture for OCI Nemotron endpoints.
  • Chores

    • Broadened OpenAI dependency ranges, added langchain-oci runtime dependency, and adjusted optional extras/conflicts in packaging.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Changed files

  • ci/markdown-link-check-config.json (modified, +3/-0)
  • docs/source/build-workflows/llms/index.md (modified, +43/-0)
  • docs/source/components/integrations/index.md (modified, +2/-1)
  • docs/source/components/integrations/integrating-oci-generative-ai-models.md (added, +99/-0)
  • docs/source/get-started/installation.md (modified, +1/-0)
  • examples/A2A/math_assistant_a2a/uv.lock (modified, +77/-0)
  • examples/A2A/math_assistant_a2a_protected/uv.lock (modified, +77/-0)
  • examples/HITL/por_to_jiratickets/uv.lock (modified, +77/-0)
  • examples/HITL/simple_calculator_hitl/uv.lock (modified, +77/-0)
  • examples/MCP/simple_calculator_fastmcp/uv.lock (modified, +77/-0)
  • examples/MCP/simple_calculator_fastmcp_protected/uv.lock (modified, +77/-0)
  • examples/MCP/simple_calculator_mcp/uv.lock (modified, +77/-0)
  • examples/MCP/simple_calculator_mcp_protected/uv.lock (modified, +77/-0)
  • examples/RAG/simple_rag/uv.lock (modified, +77/-0)
  • examples/advanced_agents/alert_triage_agent/uv.lock (modified, +77/-0)
  • examples/agents/uv.lock (modified, +77/-0)
  • examples/control_flow/hybrid_control_flow/uv.lock (modified, +77/-0)
  • examples/control_flow/parallel_executor/uv.lock (modified, +77/-0)
  • examples/control_flow/router_agent/uv.lock (modified, +77/-0)
  • examples/control_flow/sequential_executor/uv.lock (modified, +77/-0)
  • examples/custom_functions/automated_description_generation/uv.lock (modified, +77/-0)
  • examples/custom_functions/plot_charts/uv.lock (modified, +77/-0)
  • examples/documentation_guides/uv.lock (modified, +64/-0)
  • examples/documentation_guides/workflows/text_file_ingest/uv.lock (modified, +77/-0)
  • examples/dynamo_integration/latency_sensitivity_demo/uv.lock (modified, +77/-0)
  • examples/dynamo_integration/react_benchmark_agent/uv.lock (modified, +77/-0)
  • examples/evaluation_and_profiling/email_phishing_analyzer/uv.lock (modified, +77/-0)
  • examples/evaluation_and_profiling/simple_calculator_eval/uv.lock (modified, +77/-0)
  • examples/evaluation_and_profiling/simple_web_query_eval/uv.lock (modified, +64/-0)
  • examples/finetuning/dpo_tic_tac_toe/uv.lock (modified, +77/-0)
  • examples/finetuning/rl_with_openpipe_art/uv.lock (modified, +77/-0)
  • examples/frameworks/multi_frameworks/uv.lock (modified, +77/-0)
  • examples/frameworks/semantic_kernel_demo/uv.lock (modified, +64/-0)
  • examples/frameworks/strands_demo/uv.lock (modified, +84/-6)
  • examples/front_ends/per_user_workflow/uv.lock (modified, +77/-0)
  • examples/front_ends/simple_auth/uv.lock (modified, +77/-0)
  • examples/front_ends/simple_calculator_custom_routes/uv.lock (modified, +77/-0)
  • examples/getting_started/simple_calculator/uv.lock (modified, +77/-0)
  • examples/getting_started/simple_web_query/uv.lock (modified, +64/-0)
  • examples/memory/redis/uv.lock (modified, +77/-0)
  • examples/notebooks/uv.lock (modified, +77/-0)
  • examples/object_store/user_report/uv.lock (modified, +77/-0)
  • examples/observability/simple_calculator_observability/uv.lock (modified, +64/-0)
  • examples/prompt_from_file/uv.lock (modified, +77/-0)
  • examples/safety_and_security/retail_agent/uv.lock (modified, +77/-0)
  • packages/nvidia_nat_core/src/nat/llm/oci_llm.py (added, +101/-0)
  • packages/nvidia_nat_core/src/nat/llm/register.py (modified, +1/-0)
  • packages/nvidia_nat_core/tests/nat/llm/test_oci_llm.py (added, +105/-0)
  • packages/nvidia_nat_langchain/pyproject.toml (modified, +1/-0)
  • packages/nvidia_nat_langchain/src/nat/plugins/langchain/llm.py (modified, +58/-0)
  • packages/nvidia_nat_langchain/tests/test_langchain_agents.py (modified, +86/-0)
  • packages/nvidia_nat_langchain/tests/test_llm_langchain.py (modified, +109/-0)
  • packages/nvidia_nat_langchain/uv.lock (modified, +77/-0)
  • packages/nvidia_nat_test/src/nat/test/plugin.py (modified, +30/-0)
  • packages/nvidia_nat_vanna/uv.lock (modified, +77/-0)
  • uv.lock (modified, +64/-0)
RAW_BUFFERClick to expand / collapse

Feature Request

Add native support for Oracle Cloud Infrastructure (OCI) Generative AI as a first-class provider in CrewAI.

Why

OCI GenAI is one of the few cloud platforms hosting multiple model families under one roof — Meta Llama, Google Gemini, OpenAI GPT (4o, 5, OSS), xAI Grok, and Cohere — all accessible through a single API surface. Enterprise teams on OCI currently have no native path to use these models with CrewAI without custom workarounds.

Adding native OCI support would:

  • Give CrewAI access to Oracle's enterprise customer base
  • Enable crews to use 50+ models across 6 model families on OCI
  • Support embeddings (Cohere models) for RAG workflows
  • Support tool/function calling for agentic workflows
  • Provide an alternative to OpenAI/Anthropic for enterprises with Oracle cloud commitments

Implementation

PR #4885 provides a complete implementation including:

  • OciLLM class with chat, streaming, and tool calling
  • OciEmbedding class for Cohere embedding models
  • OCI API key authentication with request signing
  • Model-specific parameter handling across all families
  • Full test coverage

Related

  • Issue #3165 (closed) — prior bug report about OCI GenAI Gateway compatibility
  • PR #4885 — implementation ready for review

extent analysis

Fix Plan

To add native support for Oracle Cloud Infrastructure (OCI) Generative AI, implement the following steps:

  • Review and merge PR #4885, which provides a complete implementation of OCI GenAI support
  • Integrate the OciLLM class for chat, streaming, and tool calling
  • Utilize the OciEmbedding class for Cohere embedding models
  • Implement OCI API key authentication with request signing

Example code snippet for OciLLM class:

class OciLLM:
    def __init__(self, api_key, api_secret):
        self.api_key = api_key
        self.api_secret = api_secret

    def chat(self, prompt):
        # Implement chat functionality using OCI API
        pass

    def streaming(self, prompt):
        # Implement streaming functionality using OCI API
        pass

    def tool_calling(self, prompt):
        # Implement tool calling functionality using OCI API
        pass

Verification

To verify the fix, test the following scenarios:

  • Chat functionality with various model families (e.g., Meta Llama, Google Gemini)
  • Streaming functionality with Cohere embedding models
  • Tool calling functionality for agentic workflows
  • Authentication and request signing with OCI API key

Extra Tips

  • Ensure proper error handling and logging for OCI API requests
  • Consider adding support for additional model families and features in future updates
  • Review and update documentation to reflect the new OCI GenAI support

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING