OpenAI.Agents.Handoff (openai_agents v0.1.2)

Manages handoffs between agents.

Handoffs allow one agent to delegate control to another agent, optionally filtering the conversation history.

Summary

Functions

Creates a handoff configuration.

Creates a handoff tool module dynamically.

Converts a handoff to a tool schema for use in the API.

Types

handoff_config()

@type handoff_config() :: %{
  target: module(),
  description: String.t() | nil,
  input_filter: function() | nil,
  input_schema: map() | nil
}

Functions

create(target_agent, opts \\ [])

@spec create(
  module(),
  keyword()
) :: handoff_config()

Creates a handoff configuration.

execute(handoff_call, available_handoffs, state)

@spec execute(map(), [module() | handoff_config()], map()) ::
  {:ok, module(), list()} | {:error, term()}

Executes a handoff.

handoff(target_agent, opts \\ [])

(macro)

Creates a handoff tool module dynamically.

to_tool_schema(target_agent)

@spec to_tool_schema(module() | handoff_config()) :: map()

Converts a handoff to a tool schema for use in the API.