> ## 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.

# From Outcome • AI Agent SDK

> from_outcome: Create HandoffResult from AgentRunOutcome.

# from\_outcome

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**HandoffResult**](../classes/HandoffResult) class in the [**handoff**](../modules/handoff) module.

Create HandoffResult from AgentRunOutcome.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def from_outcome(outcome: AgentRunOutcome, target_agent: Optional[str], source_agent: Optional[str], handoff_depth: int) -> 'HandoffResult'
```

## Parameters

<ParamField query="outcome" type="AgentRunOutcome" required={true}>
  No description available.
</ParamField>

<ParamField query="target_agent" type="Optional[str]" required={false}>
  No description available.
</ParamField>

<ParamField query="source_agent" type="Optional[str]" required={false}>
  No description available.
</ParamField>

<ParamField query="handoff_depth" type="int" required={false} default="0">
  No description available.
</ParamField>

### Returns

<ResponseField name="Returns" type="'HandoffResult'">
  The result of the operation.
</ResponseField>

## Uses

* `cls`
* `outcome.is_success`

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/agent/handoff.py#L277">
  `praisonaiagents/agent/handoff.py` at line 277
</Card>
