Current section

Files

Jump to
liter_llm lib liter_llm assistant_content.ex
Raw

lib/liter_llm/assistant_content.ex

# This file is auto-generated by alef — DO NOT EDIT.
# alef:hash:645d8ff0f3a0ef7684f9b9ea4ce1ae251a78a2a3481ecdeabf7643c53d644bb0
# To regenerate: alef generate
# To verify freshness: alef verify --exit-code
defmodule LiterLlm.AssistantContent do
@moduledoc """
Content shape for assistant messages.
`#[serde(untagged)]` means providers returning a plain scalar string for the
`content` field still deserialise correctly into `AssistantContent::Text(_)`.
Providers returning an array of typed parts (e.g. after an image-generation
or audio-synthesis request) deserialise into `AssistantContent::Parts(_)`.
"""
@typedoc "Content shape for assistant messages."
@type t :: term()
@typedoc "Plain text response (the common case for text-only models)."
@type text :: %{type: :text, value: String.t()}
@typedoc "Structured parts — text, refusals, output images, output audio."
@type parts :: %{type: :parts, value: [map()]}
end