EmbeddingProviderDescriptor
Everything llm4s needs to know about one embedding provider, supplied by the provider itself.
This is ProviderDescriptor's counterpart for the embedding half of the SPI, and it is deliberately a separate trait rather than a method on the chat descriptor: the two sets overlap but neither contains the other. OpenAI and Ollama supply both a chat client and an embedding provider, Voyage supplies only embeddings, and Anthropic only chat. Folding embeddings into ProviderDescriptor would force an embedding-only provider to implement buildClient and buildConfig only to fail them.
Register it by listing it in an Llm4sProviderModule's Llm4sProviderModule.embeddingProviders, exactly as a chat provider is registered, and EmbeddingClient.from can reach it with nothing in llm4s-core edited.
Attributes
- Example
-
object JinaEmbeddings extends EmbeddingProviderDescriptor: val id = ProviderId("jina") def build(config: EmbeddingProviderConfig): Result[EmbeddingProvider] = Right(JinaEmbeddingProvider.fromConfig(config)) - Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes