Gemini.Types.Response.InlinedEmbedContentResponse (GeminiEx v0.8.4)
View SourceResponse for a single request within an async batch.
This is a union type - exactly ONE of response or error will be set.
Union Type - ONE will be set:
response: Successful EmbedContentResponseerror: Error status if request failed
Fields
metadata: Optional metadata from the requestresponse: Successful embedding response (if successful)error: Error details (if failed)
Examples
# Successful response
%InlinedEmbedContentResponse{
metadata: %{"id" => "123"},
response: %EmbedContentResponse{...},
error: nil
}
# Failed response
%InlinedEmbedContentResponse{
metadata: %{"id" => "456"},
response: nil,
error: %{"code" => 400, "message" => "Invalid input"}
}
Summary
Functions
Creates an inlined response from API response data.
Checks if the inlined response is an error.
Checks if the inlined response is successful.
Types
@type t() :: %Gemini.Types.Response.InlinedEmbedContentResponse{ error: map() | nil, metadata: map() | nil, response: Gemini.Types.Response.EmbedContentResponse.t() | nil }
Functions
Creates an inlined response from API response data.
Parameters
data: Map containing the API response
Examples
InlinedEmbedContentResponse.from_api_response(%{
"metadata" => %{"id" => "123"},
"response" => %{"embedding" => %{"values" => [...]}}
})
Checks if the inlined response is an error.
Examples
InlinedEmbedContentResponse.is_error?(response)
# => false
Checks if the inlined response is successful.
Examples
InlinedEmbedContentResponse.is_success?(response)
# => true