# `Jidoka.Handoff`
[🔗](https://github.com/agentjido/jidoka/blob/v0.9.0/lib/jidoka/handoff.ex#L1)

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.

# `t`

```elixir
@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()
}
```

# `from_input`

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

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

# `new`

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

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

# `new!`

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

Builds a handoff or raises when validation fails.

# `schema`

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

Returns the Zoi schema for a handoff request.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
