智能体引擎

概览

真正的代理循环, 运行在您的进程内。 服务器服务于一件事, 即一个模式转弯, 每个工具都执行您的代码所在的位置 。

runtime: "local"36 toolsthe loop is yours
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

api.agents.create({ runtime: "local" }) 创建一个物体,当您调用 run(),询问模型要做什么,操作工具本身,反馈结果,重复到模型停止询问。循环就是产品。

由这里运行的

因为环环是本地的你得到
工具在您的进程中执行代理读取磁盘, 没有任何上传的东西可以查看 。
权限是回调代码决定, 依电话, 并同时有争论。
信贷在计时时计时预算可以在下次呼叫前停止运行,而不是在法案之后。
历史是你的你可以读读,剪切,总结,或者扔掉
只有转弯是遥远的服务器唯一要做的就是做它唯一要做的

最小的代理 工作

import { IaGenify } from "iagenify";

const api = new IaGenify({ apiKey: process.env.IAGENIFY_API_KEY });
const pc = await api.storage.get();

const agent = api.agents.create({
  runtime: "local",
  machine: pc,
  model: "gemini-3.5-flash",
  mode: "ask",
  onPermission: async ({ tool, category, args }) => {
    console.log("asking for", tool, category, args);
    return "once";                       // "once" | "always" | "deny"
  },
});

const result = await agent.run({
  inputs: "Read every markdown file in Notes and tell me what is unfinished.",
  onEvent: (event) => {
    if (event.type === "text") process.stdout.write(event.text);
  },
});

console.log(result.stopReason, result.usage);
import os, sys
from iagenify import IaGenify

api = IaGenify(api_key=os.environ["IAGENIFY_API_KEY"])
pc = api.storage.get()

def on_permission(request):
    print("asking for", request["tool"], request["category"], request["args"])
    return "once"                         # "once" | "always" | "deny"

agent = api.agents.create(
    runtime="local",
    machine=pc,
    model="gemini-3.5-flash",
    mode="ask",
    on_permission=on_permission,
)

def on_event(event):
    if event["type"] == "text":
        sys.stdout.write(event["text"])

result = agent.run(
    inputs="Read every markdown file in Notes and tell me what is unfinished.",
    on_event=on_event,
)

print(result["stopReason"], result["usage"])

每一件、每一件都有文件记载

片片片决定决定决定决定决定决定,Page
machine工具运行的地方——一台计算机、一部电话、一台云层工作空间。选项 · 机器
mode允许的,没有问。模式
onPermission问出什么事情会怎么样权限权限
tools模型35中,谁知道。代理工具
budget · maxSteps当循环停止时Budget
memory对话是否在过程中得以持续。届会届会届会届会届会
onEvent有效的时候你所看到的事件事件事件事件

还有一个老旧的代理商

无 runtime, create() 构建 服务器侧边代理服务器:平台上的循环运行,工具是平台的工具,而您的代码则得到步骤。这是 工作流程步骤 使用,因为工作流程没有你运行的过程。

具有进程时优先使用本地引擎

它拥有更大的工具组, 许可回召、 检查站、 技能和子试剂。 服务器侧面存在, 用于您没有运行的 。

多少运行成本

以每步一个模式转一个, 开帐单像任何转一个模式, 再加上任何付费工具花费——搜索、页面捕捉、生成图像。 usage 与总和和 turn 时,该事件带有运行中的计数。

result.usage;    // { credits: 31, turns: 6, toolCalls: 9 }
result["usage"]   # {"credits": 31, "turns": 6, "toolCalls": 9}