Embedding provider implementation for the Jina AI embedding API.
Generates text embeddings by posting batched input to Jina's <baseUrl>/embeddings endpoint (the default base URL is https://api.jina.ai/v1), with the configured JinaTask as the task field. All texts go in one HTTP call.
Requires a valid Jina AI API key (JINA_API_KEY) in the provider configuration.
Turns this provider's config section into the EmbeddingProviderConfig its client needs.
Turns this provider's config section into the EmbeddingProviderConfig its client needs.
The default implementation resolves model, base URL and API key against configSpec, which is all any of the project's own providers needs. Override it only for a provider whose config genuinely cannot be expressed that way.
Value parameters
modelOverride
the <model> half of EMBEDDING_MODEL=<id>/<model>, when the unified form was used. Takes precedence over the section.
section
the llm4s.embeddings.<id> section, already parsed, its apiKey already falling back to the shared llm4s.credentials.<id>.apiKey when it sets none. Empty rather than absent when the user configured nothing. Everything this method needs arrives typed, in here: a descriptor never reads configuration itself.
Canonical id, e.g. ProviderId("voyage"). Must be unique among the embedding providers in a registry.
Canonical id, e.g. ProviderId("voyage"). Must be unique among the embedding providers in a registry.
Chat and embedding ids live in separate namespaces, so a provider that supplies both — OpenAI, Ollama — uses the same id for each without a clash. That is what lets EMBEDDING_MODEL=ollama/nomic-embed-text and a named chat section with provider = "ollama" name the same provider.