mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-14 19:22:32 +03:00
docs(api): document the vertex-deepseek-ocr /v1/ocr provider
Adds the vertex-deepseek-ocr row to the /v1/ocr provider table and a short section on its Vertex AI auth/endpoint resolution, and lists the new provider/model id in openapi.yaml alongside mistral and azure-document-intelligence.
This commit is contained in:
@@ -6844,7 +6844,8 @@ paths:
|
||||
and response shape). Accepts a JSON body referencing a document/image
|
||||
and returns extracted text. `model` selects the provider via a
|
||||
`provider/model` prefix (e.g. `mistral/mistral-ocr-latest`,
|
||||
`azure-document-intelligence/prebuilt-read`); a bare model id (e.g.
|
||||
`azure-document-intelligence/prebuilt-read`,
|
||||
`vertex-deepseek-ocr/deepseek-ocr-maas`); a bare model id (e.g.
|
||||
`mistral-ocr-latest`) resolves to its registered provider, and an
|
||||
omitted `model` defaults to Mistral. Azure Document Intelligence is
|
||||
asynchronous upstream — the handler polls the returned operation
|
||||
@@ -6865,7 +6866,8 @@ paths:
|
||||
description: >-
|
||||
`provider/model` id or bare model id. Registered ids:
|
||||
`mistral/mistral-ocr-latest`,
|
||||
`azure-document-intelligence/prebuilt-read`. Defaults to
|
||||
`azure-document-intelligence/prebuilt-read`,
|
||||
`vertex-deepseek-ocr/deepseek-ocr-maas`. Defaults to
|
||||
`mistral-ocr-latest` when omitted.
|
||||
document:
|
||||
type: object
|
||||
|
||||
@@ -220,12 +220,13 @@ Content-Type: application/json
|
||||
`mistral-ocr-latest`) resolves to its registered provider, and an omitted `model` defaults to
|
||||
Mistral (`mistral-ocr-latest`). Registered providers (`open-sse/config/ocrRegistry.ts`):
|
||||
|
||||
| Provider id | Model id | `model` value | Notes |
|
||||
| ----------------------------- | -------------------- | ----------------------------------------------------------- | ------------------------------------------------------------------------------ |
|
||||
| `mistral` | `mistral-ocr-latest` | `mistral/mistral-ocr-latest` (or bare `mistral-ocr-latest`) | Synchronous — the response is returned directly from the single upstream call. |
|
||||
| `azure-document-intelligence` | `prebuilt-read` | `azure-document-intelligence/prebuilt-read` | Asynchronous upstream (`analyze` + poll) — see below. |
|
||||
| Provider id | Model id | `model` value | Notes |
|
||||
| ----------------------------- | -------------------- | ----------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
|
||||
| `mistral` | `mistral-ocr-latest` | `mistral/mistral-ocr-latest` (or bare `mistral-ocr-latest`) | Synchronous — the response is returned directly from the single upstream call. |
|
||||
| `azure-document-intelligence` | `prebuilt-read` | `azure-document-intelligence/prebuilt-read` | Asynchronous upstream (`analyze` + poll) — see below. |
|
||||
| `vertex-deepseek-ocr` | `deepseek-ocr-maas` | `vertex-deepseek-ocr/deepseek-ocr-maas` | Synchronous, via Vertex AI's `openapi/chat/completions` partner endpoint — see below for auth/URL. |
|
||||
|
||||
Both providers respond in the same Mistral-shaped body:
|
||||
All three providers respond in the same Mistral-shaped body:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -245,6 +246,19 @@ operation is still running after the attempt budget is exhausted. The final Azur
|
||||
normalized into the same `pages`/`markdown` shape used by Mistral before being returned to the
|
||||
caller, so client code does not need to special-case the provider.
|
||||
|
||||
### Vertex AI DeepSeek OCR auth and endpoint resolution
|
||||
|
||||
`vertex-deepseek-ocr` reuses the same Vertex AI authentication OmniRoute already supports for
|
||||
chat/image traffic (`open-sse/executors/vertex.ts`): the connection's API key is either a
|
||||
Service Account JSON credential (exchanged for a short-lived OAuth access token via the JWT-bearer
|
||||
flow) or an already-minted OAuth access token used as-is. The upstream endpoint URL is Vertex's
|
||||
generic `openapi/chat/completions` partner endpoint, built from the connection's project and
|
||||
region — an explicit `providerSpecificData.project`/`providerSpecificData.region` always wins;
|
||||
otherwise the project is derived from the Service Account JSON's `project_id` and the region
|
||||
defaults to `us-central1`. Both resolutions happen in `open-sse/handlers/ocr.ts`
|
||||
(`resolveVertexOcrAccessToken`, `resolveVertexOcrBaseUrl`), consumed by
|
||||
`src/app/api/v1/ocr/route.ts` before dispatching to `handleOcr`.
|
||||
|
||||
---
|
||||
|
||||
## List Models
|
||||
|
||||
Reference in New Issue
Block a user