Files
MAF1/Plugins/file-city/README.md
T

35 lines
1.1 KiB
Markdown
Raw Normal View History

2026-08-26 18:06:02 +08:00
# FileCity 插件
独立进程。宿主只读取本目录的 `plugin.json`,按 `launch` 原样启动,不会替你拼命令。
## 输入 / 输出
字段名必须和 `plugin.json` 以及 `Program.cs` 里读写的 JSON 键一致。
- 输入 `filePath`
- 输出 `hasValidCities``cities``reason``raw`
## 凭据
不要把 API Key 写进 `plugin.json` 或流程图。本插件声明需要 `openai-compatible` 凭据。运行时宿主会:
1. 把选中的凭据写入本进程环境变量 `OPENAI_ENDPOINT` / `OPENAI_API_KEY` / `OPENAI_CHAT_MODEL`
2. 通过 stdin JSON 的 `credentials.llm` 再传一份
可选:在本目录放 `.env` 作为插件自己的默认环境(适合第三方自带模型)。节点上选中的宿主凭据会覆盖 `.env` 里的同名变量。
## 协议
stdin
```json
{
"inputs": { "filePath": "Data/cities.txt" },
"credentials": {
"llm": { "id": "llm-default", "type": "openai-compatible", "endpoint": "...", "apiKey": "...", "model": "..." }
}
}
```
stdout:单个 JSON 对象,字段等于 outputs。日志请写 stderr。