EmbeddingResponse

org.llm4s.llmconnect.model.EmbeddingResponse
See theEmbeddingResponse companion object
@Stable
final case class EmbeddingResponse

Successful response carrying embedding vectors and lightweight metadata.

Value parameters

dim

Optional dimensionality, if convenient to surface at response-level.

embeddings

One vector per input text/chunk (or per item).

metadata

Provider/model info etc. (e.g., "provider" -> "openai", "model" -> "...").

modality

Optional overall modality tag (Text, Audio, Video) when known.

usage

Optional token usage statistics (available from providers like OpenAI). Providers can set modality/dim/usage when they know it; callers can ignore safely. Build one with EmbeddingResponse.apply and change it with the with* setters (an Option field's setter takes the value or an Option); the constructor and copy are private, so a new field never breaks callers.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def withDim(dim: Int): EmbeddingResponse

Sets the vector dimensionality.

Sets the vector dimensionality.

Attributes

def withDim(dim: Option[Int]): EmbeddingResponse

Sets, or with None clears, the vector dimensionality.

Sets, or with None clears, the vector dimensionality.

Attributes

def withEmbeddings(embeddings: Seq[Seq[Double]]): EmbeddingResponse

Sets the embedding vectors, one per input.

Sets the embedding vectors, one per input.

Attributes

def withMetadata(metadata: Map[String, String]): EmbeddingResponse

Sets the provider and model metadata.

Sets the provider and model metadata.

Attributes

Sets the overall modality.

Sets the overall modality.

Attributes

def withModality(modality: Option[Modality]): EmbeddingResponse

Sets, or with None clears, the overall modality.

Sets, or with None clears, the overall modality.

Attributes

Sets the token usage.

Sets the token usage.

Attributes

Sets, or with None clears, the token usage.

Sets, or with None clears, the token usage.

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product