@fonoster/autopilot

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

Voice AI for the Fonoster platform

原始使用文档
文档目录6 节
  1. Installation
  2. Example
  3. Language Model Providers
  4. Adding Knowledge Base
  5. Adding Tools
  6. Configuration

autopilot

Autopilot Version Downloads/week License

The autopilot module provides a way to create Voice AI applications in Fonoster. It uses Fonoster internal Voice API and the power of Large Language Models to create a conversational experience with the calling party.

Installation

Autopilot is an ordinary session app that AppBridge dials. Run the fonoster/autopilot image (built from mods/autopilot/Dockerfile), or from the repository:

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

See docs/autopilot.md for the engine, pacing and the agent schema.

Example

To function, Autopilot needs a configuration file, an OpenAI API key, and an active Fonoster account or self-hosted Fonoster instance.

The configuration file has two major sections: conversationSettings and languageModel. The conversationSettings section contains the settings for the conversation, like the first message, the system template, and the transfer options. The languageModel section contains the settings for the language model, like the provider, the model, and the temperature, among others.

{
  "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": []
  }
}

To run the Autopilot, you can use the following command:

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

You will see a message like this:

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

This means that the Autopilot is running and ready to take calls.

Since you are running Autopilot locally, you must expose port 50061 to the Internet. To expose the port, you can use a service like ngrok

$ ngrok tcp 50061

Take the endpoint provided by ngrok and configure it in your Fonoster account. You can find more information about how to do this in the Fonoster documentation.

Language Model Providers

The Autopilot supports multiple language model providers. The following is a list of the supported providers:

ProviderDescriptionSupported models
OpenAIOpenAI provides various GPT models for conversational AIgpt-4o, gpt-4o-mini, gpt-3.5-turbo, gpt-4-turbo
GroqGroq offers high-performance AI models optimized for speedllama-3.1-8b-instant, llama-3.3-70b-specdec
OllamaSelf-hosted Ollama modelsllama3-groq-tool-use

We are constantly updating the list of supported providers and models. If you have a specific model you would like to use, please let us know.

Adding Knowledge Base

A knowledge base provides information to the language model, such as business hours, services, or products.

Currently, we support retrieving documents from an S3 bucket.

To add a knowledge base, include a new entry in the knowledgeBase array in the configuration file. Below is an example of a knowledge for a menu 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": []
  }
}

Adding Tools

A tool in Autopilot is a way to interact with external services to get information or perform actions. For example, you can use a tool to get the weather, the latest news, or an SMS.

You can configure a new tool by adding a new entry in the tools array in the configuration file. The following is an example tool that gets the available appointment times for a specific date.

{
  "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"
          }
        }
      }
    ]
  }
}

In addition to the get operation type, you can use the post operation type. The post operation type is used when sending data to the tool. When sending a post, you can optionally set waitForResponse to false, which will "fire and forget" the request. The default behavior is to wait for the response.

If your tool needs the number of the caller or the number that received the call, you can use the reserved variables ingressNumber and callerNumber. Similarly, you can use the reserved variable callReceivedAt to get the date and time when the call was received in ISO 8601 format and the callDirection variable to check if the call was originated from the PSTN.

The expected format for the response is a JSON object with the following structure:

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

For example:

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

Configuration

Autopilot reads autopilot-session.yaml, found via --config <path>, the AUTOPILOT_SESSION_CONFIG variable or ./config/autopilot-session.yaml. It names the signing secret AppBridge uses for Autopilot apps, where apps and agents come from, the registry catalog, platform keys by credential ref and the knowledge settings. See config/autopilot-session.example.yaml for every key.

Audio filters are part of the app's configuration (AppBridge runs them), not the agent's.

版本与发布记录

@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 是什么?

Voice AI for the Fonoster platform

如何安装 @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 和提交记录判断。