# 属性

Canonical URL: https://developers.iagenify.com/zh/sdk/ref/local-agent/properties/
Language: zh

物体携带什么, 以及其中哪一个是活在运行中。

Status: live while running · id before the first run · toolNames is what was selected

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `id` | string|null |  | 会话标识符, 设定在 `memory` 开着 `null` 否则。 |
| `model` | string |  | 代理商的模型。 对于哪个模型起到转弯作用, 请读 `turn` 活动。 |
| `mode` | string |  | 生效模式。 更改为 `setMode()`. |
| `title` | string |  | 取自会议的第一个信息。 |
| `usage` | object |  | `{ credits, turns, toolCalls }` - 每次运行开始时重置,包括分剂。 |
| `context` | object |  | `{ tokens, limit, window, cachedTokens, cleared, parts }`. |
| `todos` | array |  | 目前的计划。 |
| `toolNames` | string[] |  | 给该代理器提供了工具, 包括自定义工具 。 |
| `library` | object |  | `{ skills, subagents }` - 上次装子弹的是什么? |
| `libraryStatus` | object |  | 为什么图书馆是空的? |
| `mcpServers` | array |  | 此运行可能使用的连接服务器 。 |
| `machine · files · shell` | object |  | 给它的东西 |

## 运行时的哪些变化 {#live}

```javascript
const running = agent.run({ message: "…" });

const timer = setInterval(() => {
  console.log(agent.usage.credits, "credits ·", agent.context.tokens, "tokens");
}, 1000);

await running;
clearInterval(timer);
```

`usage`, `context`, `todos` 和 `library` 事件是更好的渠道——在变化时,它们携带的数字相同——但投票工作。

## 使用量为每运行一次 {#usage-resets}

> **每次运行开始时都重置它**
>
> 这不是代理对象的运行总计。 如果您需要全部对话费用, 请自己保持数字的运行 。

## 外 野 域 , 按字段分列 {#context-shape}

| 字段 | 是 |
| --- | --- |
| `tokens` | 上转弯的大小, 正如供应商测量的 |
| `limit` | 生效的限制 |
| `window` | 模型的窗口是自己的,或者 `null` 如果目录无法读取 |
| `cachedTokens` | 提供商从缓存中得到了什么服务 |
| `cleared` | 有多少工具结果被清空 |
| `parts` | `{ system, tools, memory, messages }` |

## 工具Name 指选择了什么,而不是声明了什么 {#toolnames}

一种无法运行于机器的工具 `bash` 手机上没有贝壳, `skill` 和 `task` 只有在图书馆有内容时才出现, 所以在第一次运行之前它们不在列表中 。

- [事件](/zh/sdk/agent/events): 同样的数字,推。
- [上下文](/zh/sdk/agent/context): 部分意味着什么?
- [当地代理](/zh/sdk/ref/local-agent): 每一财产和方法。

```python
import threading

done = threading.Event()

def watch():
    while not done.wait(1):
        print(agent.usage["credits"], "credits ·", agent.context["tokens"], "tokens")

threading.Thread(target=watch, daemon=True).start()
agent.run(message="…")
done.set()
```
