Current section

Files

Jump to
liter_llm lib liter_llm wait_for_batch_config.ex
Raw

lib/liter_llm/wait_for_batch_config.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.WaitForBatchConfig do
@moduledoc """
Configuration for polling a batch until terminal status.
All time values are in seconds as `f64` so the struct bridges across FFI
boundaries without requiring a `Duration` shim.
"""
@typedoc "Configuration for polling a batch until terminal status."
@type t :: %__MODULE__{
initial_interval_secs: float(),
max_interval_secs: float(),
backoff_multiplier: float(),
timeout_secs: float() | nil
}
defstruct initial_interval_secs: 5,
max_interval_secs: 60,
backoff_multiplier: 1.5,
timeout_secs: nil
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