OpenAI.Chat (openai_client v0.5.3)
Given a chat conversation, the model will return a chat completion response.
Link to this section Summary
Functions
Creates a completion for the chat message
Link to this section Types
Link to this type
create_completion_params()
@type create_completion_params() :: %{ :model => String.t(), :messages => [message()], optional(:temperature) => float(), optional(:top_p) => float(), optional(:n) => integer(), optional(:stream) => boolean(), optional(:stop) => String.t() | [String.t()], optional(:max_tokens) => integer(), optional(:presence_penalty) => float(), optional(:frequency_penalty) => float(), optional(:logit_bias) => %{required(String.t()) => float()}, optional(:response_format) => response_format(), optional(:tools) => [tool()], optional(:tool_choice) => String.t() | tool_choice(), optional(:user) => String.t() }
Link to this type
message()
Link to this type
response_format()
Link to this type
tool()
@type tool() :: %{type: String.t(), function: tool_function()}
Link to this type
tool_choice()
@type tool_choice() :: %{type: String.t(), function: tool_function()}
Link to this type
tool_choice_function()
@type tool_choice_function() :: %{name: String.t()}
Link to this type
tool_function()
Link to this section Functions
Link to this function
create_completion(client, params, opts \\ [])
@spec create_completion(OpenAI.Client.t(), create_completion_params(), Keyword.t()) :: OpenAI.Client.result()
Creates a completion for the chat message