EmbeddingClient

org.llm4s.llmconnect.EmbeddingClient
See theEmbeddingClient companion object
@Stable
class EmbeddingClient(provider: EmbeddingProvider, tracer: Option[Tracing], operation: String, val providerId: Option[ProviderId])(using service: ModelRegistryService)

Embeds text through an org.llm4s.llmconnect.provider.EmbeddingProvider. With a tracer, each call is traced: a completed call as one org.llm4s.trace.TraceEvent.EmbeddingUsageRecorded (with the call's provider and duration) and, when its model's pricing is known, a cost; a failed call as one org.llm4s.trace.TraceEvent.ErrorOccurred naming the embeddings operation (#2275).

Value parameters

providerId

the canonical id of the provider, which tracing reports; EmbeddingClient.from sets it

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

Text embeddings via the configured HTTP provider.

Text embeddings via the configured HTTP provider.

Attributes

Multimodal embeddings via the configured HTTP provider.

Multimodal embeddings via the configured HTTP provider.

Attributes

def withOperation(op: String): EmbeddingClient

Create a new client with a specific operation label for tracing.

Create a new client with a specific operation label for tracing.

Attributes

Create a new client with tracing enabled.

Create a new client with tracing enabled.

Attributes

Concrete fields

val providerId: Option[ProviderId]