Current section

Files

Jump to
liter_llm lib liter_llm chat_completion_response.ex
Raw

lib/liter_llm/chat_completion_response.ex

# This file is auto-generated by alef — DO NOT EDIT.
# alef:hash:555d86a2b79044bb43c8b67cdd151ba758c673e6ff9df68807c63f31e69f8ba7
# To regenerate: alef generate
# To verify freshness: alef verify --exit-code
# Issues & docs: https://github.com/kreuzberg-dev/alef
defmodule LiterLlm.ChatCompletionResponse do
@moduledoc "Chat completion response from the API."
@typedoc "Chat completion response from the API."
@type t :: %__MODULE__{
id: String.t() | nil,
object: String.t() | nil,
created: non_neg_integer(),
model: String.t() | nil,
choices: [map()],
usage: map() | nil,
system_fingerprint: String.t() | nil,
service_tier: String.t() | nil
}
defstruct id: nil,
object: nil,
created: 0,
model: nil,
choices: [],
usage: nil,
system_fingerprint: nil,
service_tier: 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