Current section

Files

Jump to
liter_llm lib liter_llm response_object.ex
Raw

lib/liter_llm/response_object.ex

# This file is auto-generated by alef — DO NOT EDIT.
# alef:hash:0c694843abf5c6a9fc8b410dfa73aea7c94ee538a40dc746dd72c50e7c986f97
# To regenerate: alef generate
# To verify freshness: alef verify --exit-code
defmodule LiterLlm.ResponseObject do
@moduledoc "Response from a structured response request."
@typedoc "Response from a structured response request."
@type t :: %__MODULE__{
id: String.t() | nil,
object: String.t() | nil,
created_at: non_neg_integer(),
model: String.t() | nil,
status: String.t() | nil,
output: [map()],
usage: map() | nil,
error: String.t() | nil
}
defstruct id: nil,
object: nil,
created_at: 0,
model: nil,
status: nil,
output: [],
usage: nil,
error: 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