Files
MAF1/Plugins/file-city
admin777 950d09ddb0 docs: 为 CLI、网页编排器和插件协议补充学习向注释
在核心类型、图执行器、stdio 插件和前端入口写清职责与对照路径,不改运行行为。
2026-08-28 11:51:48 +08:00
..
2026-08-26 18:06:02 +08:00
2026-08-26 18:06:02 +08:00
2026-08-26 18:06:02 +08:00

FileCity 插件

独立进程。宿主只读取本目录的 plugin.json,按 launch 原样启动,不会替你拼命令。

输入 / 输出

字段名必须和 plugin.json 以及 Program.cs 里读写的 JSON 键一致。

  • 输入 filePath
  • 输出 hasValidCitiescitiesreasonraw

凭据

不要把 API Key 写进 plugin.json 或流程图。本插件声明需要 openai-compatible 凭据。运行时宿主会:

  1. 把选中的凭据写入本进程环境变量 OPENAI_ENDPOINT / OPENAI_API_KEY / OPENAI_CHAT_MODEL
  2. 通过 stdin JSON 的 credentials.llm 再传一份

可选:在本目录放 .env 作为插件自己的默认环境(适合第三方自带模型)。节点上选中的宿主凭据会覆盖 .env 里的同名变量。

协议

stdin

{
  "inputs": { "filePath": "Data/cities.txt" },
  "credentials": {
    "llm": { "id": "llm-default", "type": "openai-compatible", "endpoint": "...", "apiKey": "...", "model": "..." }
  }
}

stdout:单个 JSON 对象,字段等于 outputs。日志请写 stderr。