# تنفيذ

Canonical URL: https://developers.iagenify.com/ar/sdk/agent/events/done/
Language: ar

`{ type: "done", text, todos, usage, stopReason, model }`

انتهى الـ تنفيذ الإيطالية الإيطالية الإيطالية تنفيذي أداء هو نفس كائن إلى نداء إلى نداء إلى نداء ليس إلى.

Status: last event · same as the return · children's done is dropped

## الحقول {#fields}

```javascript
{
  type: "done",
  text: "I read the four notes. Two are unfinished: …",
  todos: [{ content: "Check the figures", status: "completed" }],
  usage: { credits: 31, turns: 6, toolCalls: 9 },
  stopReason: "end_turn",
  model: "gemini-3.5-flash"
}
```

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `text` | string |  | النص الأخير الذي كتبه النموذج. ليس بالضرورة جواباً - انظر: `stopReason`. |
| `todos` | array |  | الخطة كما تنتهي |
| `usage` | object |  | `{ credits, turns, toolCalls }` -الركض بأكمله، بما في ذلك العناصر الفرعية |
| `stopReason` | string |  | `end_turn` · `stopped` · `max_steps` · `budget`. |
| `model` | string |  | نموذج الوكيل. لأي نموذج يخدم دور معطى، اقرأ [دور](/ar/sdk/agent/events/turn) أحداث أحداث أحداث أحداث |

## اقر اقر & توقف أثناء قبل استخدام النص {#reason}

> **max_steps تقرير غير مُنجز**
>
> ينتهي التنفيذ حيث كان، لذلك النص هو ما كتب النموذج في الماضي - ربما في منتصف الخطة. end_turn "وكانت قد أنهت قول ما كان عليها قوله"

## "الوكيل تحتي" "لم يصل إليك أبداً" {#children}

يُسقط عندما يُعرض الحدث على الحدث الطفل -- الطفل الذي يُكمل ليس هو الركض، وواجهة الاستماع لـ `done` أرقامه تصل بدلاً من `task` (المنافِعَة) `tool_end`.

## الشكلان {#both}

```javascript
const result = await agent.run({
  inputs: "…",
  onEvent: (e) => { if (e.type === "done") render(e); },   // for the interface
});

console.log(result.stopReason);                            // the same object
```

## عدد مرات كل شيء {#usage}

دوران ، أدوات مدفوعة الأجر ، ملخصات conclidion ، وكل شيء كل عامل فرعي فعل -- نفس المجموع الذي تم فحص الميزانية مقابله.

- [حلقة التنفيذ](/ar/sdk/agent/loop): حيث في خطوة كل واحد ينبعث.
- [الميزانية](/ar/sdk/agent/budget): ويقاس استخدام السقف مقابل ذلك.

```python
{
    "type": "done",
    "todos": [{"content": "Check the figures", "status": "completed"}],
    "usage": {"credits": 31, "turns": 6, "toolCalls": 9},
    "stopReason": "end_turn",
}
```

```python
result = agent.run(
    inputs="…",
    on_event=lambda e: render(e) if e["type"] == "done" else None,   # for the interface
)

print(result["stopReason"])   # the same stop reason, with text and model added
```
