HTTP service for a self-hosted Jina embeddings v5 server.
The contract
POST {base_url}/embed, with the server's own field names:
{"texts": ["..."], "task": "retrieval", "prompt_name": "document",
"dimensions": 256, "normalize": true}answering
{"model": "...", "task": "...", "prompt_name": "...",
"dimensions": 256, "input_count": 1, "embeddings": [[...]]}Every rule below was checked against a running deployment, not inferred from a model card - the server rejects unknown fields outright, so guessing is not an option.
Summary
Functions
@spec embed(ExAgent.Providers.JinaV5.t(), [ExAgent.Embeddings.input()], keyword()) :: {:ok, ExAgent.Embeddings.t()} | {:error, ExAgent.Error.t()}
Generates embeddings for inputs.
Options
:dimensions- one of[32, 64, 128, 256, 512, 768, 1024]; the server truncates and re-normalizes:task- one of[:retrieval, :text_matching, :clustering, :classification]; defaults to:retrieval, matching the server:args-prompt_name: :query | :documentandnormalize: true | false. Nothing else: the server rejects unknown fields
Examples
ExAgent.embed(provider, chunks, task: :retrieval, args: [prompt_name: :document])
@spec tasks() :: [ExAgent.Embeddings.task()]
Returns the task atoms this service accepts.