欢迎光临,我们是一家专注中小型企业营销推广服务的公司!

咨询热线:400 9868 577
淮南兰乔电子商务有限公司
新闻中心News
淮南兰乔电子商务有限公司

Cloudflare 推出实时语音 AI 平台:Realtime Agents

作者:碧海醫心 | 点击: | 来源:碧海醫心
0209
2025
Cloudflare宣布推出实时语音AI平台(CloudflareRealtimeAgents),正式进军低延迟对话式AI领域。该平台依托Cloudflare全球330多个节点的边缘网络,为开发者提供构建语音交...

cloudflare 宣布推出实时语音 ai 平台(cloudflare realtime agents),正式进军低延迟对话式 ai 领域。该平台依托 cloudflare 全球 330 多个节点的边缘网络,为开发者提供构建语音交互应用的完整解决方案。

新平台的核心组件包括 Realtime Agents(语音 AI 管道编排运行时)、WebRTC 音频传输支持、Workers AI 的 WebSocket 实时推理 以及 Deepgram 的语音识别/合成模型。通过这些功能,开发者可快速搭建自然流畅的语音代理应用。

下面的示例代码展示了如何创建一个继承自

RealtimeAgent
的 JavaScript 类,以进行以下操作:

  • 创建 WebRTC 会话

  • 管道编排(如:Deepgram STT → 自定义文本处理 Handler → ElevenLabs TTS)

  • 支持会议参与者加入/离开的事件处理
    这让开发者几乎不需管理底层基础设施,就可快速构建个性化语音代理应用。

export class MyAgent extends RealtimeAgent<Env> {
	constructor(ctx: DurableObjectState, env: Env) {
		super(ctx, env);
	}

	async init(agentId: string ,meetingId: string, authToken: string, workerUrl: string, accountId: string, apiToken: string) {
		// Construct your text processor for generating responses to text
		const textHandler = new MyTextH

andler(this.env); // Construct a Meeting object to join the RTK meeting const transport = new RealtimeKitTransport(meetingId, authToken, [ { media_kind: 'audio', stream_kind: 'microphone', }, ]); const { meeting } = transport; // Construct a pipeline to take in meeting audio, transcribe it using // Deepgram, and pass our generated responses through ElevenLabs to // be spoken in the meeting await this.initPipeline( [transport, new DeepgramSTT(this.env.DEEPGRAM_API_KEY), textHandler, new ElevenLabsTTS(this.env.ELEVENLABS_API_KEY), transport], agentId, workerUrl, accountId, apiToken, ); // The RTK meeting object is accessible to us, so we can register handlers // on various events like participant joins/leaves, chat, etc. // This is optional meeting.participants.joined.on('participantJoined', (participant) => { textHandler.speak(`Participant Joined ${participant.name}`); }); meeting.participants.joined.on('participantLeft', (participant) => { textHandler.speak(`Participant Left ${participant.name}`); }); // Make sure to actually join the meeting after registering all handlers await meeting.rtkMeeting.join(); } async deinit() { // Add any other cleanup logic required await this.deinitPipeline(); } }

Cloudflare 指出,要让语音交互达到“自然对话”的体验,总延迟需低于 800 毫秒,而其分布式边缘架构正好能满足这一苛刻要求。平台同时兼容多种 AI 模型和第三方服务,支持高度可组合的语音处理管道。

目前,Cloudflare Realtime Agents 已开放 Beta 公测,开发者可免费试用并基于该平台开发新一代实时语音 AI 应用。

相关推荐
我要咨询做网站
成功案例
建站流程
  • 网站需
    求分析
  • 网站策
    划方案
  • 页面风
    格设计
  • 程序设
    计研发
  • 资料录
    入优化
  • 确认交
    付使用
  • 后续跟
    踪服务
  • 400 9868 577
    info#ilanqiao.cn
Hi,Are you ready?
准备好开始了吗?
那就与我们取得联系吧

咨询送礼现在提交,将获得兰乔电子商务策划专家免费为您制作
价值5880元《全网营销方案+优化视频教程》一份!
下单送礼感恩七周年,新老用户下单即送创业型空间+域名等大礼
24小时免费咨询热线400 9868 577
合作意向表
您需要的服务
您最关注的地方
预算

直接咨询