View Source GptAgent (gpt_agent v1.0.0)

Provides a GPT conversation agent

Summary

Types

@type t() :: %GptAgent{
  assistant_id: binary(),
  callback_handler: pid(),
  pid: pid(),
  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

Link to this function

add_user_message(pid, message)

View Source

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

handle_continue(atom, state)

View Source

Callback implementation for GenServer.handle_continue/2.

@spec init(map()) :: {:ok, t(), {:continue, :create_thread}}

Initializes the GPT Agent

Link to this function

start_link(callback_handler, assistant_id, thread_id \\ nil)

View Source
@spec start_link(pid(), binary(), binary() | nil) ::
  {:ok, pid()} | {:error, reason :: term()}

Starts the GPT Agent

Link to this function

submit_tool_output(pid, tool_call_id, tool_output)

View Source