feat(oracle): add Cohere embeddings support#1634
Open
fede-kamel wants to merge 1 commit into
Open
Conversation
Adds the Oracle GenAI embeddings endpoint (Cohere embed models on OCI), exposing them through the gateway's `/v1/embeddings` interface. - `embed.ts`: request transform (string / string[] / object[] inputs, input_type / truncate / is_echo passthrough) and OCI-to-OpenAI response transform with usage mapping - `api.ts`: route the `embed` endpoint to OCI's `/actions/embedText` - `index.ts`: wire the embed config and response transform into the Oracle provider Scope is intentionally minimal — ON_DEMAND serving mode only. DEDICATED endpoint support can follow in a separate change once the matching `oracleEndpointId` provider option is plumbed through. Tests cover input shaping (string, string array, object array, empty), input_type mapping, ON_DEMAND serving payload, success response (data / model / usage), and error / invalid-response paths.
This was referenced May 6, 2026
Author
|
@roh26it @narengogi @VisargD — companion to #1537. Rebased on main, mergeable, e2e-verified live against |
narengogi
approved these changes
May 11, 2026
Author
|
Thanks for the review @narengogi! What's the next step from here to land this in a release? Happy to add a changelog entry, rebase, or anything else the merge process needs — just let me know what's missing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the Oracle GenAI embeddings endpoint (Cohere embed models on OCI) and wires it into the gateway's
/v1/embeddingssurface.This is the embeddings split from the original #1537 (per @narengogi's review asking to trim into focused PRs). #1537 now contains only the streaming tool-call fix.
What changed
src/providers/oracle/embed.tssrc/providers/oracle/api.tsembedendpoint to OCI/actions/embedTextsrc/providers/oracle/index.tsOracleEmbedConfig+OracleEmbedResponseTransformsrc/providers/oracle/embed.test.tsTotal diff: +266 / -0, 4 files, all under
src/providers/oracle/.Behaviour
inputas string, string array, or object array ({text: ...}).input_type: maps OpenAI-style values (search_document,search_query,classification,clustering,image) to OCI's uppercase enum.truncate: mapsnone/start/endto OCI'sNONE/START/END.oracleEndpointIdprovider option lands (intentionally out of scope here to keep the PR focused).embeddings: number[][]+inputTextTokenCountto OpenAI'sdata: [{embedding, index}]+usage.Verified
npm run build✓npm run format:check✓tsc --noEmitreports no errors insrc/providers/oracle/)inference.generativeai.us-chicago-1.oci.oraclecloud.com/20231130/actions/embedTextforcohere.embed-multilingual-v3.0(single string, batch, search_document type).Related
modelConfig.ts; this PR is the trimmed-down equivalent focused solely on the/v1/embeddingssurface.maxCompletionTokensrouting). The multi-vendor handler dispatch work that was originally bundled is parked for a separate focused PR.