Geminix.V1beta.Message (geminix v0.2.0)

The base unit of structured text. A Message includes an author and the content of the Message. The author is used to tag messages when they are fed to the model as text.

Fields:

  • :author (binary/0) - Optional. The author of this Message. This serves as a key for tagging the content of this Message when it is fed to the model as text. The author can be any alphanumeric string.
  • :citation_metadata (Geminix.V1beta.CitationMetadata.t/0) - Output only. Citation information for model-generated content in this Message. If this Message was generated as output from the model, this field may be populated with attribution information for any text included in the content. This field is used only on output.
  • :content (binary/0) - Required. The text content of the structured Message.

Summary

Functions

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

Types

t()

@type t() :: %Geminix.V1beta.Message{
  __meta__: term(),
  author: binary(),
  citation_metadata: Geminix.V1beta.CitationMetadata.t(),
  content: binary()
}

Functions

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

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

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