> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Handoff Input Data • Rust AI Agent SDK

> HandoffInputData: Data passed to a handoff target agent.

# HandoffInputData

> Defined in the [**handoff**](../modules/handoff) module.

<Badge color="orange">Rust AI Agent SDK</Badge>

Data passed to a handoff target agent.

## Fields

| Name            | Type                           | Description                      |
| --------------- | ------------------------------ | -------------------------------- |
| `messages`      | `Vec&lt;serde_json::Value&gt;` | Messages to pass to target agent |
| `context`       | `HashMap&lt;String`            | Additional context data          |
| `serde_json`    | `:Value&gt;`                   | Additional context data          |
| `source_agent`  | `Option&lt;String&gt;`         | Name of the source agent         |
| `handoff_depth` | `usize`                        | Current handoff depth            |
| `handoff_chain` | `Vec&lt;String&gt;`            | Chain of agents in the handoff   |

## Methods

### `new`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn new() -> Self
```

Create new handoff input data

### `messages`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn messages(mut self, messages: Vec<serde_json::Value>) -> Self
```

Set messages

**Parameters:**

| Name       | Type                           |
| ---------- | ------------------------------ |
| `messages` | `Vec&lt;serde_json::Value&gt;` |

### `context`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn context(mut self, key: impl Into<String>, value: serde_json::Value) -> Self
```

Add context

**Parameters:**

| Name    | Type                      |
| ------- | ------------------------- |
| `key`   | `impl Into&lt;String&gt;` |
| `value` | `serde_json::Value`       |

### `source_agent`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn source_agent(mut self, agent: impl Into<String>) -> Self
```

Set source agent

**Parameters:**

| Name    | Type                      |
| ------- | ------------------------- |
| `agent` | `impl Into&lt;String&gt;` |

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/handoff/mod.rs#L248">
  `praisonai/src/handoff/mod.rs` at line 248
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Handoffs" icon="arrow-right-arrow-left" href="/docs/rust/handoffs" />

  <Card title="Rust A2A" icon="arrows-left-right" href="/docs/rust/a2a" />
</CardGroup>
