ExAgent.Services.JinaV5EmbedService (ExAgent v0.3.0)

Copy Markdown View Source

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

Generates embeddings for inputs.

Returns the task atoms this service accepts.

Functions

embed(provider, inputs, opts \\ [])

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 | :document and normalize: true | false. Nothing else: the server rejects unknown fields

Examples

ExAgent.embed(provider, chunks, task: :retrieval, args: [prompt_name: :document])

tasks()

@spec tasks() :: [ExAgent.Embeddings.task()]

Returns the task atoms this service accepts.