View Source
ExOpenAi.Chat
(ex_open_ai v0.1.2)
Represents a chat request to the OpenAI API.
iex> params = %{
...> model: "text-model",
...> messages: [
...> %{content: "hello"}
...> ]
...> }
iex> ExOpenAi.Chat.create(params)
{:ok, %ExOpenAi.Chat{...}}
iex> ExOpenAi.Chat.create(%{})
{:error, %{}}
@spec do_new(
%ExOpenAi.Chat{
choices: term(),
created: term(),
id: term(),
object: term(),
usage: term()
},
attributes :: list()
) :: %ExOpenAi.Chat{
choices: term(),
created: term(),
id: term(),
object: term(),
usage: term()
}
@spec new() :: %ExOpenAi.Chat{
choices: term(),
created: term(),
id: term(),
object: term(),
usage: term()
}
@spec new(attributes :: list()) :: %ExOpenAi.Chat{
choices: term(),
created: term(),
id: term(),
object: term(),
usage: term()
}