今日已更新 153 条资讯 | 累计 31421 条内容
关于我们

Build an SMS Triage Bot on Telnyx Edge Compute

Sonam 2026年08月14日 02:58 1 次阅读 来源:Dev.to

Support SMS inboxes are usually a routing problem before they are an AI problem. Someone asks about billing. Someone else needs technical support. A third person wants to talk to sales. The app has to understand the message, pick the right destination, reply to the customer, and remember what happened. This TypeScript example does that on Telnyx Edge Compute with the Agent SDK. Code: https://github.com/team-telnyx/telnyx-code-examples/tree/main/agent-sms-triage-bot What it builds agent-sms-triage-bot receives inbound SMS webhooks, classifies each message into one of four topics, looks up the route for that topic, replies by SMS, and stores triage history in durable actor state. The topics are: billing support sales general The default route table maps those topics to queue names: billing -> billing-queue support -> support-queue sales -> sales-queue general -> general-queue The request flow Inbound SMS -> POST /webhooks/sms -> TriageAgent.triage(from, text) -> Telnyx AI Inference classifies topic -> durable route table lookup -> SMS reply -> triage history update The app uses one TriageAgent actor per inbound number. That actor stores route rules, recent history, total messages, and topic counts. The main routes POST /webhooks/sms receives Telnyx message.received events POST /debug/triage simulates inbound SMS POST /routes updates the route table GET /routes lists route rules GET /history returns recent triage history GET /debug/state inspects actor state GET /health/liveness and GET /health/readiness provide health checks The Agent SDK piece The core class is TriageAgent . It extends the Agent SDK Agent class and uses durable state for: route table triage history total message count topic counts The AI classification call uses the Telnyx binding: const completion = await this . env . TELNYX . ai . openai . chat . createCompletion ({ model : this . env . AI_MODEL || " moonshotai/Kimi-K2.6 " , messages : [ { role : " system " , content : CLASSIFY_SYSTEM_PROMPT }, { r

本文内容来源于互联网,版权归原作者所有
查看原文