• 简体中文
  • v6.5.0
  • 快速开始

    最小可用的程序:从 ACL 文件创建一个 agent,在项目目录上打开会话,使用 send 运行一轮对话,打印回复文本,并查看运行时为该轮生成的验证摘要。

    Node.js
    Python
    TypeScript
    import { Agent } from '@a3s-lab/code';
    // Agent.create accepts an .acl file path or inline ACL string.
    const agent = await Agent.create('agent.acl');
    const session = agent.session('.');
    const result = await session.send('List the files in this directory.');
    console.log(result.text);
    // What the runtime checked while producing that turn.
    console.log(result.verificationSummaryText);
    session.close();

    在两个 SDK 中,Agent.create() 都接收 .acl 文件路径或内联 ACL 源文本。使用完毕后, 请务必调用 close() 关闭会话,以便运行时刷新状态并释放资源。

    下一步