Current section
Files
Jump to
Current section
Files
lib/ex_bifrost/model/chat_message.ex
# NOTE: This file is auto generated by OpenAPI Generator 7.23.0 (https://openapi-generator.tech)
# using the Elixir SDK Generator template (https://github.com/houllette/elixir-sdk-generator).
# Do not edit this file manually — edit the templates and regenerate instead.
defmodule ExBifrost.Model.ChatMessage do
@moduledoc """
ChatMessage model.
"""
@derive JSON.Encoder
defstruct [
:role,
:name,
:content,
:tool_call_id,
:refusal,
:audio,
:reasoning,
:reasoning_details,
:annotations,
:tool_calls
]
@type t :: %__MODULE__{
:role => String.t(),
:name => String.t() | nil,
:content => ExBifrost.Model.ChatMessageContent.t() | nil,
:tool_call_id => String.t() | nil,
:refusal => String.t() | nil,
:audio => ExBifrost.Model.CreateChatCompletion200ResponseChoicesInnerDeltaAudio.t() | nil,
:reasoning => String.t() | nil,
:reasoning_details =>
[ExBifrost.Model.CreateChatCompletion200ResponseChoicesInnerDeltaReasoningDetailsInner.t()] | nil,
:annotations => [ExBifrost.Model.ChatMessageAnnotationsInner.t()] | nil,
:tool_calls => [ExBifrost.Model.CreateChatCompletion200ResponseChoicesInnerDeltaToolCallsInner.t()] | nil
}
alias ExBifrost.Deserializer
def decode(value) do
value
|> Deserializer.deserialize(:content, :struct, ExBifrost.Model.ChatMessageContent)
|> Deserializer.deserialize(:audio, :struct, ExBifrost.Model.CreateChatCompletion200ResponseChoicesInnerDeltaAudio)
|> Deserializer.deserialize(
:reasoning_details,
:list,
ExBifrost.Model.CreateChatCompletion200ResponseChoicesInnerDeltaReasoningDetailsInner
)
|> Deserializer.deserialize(:annotations, :list, ExBifrost.Model.ChatMessageAnnotationsInner)
|> Deserializer.deserialize(
:tool_calls,
:list,
ExBifrost.Model.CreateChatCompletion200ResponseChoicesInnerDeltaToolCallsInner
)
end
end