View Source GptAgent (gpt_agent v2.0.0)
Provides a GPT conversation agent
Summary
Functions
Adds a user message
Returns a specification to start this module under a supervisor.
Connects to the GPT Agent
Connects to the GPT Agent and sets the default assistant
Creates a new thread
Returns the default assistant
Sets the default assistant
Starts the GPT Agent
Submits tool output
Returns the thread ID
Types
@type t() :: %GptAgent{ default_assistant_id: binary() | nil, last_message_id: (binary() | nil) | nil, run_id: (binary() | nil) | nil, running?: boolean(), thread_id: (binary() | nil) | nil, tool_calls: [GptAgent.Events.ToolCallRequested.t()], tool_outputs: [GptAgent.Events.ToolCallOutputRecorded.t()] }
Functions
Adds a user message
Returns a specification to start this module under a supervisor.
See Supervisor
.
Connects to the GPT Agent
Connects to the GPT Agent and sets the default assistant
@spec create_thread() :: {:ok, binary()}
Creates a new thread
Returns the default assistant
Sets the default assistant
Starts the GPT Agent
@spec submit_tool_output(pid(), binary(), map()) :: {:ok, binary()} | {:error, :invalid_tool_call_id}
Submits tool output
Returns the thread ID