Current section

Files

Jump to
liter_llm lib liter_llm modality.ex
Raw

lib/liter_llm/modality.ex

# This file is auto-generated by alef — DO NOT EDIT.
# alef:hash:718a9bb2066b4d98f177745b5c3db63c834a58163b5677360c01f624add6c233
# To regenerate: alef generate
# To verify freshness: alef verify --exit-code
defmodule LiterLlm.Modality do
@moduledoc """
Output modality requested from the model.
Passed as `modalities: ["text", "audio"]` (OpenAI) or translated to
`generationConfig.responseModalities` (Gemini / Vertex AI).
# Example
```
use liter_llm::types::{ChatCompletionRequest, Modality};
let req = ChatCompletionRequest {
model: "gpt-4o-audio-preview".into(),
modalities: Some(vec![Modality::Text, Modality::Audio]),
..Default::default()
};
```
"""
@typedoc "Output modality requested from the model."
@type t :: :text | :audio | :image
@text :text
@audio :audio
@image :image
@doc "Text output (the default for all providers)."
@spec text() :: t()
def text, do: @text
@doc "Audio / speech output."
@spec audio() :: t()
def audio, do: @audio
@doc "Image output (Gemini Imagen, gpt-image-1)."
@spec image() :: t()
def image, do: @image
end