Jido.AI.Query (Jido AI v2.2.0)

Copy Markdown View Source

Shared schema and helpers for text or multimodal user queries.

Summary

Types

Uploaded file reference accepted by generated request helpers.

t()

Functions

Appends uploaded file references from request options to a text or content-part query.

Returns true when a term is a ReqLLM content part or compatible content-part map.

Returns a Zoi schema that accepts text or a non-empty list of ReqLLM content parts.

Builds a text summary for event metadata without discarding the original query.

Validates that a parsed multimodal query is a non-empty list of content parts.

Types

file_reference()

@type file_reference() :: String.t() | keyword() | map()

Uploaded file reference accepted by generated request helpers.

t()

@type t() :: String.t() | [ReqLLM.Message.ContentPart.t() | map()]

Functions

attach_file_references(query, opts)

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

Appends uploaded file references from request options to a text or content-part query.

Supports :file_id, :file_ids, :file_reference, and :file_references. File references can be strings, keyword lists, or maps with :file_id/"file_id" plus optional :media_type, :filename, :metadata, :title, :context, or :citations.

Returns an explicit unsupported error when the active ReqLLM version does not expose ReqLLM.Message.ContentPart.file_id/3.

content_part?(arg1)

@spec content_part?(term()) :: boolean()

Returns true when a term is a ReqLLM content part or compatible content-part map.

schema(opts \\ [])

@spec schema(keyword()) :: Zoi.schema()

Returns a Zoi schema that accepts text or a non-empty list of ReqLLM content parts.

summarize(query)

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

Builds a text summary for event metadata without discarding the original query.

validate_content_parts(parts, opts)

@spec validate_content_parts(
  term(),
  keyword()
) :: :ok | {:error, String.t()}

Validates that a parsed multimodal query is a non-empty list of content parts.