NeboAI
NeboAI
开始使用

agent.json 参考

agent.json 包含员工所有非文字描述的内容:它所需的能力、它要问所有者的问题、它的记忆如何保存、哪些操作始终需要审批,以及它运行的工作流。每个字段都是可选的。

示例

{
  "requires": {
    "interfaces": ["ledger", "mail"],
    "plugins": [],
    "tools": []
  },
  "skills": ["@example/skills/receipt-capture"],
  "inputs": [
    {
      "key": "invoice_mailbox",
      "label": "Mailbox that receives vendor invoices",
      "type": "text",
      "id": "finance.ap.invoice_mailbox",
      "scope": "company",
      "required": true,
      "missing": "Ask the owner which mailbox to watch before processing invoices."
    }
  ],
  "memory": {
    "mode": "separate",
    "topics": [
      { "slug": "vendor", "description": "A supplier: terms, usual amounts, contacts, open disputes" }
    ]
  },
  "subscribes": ["finance.ap.*"],
  "ceiling": { "ledger.bill.create": "approval" },
  "workflows": {
    "invoice-intake": {
      "trigger": { "type": "watch", "plugin": "mail", "event": "email.new" },
      "activities": [
        { "id": "record", "intent": "If the message in _watch_payload is a vendor invoice, record it as a bill." }
      ]
    }
  }
}

字段

字段类型含义
requires.interfaces字符串列表岗位所需的能力,例如 mail 或 ledger。在聘用时授予;每项需要审批的操作仍然是一个审批项。参见“能力与审批”。
requires.plugins字符串列表随员工一起安装的插件。只有当这个岗位确实依赖某一个插件时才使用;优先使用能力。
requires.tools字符串列表从第一轮起就加载到员工会话中的工具。这永远不会绕过审批。
skills字符串列表要安装并使用的市场技能:@org/skills/name,可选加上 @version,或者一个 SKIL- 代码。员工包自己 skills/ 文件夹中的技能无需填写。
inputslist所有者在聘用时回答的问题。参见“输入”。
memoryobject对话和记忆的保存方式。参见“人设与记忆”。
subscribes字符串列表员工在发生变化时会重新读取的公司事实领域,例如 finance.ar.*。
ceilingmap操作到 "approval" 的映射。对这位员工而言,该操作始终要征得所有者同意。不接受其他任何值。
workflowsmap工作流名称到工作流的映射。参见“工作流”。
toolslist由应用 sidecar 提供的 HTTP 工具。参见“Sidecar 工具”。
scopesmap由 tools、skills 和 plugins 组成的具名分组。某个范围启用时,会向员工描述该范围的 plugins。

输入

输入项是所有者在雇用时需要回答的问题。答案会在“Configured Inputs”下显示给员工,并填入监听触发器和文件夹触发器中的 {{key}} 占位符。

{
  "key": "close_day",
  "label": "Business day to finish the close",
  "type": "select",
  "options": [
    { "value": "3", "label": "Third business day" },
    { "value": "5", "label": "Fifth business day" }
  ],
  "default": "5",
  "scope": "company",
  "id": "finance.close.day"
}
字段默认值含义
key必需在占位符中使用的名称。也接受 name 作为后备。
label取自 key向所有者显示的问题。
typetexttext、textarea、number、select、checkbox 或 radio。
requiredfalse标记为所有者必须回答的问题。
default无预填答案。金额问题不允许设置。
placeholder, description无帮助文本。
options无用于 select 和 radio:{value, label} 对象或普通字符串。
id无事实的稳定、带点号的名称,例如 finance.ap.invoice_mailbox,以便其他员工共享。
scopecompanycompany:公司共享的事实。seat:仅限这次聘用。
missing无问题尚未回答时员工会怎么做。
moneyfalse标记为金额。金额问题不能有默认值。

Sidecar 工具

带有 sidecar 的应用会把 HTTP 端点作为工具提供给它的员工。Nebo 会把每一项注册为 app__<app>__<name>,并按照 method 和 path 将调用发送到 sidecar。参见应用 Sidecar。

"tools": [
  {
    "name": "list_entries",
    "description": "List journal entries for a date range.",
    "method": "GET",
    "path": "/entries",
    "input_schema": { "type": "object", "properties": { "from": { "type": "string" } } }
  }
]

工作流

workflows 下的每个键代表一个工作流;名称就是它的标识符。完整格式请参见工作流、触发器和活动。