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

# उदाहरण

> Tools, approvals, streaming और सीमित runs के लिए Go patterns अपनाएँ।

## अनुमोदन के साथ डिप्लॉयमेंट

```go theme={null}
deploy := phaseoagent.Tool{
  ID: "deploy",
  Description: "Deploy the selected release",
  RequireApproval: true,
  Execute: func(input any, runtime phaseoagent.RuntimeContext) (any, error) {
    return deploymentService.Deploy(runtime.Context, input)
  },
}
```

Agent चलाएँ और status `waiting_for_human` होने पर लौटाया गया record सहेजें। Pending tool-call ID से जुड़े निर्णय के साथ इसे जारी रखें।

## टर्मिनल में स्ट्रीम करें

```go theme={null}
stream := agent.Stream(ctx, phaseoagent.RunOptions{Input: prompt, Client: client})
for delta := range stream.Text() { fmt.Print(delta) }
result, err := stream.Result()
```

## स्वायत्त रिसर्च सीमित करें

`StepCountIs`, `MaxTokensUsed`, `MaxCost` और `MaxDuration` मिलाएँ, ताकि लंबे समय तक चलने वाला agent उपयोगी काम मिलता रहने पर भी product budget से आगे न जाए।

पूरे contracts के लिए [टूल](./agent-sdk-tools.mdx), [स्थिति और अनुमोदन](./agent-sdk-state-and-approval.mdx) और [रोकने की शर्तें](./agent-sdk-stop-conditions.mdx) देखें।


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.