Geminix.V1beta.AsyncBatchEmbedContentRequest (geminix v0.2.0)

Request for an AsyncBatchEmbedContent operation.

Fields:

Summary

Functions

Wait for the completion of a batch of requests, polling it periodically.

Wait for the completion of a batch of requests, polling it periodically. Raises if there is an error.

Get the output of a batch and load it into memory.

Get the output of a batch and load it into memory. Raises in the case of error.

Start a new batch request. Raises in case of error.

Update the state of a batch request by polling the API. Doesn't download the output of the request even if the batch has succeeded.

Types

t()

@type t() :: %Geminix.V1beta.AsyncBatchEmbedContentRequest{
  __meta__: term(),
  batch: Geminix.V1beta.EmbedContentBatch.t()
}

Functions

await(batch, opts \\ [])

@spec await(
  t(),
  keyword()
) :: {:ok, t()} | {:error, t()}

Wait for the completion of a batch of requests, polling it periodically.

await!(batch, opts \\ [])

@spec await!(
  t(),
  keyword()
) :: t()

Wait for the completion of a batch of requests, polling it periodically. Raises if there is an error.

from_map(schema \\ %__MODULE__{}, map)

@spec from_map(t(), map()) :: {:ok, t()} | {:error, Ecto.Changeset.t()}

Create a Geminix.V1beta.AsyncBatchEmbedContentRequest.t/0 from a map returned by the Gemini API.

Sometimes, this function should not be applied to the full response body, but instead it should be applied to the correct part of the map in the response body. This depends on the concrete API call.

get_output(batch, opts \\ [])

Get the output of a batch and load it into memory.

get_output!(batch, opts \\ [])

Get the output of a batch and load it into memory. Raises in the case of error.

start(model, inlined_embed_content_requests, opts \\ [])

@spec start(binary(), [Geminix.V1beta.InlinedEmbedContentRequest.t()], keyword()) ::
  {:ok, t()} | {:error, any()}

Start a new batch request.

start!(model, inlined_embed_content_requests, opts \\ [])

Start a new batch request. Raises in case of error.

update_state(batch, opts \\ [])

Update the state of a batch request by polling the API. Doesn't download the output of the request even if the batch has succeeded.