@fonoster/autopilot

中文文档
0.62.0发布于 2026/11/16MITTypeScriptCommonJS构建来源已验证近 30 天下载 7332

长老会平台之声AI

中文使用文档
文档目录6 节
  1. 安装
  2. 示例
  3. 语言模型提供者
  4. 增加知识库
  5. 添加工具
  6. 配置

自动驾驶

Autopilot Version Downloads/week License

自动驾驶模块提供了在长老会创建Voice AI应用程序的方法. 它利用了长老会内部的Voice API和"大语言模型"的力量来创造与召唤方的对话体验.

安装

自动驾驶是AppBridge拨打的普通会话应用. 运行 fonoster/autopilot 图像( 从 mods/autopilot/Dockerfile),或来自存储库:

$ cp config/autopilot-session.example.yaml config/autopilot-session.yaml
$ node mods/autopilot/dist/session/main.js --config config/autopilot-session.yaml

见 文件/自动驾驶员.md 用于发动机、速度和代理 计划.

示例

要发挥作用,Autopilot需要配置文件,OpenAI API密钥,以及活跃的长老会账户或自办长老会实例.

配置文件有两个主要部分: conversationSettings 财务报告和审定财务报表 languageModel编辑 conversationSettings 区域包含对话的设置,如第一个消息、系统模板和传输选项。 这个 languageModel 一节包含语言模型的设置,如提供者、模型和温度等.

{
  "conversationSettings": {
    "firstMessage": "Hello, this is Olivia from Dr. Green's Family Medicine. How can I assist you today?",
    "systemPrompt": "You are a Customer Service Representative. You are here to help the caller with their needs.",
    "systemErrorMessage": "I'm sorry, but I seem to be having trouble. Please try again later.",
    "initialDtmf": "6589",
    "transferOptions": {
      "phoneNumber": "+15555555555",
      "message": "Please hold while I transfer you to a live agent.",
      "timeout": 30000
    },
    "idleOptions": {
      "message": "Are you still there?",
      "timeout": 10000,
      "maxTimeoutCount": 3
    }
  },
  "languageModel": {
    "provider": "openai",
    "model": "gpt-4o-mini",
    "maxTokens": 250,
    "temperature": 0.7,
    "knowledgeBase": [],
    "tools": []
  }
}

要运行"自动驾驶",可以使用以下命令: 1

$ AGENT=$(pwd)/agents.json OPEN_API_KEY=your-key autopilot

你会看到这样的信息:

2024-09-06 11:32:16.584 [info]: (voice) started voice server @ 0.0.0.0, port=50061 {}

这意味着"自动驾驶"正在运行,准备接听电话.

由于您正在本地运行自动驾驶, 您必须让端口 50061 上互联网 。 为了暴露端口,你可以使用这样的服务 无

$ ngrok tcp 50061

在您的长老账户中配置 ngrok 提供的终点 。 你可以找到更多的信息 如何做到这一点 长老会议文件。 。 。 .

语言模型提供者

Autopilot支持多种语言模型提供者. 以下是所支持的提供者列表:

提供者说明支持的模型
开放AIOpenAI 为对话AI提供各种GPT模型gpt-4o, (中文(简体) ), gpt-4o-mini, (中文(简体) ), gpt-3.5-turbo, (中文(简体) ), gpt-4-turbo
格罗克Groq 提供了高性能的AI型号,优化了速度llama-3.1-8b-instant, (中文(简体) ), llama-3.3-70b-specdec
奥拉玛自办的Ollama模型llama3-groq-tool-use

我们正在不断更新支助提供者和模式清单。 如果你有你想要使用的具体模型 请告诉我们.

增加知识库

知识库向语文模式提供信息,如工作时间、服务或产品等.

目前,我们支持从一桶S3取回文件.

为了增加一个知识库,在表格中列入一个新的条目 knowledgeBase 配置文件中的数组。 以下是菜单PDF知识的例子.

{
  "conversationSettings": { ... },
  "languageModel": {
    "provider": "openai",
    "model": "gpt-4o-mini",
    "apiKey": "your-api-key",
    "maxTokens": 100,
    "temperature": 0.4,
    "knowledgeBase": [{
      "type": "s3",
      "title": "Menu PDF",
      "document": "sample.pdf"
    }],
    "tools": []
  }
}

添加工具

Autopilot中的一个工具是和外部服务互动以获取信息或执行动作的一种方式. 例如,您可以使用一个工具来获取天气,最新消息,或者一个短消息.

您可以通过在 tools 配置文件中的数组。 以下是获得特定日期可用任命时间的示例工具.

{
  "conversationSettings": { ... },
  "languageModel": {
    "provider": "openai",
    "model": "gpt-4o-mini",
    "apiKey": "your-api-key",
    "maxTokens": 100,
    "temperature": 0.4,
    "knowledgeBase": [],
    "tools": [
      {
        "name": "getAvailableTimes",
        "description": "Get available appointment times for a specific date.",
        "parameters": {
          "type": "object",
          "properties": {
            "date": {
              "type": "string",
              "format": "date"
            }
          },
          "required": [
            "date"
          ]
        },
        "operation": {
          "type": "get",
          "url": "https://api.example.com/appointment-times",
          "headers": {
            "x-api-key": "your-api-key"
          }
        }
      }
    ]
  }
}

计外 get 操作类型,您可以使用 post 操作类型。 这个 post 向工具发送数据时使用操作类型。 发送邮件时, 您可以选择设置 waitForResponse 假的,那会"火并忘记"的要求。 默认行为是等待回应.

如果您的工具需要呼叫器的号码或接收到的号码,可以使用保留变量 ingressNumber 财务报告和审定财务报表 callerNumber。类似地,您可以使用保留变量 callReceivedAt 以获取接到电话的日期和时间 ISO 8601 格式和样式 callDirection 变量来检查该调用是否来自 PSTN.

响应的预期格式是一个JSON对象,其结构如下:

{ "result": "text to pass to the language model" }

例如:

{ "result": "The available appointment times are 9:00 AM, 10:00 AM, and 11:00 AM." }

配置

自动驾驶读取 autopilot-session.yaml,通过 --config <path>,则 AUTOPILOT_SESSION_CONFIG 变量或 ./config/autopilot-session.yaml它命名了签名 秘密 AppBridge 用于 Autopilot apps, 应用程序和代理商来自哪里, 注册 编目,通过认证参考和知识设置的平台密钥. 见 config/autopilot-session.example.yaml 每一个键.

音频过滤器是应用程序配置的一部分(AppBridge运行它们),而不是代理设备.

版本与发布记录

@fonoster/autopilot 共发布 289 个版本,首次发布于 2024/03/17;过去 12 个月发布了 75 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.62.0latest2026/11/16今天
0.61.02026/11/15今天
0.60.02026/11/151 天前
0.59.02026/11/141 天前
0.58.02026/11/141 天前
0.57.02026/11/114 天前

其他发布通道:next → 0.9.51。

关于 @fonoster/autopilot 的常见问题

@fonoster/autopilot 是什么?

长老会平台之声AI

如何安装 @fonoster/autopilot?

在项目目录运行 npm install @fonoster/autopilot,或使用 pnpm add / yarn add / bun add。

@fonoster/autopilot 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@fonoster/autopilot 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@fonoster/autopilot 可以商用吗?

@fonoster/autopilot 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@fonoster/autopilot 的下载量有多少?

根据 npm 官方下载统计,@fonoster/autopilot 在 2026/10/15 – 2026/11/13 这 30 天内被下载 7,332 次,日均约 244 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@fonoster/autopilot 还在维护吗?

最新版本 0.62.0 发布于 2026/11/16(今天);至今共发布 289 个版本,其中过去 12 个月发布了 75 个;首次发布于 2024/03/17。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。