返回资讯中心
外部精选
软件工程
#开发者实时流

Pinecall 发布基于 LiveKit 的开源语音应用框架

来源标题:Pinecall – Open-source framework for voice apps, built on LiveKit

Pinecall 是一个基于 LiveKit 构建的开源语音 AI 框架,提供电话线路、语音输入输出、轮次管理、记忆、检索等完整能力。开发者可通过表单、TypeScript/Python/Ruby 代码、CLI 或 MCP 构建语音智能体,并部署到电话号码、网页或 WhatsApp。所有智能体运行在同一运行时上,支持上线前测试和通话记录查看,也可使用 Pinecall Cloud。

Hacker News 最新bernatch2026/11/17 · 今天28 分钟阅读

以下正文由 AI 翻译自 Hacker News 最新(原文版权归原站所有),可能存在偏差,重要内容请以原文为准。

打开控制台 · 快速开始 · 文档 · Studio · CLI · MCP · 自托管

Pinecall 是面向语音 AI 的开源工具集。你可以在表单里搭建语音智能体,用代码编写语音应用,或者让你的编程助手来完成。把它接入一个电话号码、一个网页或 WhatsApp,在上线前进行测试,并查看它接听的每一通电话。Pinecall 负责电话线路、语音输入输出、轮流对话、记忆、检索、挂断时的评判、控制台以及账单。这个仓库包含了全部内容,你可以在自己的机器上运行,也可以使用 Pinecall Cloud。

你的工作方式 / 最适合的场景 Agent Studio / 控制台:一个表单加一个实时聊天 / 智能体由指令、少量 API 调用和一些待收集的数据构成 语音应用 / 你的编辑器,使用 TypeScript、Python 或 Ruby / 它有自己的逻辑:阶段、状态、你代码中的工具 CLI / 终端或 CI 任务 / 你希望脚本化:测试、部署、号码、设置 MCP / Claude Code、Codex、Cursor 等 / 你更愿意说出你想要什么,然后看着它被构建出来

它们不是彼此独立的产品。每一个智能体,无论以何种方式创建,都运行在同一个 runtime 上,接听同样的电话,以同样的方式被测试,并出现在同一个控制台中。Studio 智能体在表单不够用时可以随时离开表单:pinecall studio code 会把它转换成一个 TypeScript 项目。

打开沙盒的 Agents,点击 New,一分钟后就你就能和你的智能体对话了。无需安装任何东西,也无需托管任何东西。

每次保存都是一个带编号的发布版本。沙盒是你构建的地方;Deploy 会把某个发布版本复制到生产环境,你的来电者在那里可以访问到它。同一个智能体也可以从终端驱动:

$ pinecall studio new front-desk $ pinecall studio pull front-desk # 定义,作为可审阅的文件 $ pinecall studio push front-desk --note "books the visit" $ pinecall chat front-desk # 无需启动:Pinecall 负责托管 $ pinecall studio deploy front-desk

Studio,逐字段说明

语音应用是你仓库中的代码:一个 app.ts,说明哪个号码由谁接听,以及每个智能体一个类。@agent({ … }) 说明智能体是什么;类的字段是通话的状态,它的 @tool 方法是模型可以执行的操作,它的 docstrings 和 render() 就是提示词。

// agents/front-desk/agent.tsx import { Agent, agent, tool, type Call } from "@pinecall/agents"; /**

  • You are the front desk of Brightside Dental. You book, move and explain visits.
  • Short sentences. Offer at most two times. Never say a time the agenda did not give you. / stt: "deepgram/flux-general-en", // 它用什么听、想和说 llm: "google/gemini-3.5-flash-lite", voice: "cartesia/f786b574-daa5-4673-aa0c-cbe3e8534c02", // Katie takes: "booking, moving or asking about a visit", // 队友可以转交给它的内容 judges: ["consent", "grounded", offersARealTime], // 谁阅读每一通电话:Pinecall 的,以及它自己的 personas: [hurried, chargedTwice], // 给它打电话的测试来电者 }) export default class FrontDesk extends Agent { slots: Slot[] = []; // 状态:普通字段,按通话保存 override onCall(call: Call) { this.call.shared["patient"] = clinic.patientByPhone(call.contact); /* The open times of one day. day is YYYY-MM-DD. / freeSlots(day: string) { return (this.slots = clinic.free(day)); /* Book one of the times freeSlots returned, once the caller said yes to it. */ book(day: string, time: string, name: string) { const visit = clinic.book(day, time, name); this.log("visit.booked", { ...visit, phone: this.call.contact }); // 应用会收到它,见下文 return visit; override render() { // 提示词的最后一块,是状态的函数 if (this.slots.length === 0) return null; return <p>Offer only these times: {this.slots.map((slot) => slot.time).join(", ")}.</p>; // app.ts import { flow, voiceApp } from "@pinecall/agents"; const app = voiceApp("brightside", { timezone: "America/Los_Angeles" }); // 一个号码,背后一个团队:前台接听,通话可以转交给账单部门。 app.line("+1 415 555 0134", { greeting: "Brightside Dental. How can I help?", answers: FrontDesk, team: [Billing] }); app.rule("Never say an amount of money that a tool did not give you."); // flow 的生命周期长于发起它的通话:在就诊前一天,智能体会致电患者。 const remindVisit = flow("remind-visit", async (booked, step) => { const visit = booked as unknown as Visit & { phone: string }; await step.sleepUntil(startsAt(visit), { before: "24h" }); await step.call(visit.phone, FrontDesk, { instruction: Remind ${visit.patient} of the visit. }); }); app.on("visit.booked", remindVisit); export default app;

Python 中的智能体

from typing import Literal from pinecall import Agent, tool class FrontDesk(Agent): """You answer the phone for the business as its automated assistant, and your first sentence says so. Short sentences: everything you say is read aloud. stage: Literal["ask", "done"] = "ask" message: dict[str, str] | None = None def take_message(self, name: str, about: str) -> dict[str, str]: """Writes down the caller's message, once they have said their name and what it is about.""" self.message = {"name": name, "about": about} self.stage = "done" return self.message

Ruby 中的智能体

require "pinecall"

You answer the phone for the business as its automated assistant, and your first sentence says so.

Short sentences: everything you say is read aloud.

class FrontDesk < Pinecall::Agent stage :ask, :done state :message

Writes down the caller's message, once they have said their name and what it is about.

tool stage: :ask, pii: %i[name] def take_message(name:, about:) self.message = { name:, about: } self.stage = :done message end end

智能体运行所依赖的内容——它的声音、模型、问候语、它检索的文档——随类一起声明,而以代码编写的应用由其代码设定:控制台以只读方式展示它。在 Studio 中构建的智能体没有代码,在那里,同样的设置按环境在控制台中调整,并进行版本管理。

(原文较长,此处译出前 6000 字,完整内容请点「打开原文」。)

正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。

打开原文
去社区讨论 →