Jidoka.Handoff (Jidoka v0.8.0-beta.1)

Copy Markdown View Source

Data contract for conversation ownership transfer.

A handoff is different from a subagent call. Subagents delegate one bounded task inside the current turn. Handoffs record that future turns for a conversation should be owned by another agent until the owner is reset.

Summary

Functions

Normalizes an existing handoff, keyword list, or map into a handoff struct.

Builds a validated handoff, generating an ID when one is not supplied.

Builds a handoff or raises when validation fails.

Returns the Zoi schema for a handoff request.

Types

t()

@type t() :: %Jidoka.Handoff{
  context: map(),
  conversation_id: nil | nil | binary(),
  from_agent: nil | nil | any(),
  id: binary(),
  message: binary(),
  metadata: map(),
  name: binary(),
  reason: nil | nil | binary(),
  request_id: nil | nil | binary(),
  summary: nil | nil | binary(),
  to_agent: atom(),
  to_agent_id: binary()
}

Functions

from_input(input, opts \\ [])

@spec from_input(
  t() | keyword() | map(),
  keyword()
) :: {:ok, t()} | {:error, term()}

Normalizes an existing handoff, keyword list, or map into a handoff struct.

new(attrs, opts \\ [])

@spec new(
  keyword() | map(),
  keyword()
) :: {:ok, t()} | {:error, term()}

Builds a validated handoff, generating an ID when one is not supplied.

new!(attrs, opts \\ [])

@spec new!(
  keyword() | map(),
  keyword()
) :: t()

Builds a handoff or raises when validation fails.

schema()

@spec schema() :: Zoi.schema()

Returns the Zoi schema for a handoff request.