Gemini.Types.Response.InlinedEmbedContentResponses (GeminiEx v0.8.4)

View Source

Container 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

t()

@type t() :: %Gemini.Types.Response.InlinedEmbedContentResponses{
  inlined_responses: [Gemini.Types.Response.InlinedEmbedContentResponse.t()]
}

Functions

failed_responses(inlined_embed_content_responses)

@spec failed_responses(t()) :: [{integer(), map()}]

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"}}, ...]

from_api_response(map)

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

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}}
  ]
})

successful_responses(inlined_embed_content_responses)

@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{...}]