Gemini.Types.Request.InputEmbedContentConfig (GeminiEx v0.8.4)

View Source

Input configuration for async batch embedding.

Specifies where to read batch embedding requests from. This is a union type - exactly ONE of the fields must be set.

Union Type - Choose ONE:

  • file_name: Google Cloud Storage URI (e.g., "gs://bucket/inputs.jsonl")
  • requests: InlinedEmbedContentRequests for inline processing

Per spec: Cannot specify both. One must be nil.

Examples

# File-based input
InputEmbedContentConfig.new_from_file("gs://my-bucket/embeddings/batch-001.jsonl")

# Inline requests
InputEmbedContentConfig.new_from_requests(inlined_requests)

Summary

Functions

Creates input config from a Google Cloud Storage file.

Creates input config from inline requests.

Converts the input config to API-compatible map format.

Validates that exactly one input source is specified.

Types

t()

@type t() :: %Gemini.Types.Request.InputEmbedContentConfig{
  file_name: String.t() | nil,
  requests: Gemini.Types.Request.InlinedEmbedContentRequests.t() | nil
}

Functions

new_from_file(file_name)

@spec new_from_file(String.t()) :: t()

Creates input config from a Google Cloud Storage file.

Parameters

  • file_name: GCS URI (e.g., "gs://bucket/inputs.jsonl")

Examples

InputEmbedContentConfig.new_from_file("gs://my-bucket/batch.jsonl")

new_from_requests(requests)

@spec new_from_requests(Gemini.Types.Request.InlinedEmbedContentRequests.t()) :: t()

Creates input config from inline requests.

Parameters

  • requests: InlinedEmbedContentRequests container

Examples

InputEmbedContentConfig.new_from_requests(inlined_requests)

to_api_map(input_embed_content_config)

@spec to_api_map(t()) :: map()

Converts the input config to API-compatible map format.

For file-based: {"fileName": "gs://..."} For inline: {"requests": {"requests": [...]}}

validate(arg1)

@spec validate(t()) :: :ok | {:error, String.t()}

Validates that exactly one input source is specified.

Returns

  • :ok if valid
  • {:error, reason} if invalid

Examples

InputEmbedContentConfig.validate(config)