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 工具」。
scopesmaptools、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 底下的每個鍵都代表一個工作流程;名稱就是它的識別碼。完整格式請參閱工作流程、觸發條件與活動。