Geminix.V1beta.Part (geminix v0.2.0)

A datatype containing media that is part of a multi-part Content message. A Part consists of data which has an associated datatype. A Part can only contain one of the accepted types in Part.data. A Part must have a fixed IANA MIME type identifying the type and subtype of the media if the inline_data field is filled with raw bytes.

Fields:

  • :code_execution_result (Geminix.V1beta.CodeExecutionResult.t/0) - Result of executing the ExecutableCode.
  • :executable_code (Geminix.V1beta.ExecutableCode.t/0) - Code generated by the model that is meant to be executed.
  • :file_data (Geminix.V1beta.FileData.t/0) - URI based data.
  • :function_call (Geminix.V1beta.FunctionCall.t/0) - A predicted FunctionCall returned from the model that contains a string representing the FunctionDeclaration.name with the arguments and their values.
  • :function_response (Geminix.V1beta.FunctionResponse.t/0) - The result output of a FunctionCall that contains a string representing the FunctionDeclaration.name and a structured JSON object containing any output from the function is used as context to the model.
  • :inline_data (Geminix.V1beta.Blob.t/0) - Inline media bytes.
  • :media_resolution (Geminix.V1beta.MediaResolution.t/0) - Optional. Media resolution for the input media.
  • :part_metadata (map/0) - Custom metadata associated with the Part. Agents using genai.Part as content representation may need to keep track of the additional information. For example it can be name of a file/source from which the Part originates or a way to multiplex multiple Part streams.
  • :text (binary/0) - Inline text.
  • :thought (boolean/0) - Optional. Indicates if the part is thought from the model.
  • :thought_signature (binary/0) - Optional. An opaque signature for the thought so it can be reused in subsequent requests.
  • :video_metadata (Geminix.V1beta.VideoMetadata.t/0) - Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.

Summary

Functions

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

Types

t()

@type t() :: %Geminix.V1beta.Part{
  __meta__: term(),
  code_execution_result: Geminix.V1beta.CodeExecutionResult.t(),
  executable_code: Geminix.V1beta.ExecutableCode.t(),
  file_data: Geminix.V1beta.FileData.t(),
  function_call: Geminix.V1beta.FunctionCall.t(),
  function_response: Geminix.V1beta.FunctionResponse.t(),
  inline_data: Geminix.V1beta.Blob.t(),
  media_resolution: Geminix.V1beta.MediaResolution.t(),
  part_metadata: map(),
  text: binary(),
  thought: boolean(),
  thought_signature: binary(),
  video_metadata: Geminix.V1beta.VideoMetadata.t()
}

Functions

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

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

Create a Geminix.V1beta.Part.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.