Gemini.Types.Response.InlinedEmbedContentResponses (GeminiEx v0.8.4)
View SourceContainer for all responses in an inline batch.
Contains a list of InlinedEmbedContentResponse structs, each representing the result of one request from the batch.
Fields
inlined_responses: List of InlinedEmbedContentResponse structs
Examples
%InlinedEmbedContentResponses{
inlined_responses: [
%InlinedEmbedContentResponse{response: ..., error: nil},
%InlinedEmbedContentResponse{response: nil, error: ...}
]
}
Summary
Functions
Extracts all failed responses with their indices and error details.
Creates an inlined responses container from API response data.
Extracts all successful responses from the container.
Types
@type t() :: %Gemini.Types.Response.InlinedEmbedContentResponses{ inlined_responses: [Gemini.Types.Response.InlinedEmbedContentResponse.t()] }
Functions
Extracts all failed responses with their indices and error details.
Returns
List of tuples: {index, error_map}
Examples
failures = InlinedEmbedContentResponses.failed_responses(responses)
# => [{2, %{"code" => 400, "message" => "Invalid"}}, ...]
Creates an inlined responses container from API response data.
Parameters
data: Map containing the API response with inlined responses
Examples
InlinedEmbedContentResponses.from_api_response(%{
"inlinedResponses" => [
%{"response" => %{"embedding" => ...}},
%{"error" => %{"code" => 400}}
]
})
@spec successful_responses(t()) :: [Gemini.Types.Response.EmbedContentResponse.t()]
Extracts all successful responses from the container.
Returns
List of EmbedContentResponse structs
Examples
successful = InlinedEmbedContentResponses.successful_responses(responses)
# => [%EmbedContentResponse{...}, %EmbedContentResponse{...}]