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

# Examples

> Copy focused Ruby patterns for tools, approvals, streaming, and bounded runs.

## Approval-gated deployment

```ruby theme={null}
deploy = PhaseoAgentSdk.define_tool(
  id: "deploy",
  description: "Deploy the selected release",
  require_approval: true,
  execute: ->(input, runtime) { deployments.deploy(input) }
)
```

Persist the returned run when it enters `waiting_for_human`, then continue it with a decision keyed by the pending call ID.

## Stream text

```ruby theme={null}
stream = agent.stream(input: prompt, client: client)
stream.text_stream.each { |delta| print delta }
result = stream.result
```

## Bound autonomous work

Combine step, token, cost, and duration conditions so an agent cannot exceed the application budget even when it keeps finding useful work.

See [tools](./agent-sdk-tools), [state and approval](./agent-sdk-state-and-approval), and [stop conditions](./agent-sdk-stop-conditions) for complete contracts.
