Gemini.Types.Response.EmbedContentResponse (GeminiEx v0.3.0)

View Source

Response structure for embedding content requests.

Contains the generated embedding vector from the input content.

Fields

  • embedding: The content embedding containing the numerical vector

Examples

%EmbedContentResponse{
  embedding: %ContentEmbedding{
    values: [0.123, -0.456, 0.789, ...]
  }
}

Summary

Functions

Creates a new embedding response from API response data.

Extracts the embedding values as a list of floats.

Types

t()

@type t() :: %Gemini.Types.Response.EmbedContentResponse{
  embedding: Gemini.Types.Response.ContentEmbedding.t()
}

Functions

from_api_response(map)

@spec from_api_response(map()) :: t()

Creates a new embedding response from API response data.

Parameters

  • data: Map containing the API response

Examples

EmbedContentResponse.from_api_response(%{
  "embedding" => %{"values" => [0.1, 0.2, 0.3]}
})

get_values(embed_content_response)

@spec get_values(t()) :: [float()]

Extracts the embedding values as a list of floats.

Examples

response = %EmbedContentResponse{...}
values = EmbedContentResponse.get_values(response)
# => [0.123, -0.456, 0.789, ...]