Current section

Files

Jump to
liter_llm lib liter_llm provider_capabilities.ex
Raw

lib/liter_llm/provider_capabilities.ex

# This file is auto-generated by alef — DO NOT EDIT.
# alef:hash:b159ec7bf40f2249b9f5696d5819688bca2310a2b26cc9acae8194e6255f8b03
# To regenerate: alef generate
# To verify freshness: alef verify --exit-code
defmodule LiterLlm.ProviderCapabilities do
@moduledoc """
Static capability flags for a provider.
Each flag indicates whether the provider's models *generally* support that
feature. For providers that aggregate many underlying models (e.g. Bedrock,
OpenRouter, vLLM) the flags reflect the superset of available model
capabilities — a flag being `true` means at least one model supports the
feature, not every model.
All flags default to `false` so that newly added providers are safe.
Access via the crate-level [`capabilities`] function:
```rust
use liter_llm::capabilities;
let caps = capabilities("openai");
assert!(caps.function_calling);
assert!(caps.vision);
// Unknown providers return a default-all-false reference.
let unknown = capabilities("my-private-model");
assert!(!unknown.function_calling);
```
"""
@typedoc "Static capability flags for a provider."
@type t :: %__MODULE__{
vision: boolean(),
reasoning: boolean(),
structured_output: boolean(),
function_calling: boolean(),
audio_in: boolean(),
audio_out: boolean(),
video_in: boolean()
}
defstruct vision: false,
reasoning: false,
structured_output: false,
function_calling: false,
audio_in: false,
audio_out: false,
video_in: false
defimpl Jason.Encoder do
@doc false
def encode(value, opts) do
value
|> Map.from_struct()
|> Enum.reject(fn {_k, v} -> v == nil end)
|> Enum.into(%{})
|> Jason.Encoder.encode(opts)
end
end
end