View Source GptAgent.Impl (gpt_agent v3.1.1)

Provides the implementation of the GptAgent public API

Summary

Functions

Adds a user message

Connects to the GPT Agent

Creates a new thread

Returns the default assistant

Sets the default assistant

Returns the thread ID

Functions

Link to this function

add_user_message(pid, message)

View Source
@spec add_user_message(pid(), binary()) :: :ok | {:error, :run_in_progress}

Adds a user message

@spec connect(GptAgent.connect_opts()) :: {:ok, pid()} | {:error, :invalid_thread_id}

Connects to the GPT Agent

Link to this function

connect(thread_id, assistant_id)

View Source
@spec create_thread() :: {:ok, binary()}

Creates a new thread

@spec default_assistant(pid()) :: binary()

Returns the default assistant

Link to this function

set_default_assistant(pid, assistant_id)

View Source
@spec set_default_assistant(pid(), binary()) :: :ok

Sets the default assistant

@spec shutdown(pid()) :: :ok
Link to this function

submit_tool_output(pid, tool_call_id, tool_output)

View Source
@spec submit_tool_output(pid(), binary(), map()) ::
  :ok | {:error, :invalid_tool_call_id}

Submits tool output

@spec thread_id(pid()) :: binary()

Returns the thread ID