diff --git a/AGENTS.md b/AGENTS.md index ddc7f62..786bcb3 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -188,7 +188,7 @@ console.log('Speech echo WebSocket app listening on port 3000'); Both `WebhookResponse` and `Session` support the same chainable verb methods: -`.say(opts)` `.play(opts)` `.gather(opts)` `.dial(opts)` `.llm(opts)` `.s2s(opts)` `.openai_s2s(opts)` `.google_s2s(opts)` `.elevenlabs_s2s(opts)` `.deepgram_s2s(opts)` `.ultravox_s2s(opts)` `.dialogflow(opts)` `.conference(opts)` `.enqueue(opts)` `.dequeue(opts)` `.hangup()` `.pause(opts)` `.redirect(opts)` `.config(opts)` `.tag(opts)` `.dtmf(opts)` `.listen(opts)` `.transcribe(opts)` `.message(opts)` `.stream(opts)` `.pipeline(opts)` `.dub(opts)` `.alert(opts)` `.answer(opts)` `.leave()` `.sipDecline(opts)` `.sipRefer(opts)` `.sipRequest(opts)` +`.say(opts)` `.play(opts)` `.gather(opts)` `.dial(opts)` `.llm(opts)` `.s2s(opts)` `.openai_s2s(opts)` `.google_s2s(opts)` `.elevenlabs_s2s(opts)` `.deepgram_s2s(opts)` `.ultravox_s2s(opts)` `.dialogflow(opts)` `.conference(opts)` `.enqueue(opts)` `.dequeue(opts)` `.hangup()` `.pause(opts)` `.redirect(opts)` `.config(opts)` `.tag(opts)` `.dtmf(opts)` `.listen(opts)` `.transcribe(opts)` `.message(opts)` `.stream(opts)` `.agent(opts)` `.dub(opts)` `.alert(opts)` `.answer(opts)` `.leave()` `.sipDecline(opts)` `.sipRefer(opts)` `.sipRequest(opts)` All methods accept the same options as the corresponding verb JSON Schema. Methods are chainable — they return `this`. @@ -370,7 +370,7 @@ Beyond verbs, WebSocket apps can perform async operations at any time during a c Key capabilities: - **TTS token streaming** — `sendTtsTokens()`, `flushTtsTokens()`, `clearTtsTokens()` — pipe LLM tokens to jambonz incrementally for lowest-latency TTS playback. **Not the same as `autoStreamTts`** (which is a jambonz-internal audio optimization). - **Inject commands** — `injectMute()`, `injectWhisper()`, `injectDtmf()`, `injectRecord()`, `injectTag()`, `injectListenStatus()` — modify the call mid-stream. -- **LLM tool output** — `toolOutput()` — return tool call results to the pipeline verb's LLM. +- **LLM tool output** — `toolOutput()` — return tool call results to the agent verb's LLM. - **Cascaded voice AI agents** — build your own STT→LLM→TTS loop using `config` (ttsStream + bargeIn) + `sendTtsTokens()`. Full control over LLM interaction and conversation history. ### Session Events (SDK) diff --git a/README.md b/README.md index ae38441..35bce92 100644 --- a/README.md +++ b/README.md @@ -369,7 +369,7 @@ import { JambonzClient } from '@jambonz/sdk/client'; Both `WebhookResponse` and WebSocket `Session` support the same chainable verb methods: -`.say()` `.play()` `.gather()` `.dial()` `.llm()` `.conference()` `.enqueue()` `.dequeue()` `.hangup()` `.pause()` `.redirect()` `.config()` `.tag()` `.dtmf()` `.listen()` `.transcribe()` `.message()` `.stream()` `.pipeline()` `.dub()` `.alert()` `.answer()` `.leave()` `.sipDecline()` `.sipRefer()` `.sipRequest()` +`.say()` `.play()` `.gather()` `.dial()` `.llm()` `.conference()` `.enqueue()` `.dequeue()` `.hangup()` `.pause()` `.redirect()` `.config()` `.tag()` `.dtmf()` `.listen()` `.transcribe()` `.message()` `.stream()` `.agent()` `.dub()` `.alert()` `.answer()` `.leave()` `.sipDecline()` `.sipRefer()` `.sipRequest()` All methods accept the same options as the corresponding [verb JSON schemas](schema/verbs/) and are chainable. diff --git a/examples/pipeline/ws-app.ts b/examples/agent/ws-app.ts similarity index 94% rename from examples/pipeline/ws-app.ts rename to examples/agent/ws-app.ts index ae06961..f823baa 100644 --- a/examples/pipeline/ws-app.ts +++ b/examples/agent/ws-app.ts @@ -15,7 +15,7 @@ const makeService = createEndpoint({ }, }); -const svc = makeService({ path: '/pipeline' }); +const svc = makeService({ path: '/agent' }); const systemPrompt = `You are a helpful weather assistant. You can look up current weather for any location using the get_weather tool. @@ -56,7 +56,7 @@ svc.on('session:new', (session) => { session .on('/event', (evt: Record) => { - console.log('pipeline event:', evt.type); + console.log('agent event:', evt.type); }) .on('/toolCall', async (evt: Record) => { const { tool_call_id, name, arguments: args } = evt; @@ -95,7 +95,7 @@ svc.on('session:new', (session) => { } }) .on('/action', (evt: Record) => { - console.log('pipeline ended:', evt.completion_reason); + console.log('agent ended:', evt.completion_reason); session.reply(); }) .on('close', (code: number) => { @@ -106,7 +106,7 @@ svc.on('session:new', (session) => { }); session - .pipeline({ + .agent({ stt: { vendor: 'deepgram', language: 'en-US', @@ -135,4 +135,4 @@ svc.on('session:new', (session) => { .send(); }); -console.log('Pipeline voice agent listening on port 3000'); +console.log('Agent listening on port 3000'); diff --git a/examples/bedrock-pipeline.ts b/examples/bedrock-agent.ts similarity index 93% rename from examples/bedrock-pipeline.ts rename to examples/bedrock-agent.ts index f9272ed..a9766bb 100644 --- a/examples/bedrock-pipeline.ts +++ b/examples/bedrock-agent.ts @@ -60,14 +60,14 @@ interface TtsConfig { options?: Record; } -interface PipelineOptions { +interface AgentOptions { stt: SttConfig; tts: TtsConfig; turnDetection: 'krisp' | 'stt'; noiseIsolation?: 'krisp' | 'rnnoise'; } -function handleSession(session: Session, opts: PipelineOptions) { +function handleSession(session: Session, opts: AgentOptions) { const log = logger.child({ call_sid: session.callSid }); const llmVendor = session.data.env_vars?.LLM_VENDOR || 'openai'; const model = session.data.env_vars?.LLM_MODEL || 'gpt-4.1-mini'; @@ -78,19 +78,19 @@ function handleSession(session: Session, opts: PipelineOptions) { /* Demo: update_tools mid-conversation to add web search capability. After the user's second question (turn_end #2), inject a web_search tool. The agent starts without web search, so early questions get stale answers. - Once the tool is added, the agent can search the web via Tavily. */ + Once the tool is added, it can search the web via Tavily. */ let turnCount = 0; let toolsInjected = false; - session.on('/pipeline-event', (evt: Record) => { - log.info({payload: evt}, `pipeline event: ${evt.type}`); + session.on('/agent-event', (evt: Record) => { + log.info({payload: evt}, `agent event: ${evt.type}`); if (evt.type === 'turn_end') { turnCount++; if (turnCount === 2 && !toolsInjected) { toolsInjected = true; log.info('injecting web_search tool'); - session.updatePipeline({ + session.updateAgent({ type: 'update_tools', tools: [ { @@ -112,7 +112,7 @@ function handleSession(session: Session, opts: PipelineOptions) { }, ], }); - session.updatePipeline({ + session.updateAgent({ type: 'inject_context', messages: [ { @@ -155,13 +155,13 @@ function handleSession(session: Session, opts: PipelineOptions) { } }); - session.on('/pipeline-complete', (evt: Record) => { - log.info({payload: evt}, 'pipeline completed'); + session.on('/agent-complete', (evt: Record) => { + log.info({payload: evt}, 'agent completed'); session.hangup().reply(); }); session - .pipeline({ + .agent({ stt: opts.stt, tts: { vendor: opts.tts.vendor, @@ -183,9 +183,9 @@ function handleSession(session: Session, opts: PipelineOptions) { bargeIn: { enable: true, }, - eventHook: '/pipeline-event', + eventHook: '/agent-event', toolHook: '/tool-call', - actionHook: '/pipeline-complete', + actionHook: '/agent-complete', }) .send(); } diff --git a/jambonz/SKILL.md b/jambonz/SKILL.md index e4a7010..4ce5a82 100644 --- a/jambonz/SKILL.md +++ b/jambonz/SKILL.md @@ -3,7 +3,7 @@ name: jambonz description: >- Build voice applications on jambonz, an open-source CPaaS. Covers the verb model, webhook and WebSocket transports, IVR menus, AI voice agents (OpenAI - Realtime, Deepgram, ElevenLabs, Google, Ultravox, pipeline), call routing, + Realtime, Deepgram, ElevenLabs, Google, Ultravox, agent), call routing, queuing, recording, mid-call control, and SIP. Works with @jambonz/sdk (TypeScript) or raw JSON from any language. Use with the jambonz MCP server for schema lookups. @@ -38,7 +38,7 @@ jambonz has two editions: **v0.9.x (open source)** and **v10.x (commercial)**. E Choose the transport based on what the application needs: ### Use WebSocket when: -- Using any speech-to-speech verb (`openai_s2s`, `google_s2s`, `deepgram_s2s`, `ultravox_s2s`, `elevenlabs_s2s`, `s2s`, `pipeline`) — **mandatory** +- Using any speech-to-speech verb (`openai_s2s`, `google_s2s`, `deepgram_s2s`, `ultravox_s2s`, `elevenlabs_s2s`, `s2s`, `agent`) — **mandatory** - Streaming raw audio (`listen`/`stream` verb with bidirectional audio) - Using TTS token streaming - Building complex conversational flows with session state @@ -69,11 +69,11 @@ The user wants a caller to have a conversation with an LLM. **Is the vendor determined at runtime** (e.g. from an env var)? Use `s2s` with `vendor` property. -**Does the user want jambonz to orchestrate STT + LLM + TTS as separate components?** Use `pipeline`. +**Does the user want jambonz to orchestrate STT + LLM + TTS as separate components?** Use `agent`. **Never use `llm` in generated code** — it is a legacy name. Use either a vendor shortcut or `s2s`. -See [references/voice-ai-guide.md](references/voice-ai-guide.md) for details on s2s vs pipeline, tool calling, and vendor specifics. +See [references/voice-ai-guide.md](references/voice-ai-guide.md) for details on s2s vs agent, tool calling, and vendor specifics. ### "Build an IVR menu / collect input" @@ -209,7 +209,7 @@ Use `get_jambonz_schema` to look up the exact JSON structure for any verb. 4. **Missing `anchorMedia: true` on `dial`** — Required for recording during bridged calls. Without it, audio doesn't flow through the media server. 5. **Using `process.env`** — jambonz apps should use application environment variables (`session.data.env_vars` / `req.body.env_vars`), not `process.env`. 6. **`env_vars` only on initial call** — The `env_vars` object is only present in the first webhook POST or `session:new`. Store values in a variable if needed in actionHook handlers. -7. **Webhook transport for s2s/pipeline apps** — These verbs require WebSocket. Always use `createEndpoint` from `@jambonz/sdk/websocket`. +7. **Webhook transport for s2s/agent apps** — These verbs require WebSocket. Always use `createEndpoint` from `@jambonz/sdk/websocket`. 8. **ElevenLabs: passing `model` or `messages`** — ElevenLabs uses `agent_id` auth. The model and prompt are configured in the ElevenLabs dashboard. Pass `llmOptions: {}`. 9. **Marks silently failing** — Marks require `bidirectionalAudio: { enabled: true, streaming: true }` on the listen/stream verb. Without streaming mode, marks are accepted but never fire. 10. **Not binding actionHook listeners before `.send()`** — In WebSocket mode, if no listener is bound for an actionHook, the SDK auto-replies with an empty verb array, which usually means the call hangs up unexpectedly. @@ -237,7 +237,7 @@ Use `get_jambonz_schema` to look up the exact JSON structure for any verb. Load these on demand based on the task: -- [references/voice-ai-guide.md](references/voice-ai-guide.md) — **Load when** building s2s or pipeline voice AI apps. Covers s2s vs pipeline decision, vendor shortcuts, tool/function calling, TTS streaming, eventHook patterns. +- [references/voice-ai-guide.md](references/voice-ai-guide.md) — **Load when** building s2s or agent voice AI apps. Covers s2s vs agent decision, vendor shortcuts, tool/function calling, TTS streaming, eventHook patterns. - [references/ivr-patterns.md](references/ivr-patterns.md) — **Load when** building IVR menus or gather-based input collection. Covers speech/DTMF/mixed input, multi-level menus, timeout and retry patterns. - [references/call-control.md](references/call-control.md) — **Load when** building apps with dial, transfer, queuing, conference, recording, or mid-call control. Covers dial targets, SIP ops, enqueue/dequeue, REST API control, inject commands. - [references/env-vars-and-config.md](references/env-vars-and-config.md) — **Load when** the app needs configurable parameters. Covers the two-step declare+read pattern, schema properties, the "only on initial call" gotcha. diff --git a/jambonz/references/voice-ai-guide.md b/jambonz/references/voice-ai-guide.md index 013c7bc..3b032a9 100644 --- a/jambonz/references/voice-ai-guide.md +++ b/jambonz/references/voice-ai-guide.md @@ -1,8 +1,8 @@ # Voice AI Guide -This reference covers building AI-powered voice agents with jambonz — speech-to-speech (s2s) verbs and the pipeline verb. +This reference covers building AI-powered voice agents with jambonz — speech-to-speech (s2s) verbs and the agent verb. -## s2s vs Pipeline: When to Use Which +## s2s vs Agent: When to Use Which ### Speech-to-Speech (s2s) Verbs @@ -17,14 +17,14 @@ Available vendor shortcuts (always prefer these over generic `s2s`): Use generic `s2s` with `vendor` property **only** when the vendor is determined at runtime. -### Pipeline Verb +### Agent Verb -Use `pipeline` when you want **jambonz to orchestrate separate STT, LLM, and TTS components**. This gives you: +Use `agent` when you want **jambonz to orchestrate separate STT, LLM, and TTS components**. This gives you: - Mix-and-match: e.g. Deepgram STT + Anthropic LLM + ElevenLabs TTS - More control over each component's configuration - Built-in turn detection and interruption handling -The pipeline verb has three main configuration blocks: `recognizer` (STT), `llm` (text LLM), and `synthesizer` (TTS). +The agent verb has three main configuration blocks: `recognizer` (STT), `llm` (text LLM), and `synthesizer` (TTS). ## Vendor-Specific Details @@ -131,7 +131,7 @@ session.on('llm:event', (evt) => { ## TTS Token Streaming -For pipeline or custom flows where you generate text and want incremental TTS: +For agent or custom flows where you generate text and want incremental TTS: 1. Enable streaming: `session.config({ ttsStream: { enable: true } })` 2. Send tokens: `await session.sendTtsTokens('chunk of text')` @@ -170,11 +170,11 @@ session Add `toolHook` and bind a handler for tool execution. See the Tool / Function Calling section above. -### Pipeline (mix-and-match components) +### Agent (mix-and-match components) ```typescript session - .pipeline({ + .agent({ recognizer: { vendor: 'deepgram', language: 'en-US' }, llm: { vendor: 'anthropic', @@ -187,4 +187,4 @@ session .send(); ``` -Look up full schema: `get_jambonz_schema('pipeline')` +Look up full schema: `get_jambonz_schema('agent')` diff --git a/typescript/package-lock.json b/typescript/package-lock.json index f6ac35c..dca8e00 100644 --- a/typescript/package-lock.json +++ b/typescript/package-lock.json @@ -1,15 +1,15 @@ { "name": "@jambonz/sdk", - "version": "0.2.0", + "version": "0.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@jambonz/sdk", - "version": "0.2.0", + "version": "0.3.0", "license": "MIT", "dependencies": { - "@jambonz/schema": "^0.1.5", + "@jambonz/schema": "^0.2.1", "ajv": "^8.17.1", "ws": "^8.18.0" }, @@ -582,9 +582,9 @@ } }, "node_modules/@jambonz/schema": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/@jambonz/schema/-/schema-0.1.5.tgz", - "integrity": "sha512-50fu8JLug3QPZ1m84D01MddsYutRjSOVgF4wFmYwfivH8BKcQ+fDeRRZcAygIl1AfAVmbpUXQ6J+tYbJY3iC9A==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@jambonz/schema/-/schema-0.2.1.tgz", + "integrity": "sha512-iMZMOq/DRyuauKSotb9oarJVZnsJXSTR8AbHnWJDt2EqOf0/3HkZYi+rzgP1aT5rFfF6WPqOqFb+NVktK0Bn0w==", "license": "MIT", "dependencies": { "ajv": "^8.17.1", diff --git a/typescript/package.json b/typescript/package.json index b701a20..2747418 100644 --- a/typescript/package.json +++ b/typescript/package.json @@ -1,6 +1,6 @@ { "name": "@jambonz/sdk", - "version": "0.2.0", + "version": "0.3.0", "description": "jambonz SDK for building voice applications — optimized for AI agents", "author": "Dave Horton", "license": "MIT", @@ -90,7 +90,7 @@ "prepublishOnly": "npm run build" }, "dependencies": { - "@jambonz/schema": "^0.1.5", + "@jambonz/schema": "^0.2.1", "ajv": "^8.17.1", "ws": "^8.18.0" }, diff --git a/typescript/src/client/api.ts b/typescript/src/client/api.ts index 23d1e7a..a005584 100644 --- a/typescript/src/client/api.ts +++ b/typescript/src/client/api.ts @@ -147,9 +147,9 @@ export class CallsResource { return this.update(callSid, { mute_status: status }); } - /** Send a mid-conversation update to an active pipeline verb. */ - async updatePipeline(callSid: string, data: NonNullable): Promise { - return this.update(callSid, { pipeline_update: data }); + /** Send a mid-conversation update to an active agent verb. */ + async updateAgent(callSid: string, data: NonNullable): Promise { + return this.update(callSid, { agent_update: data }); } /** Enable or disable server-side noise isolation. */ diff --git a/typescript/src/types/index.ts b/typescript/src/types/index.ts index e99fa5b..56459fb 100644 --- a/typescript/src/types/index.ts +++ b/typescript/src/types/index.ts @@ -20,6 +20,7 @@ export type { // Verbs export type { + AgentVerb, AlertVerb, AnswerVerb, ConferenceVerb, @@ -38,7 +39,6 @@ export type { McpServerConfig, MessageVerb, PauseVerb, - PipelineVerb, PlayVerb, RedirectVerb, SayVerb, @@ -54,15 +54,15 @@ export type { // Session export type { + AgentEvent, + AgentEventType, + AgentLlmResponseEvent, + AgentPreflightMetrics, + AgentTurnEndEvent, + AgentTurnLatency, + AgentUserInterruptionEvent, + AgentUserTranscriptEvent, CallSession, - PipelineAgentResponseEvent, - PipelineEvent, - PipelineEventType, - PipelinePreflightMetrics, - PipelineTurnEndEvent, - PipelineTurnLatency, - PipelineUserInterruptionEvent, - PipelineUserTranscriptEvent, TtsStreamingEvent, TtsStreamingEventType, WsMessage, diff --git a/typescript/src/types/rest.ts b/typescript/src/types/rest.ts index c91af1a..e304b46 100644 --- a/typescript/src/types/rest.ts +++ b/typescript/src/types/rest.ts @@ -98,8 +98,8 @@ export interface UpdateCallRequest { dtmf?: { digit: string; duration?: number }; /** Tag metadata. */ tag?: Record; - /** Mid-conversation pipeline update. */ - pipeline_update?: { + /** Mid-conversation agent update. */ + agent_update?: { type: 'update_instructions' | 'inject_context' | 'update_tools' | 'generate_reply'; instructions?: string; messages?: Array<{ role: string; content: string }>; diff --git a/typescript/src/types/session.ts b/typescript/src/types/session.ts index 59effb7..69ceb72 100644 --- a/typescript/src/types/session.ts +++ b/typescript/src/types/session.ts @@ -113,27 +113,27 @@ export type WsMessageType = | 'verb:status' | 'llm:event' | 'llm:tool-call' - | 'pipeline:event' - | 'pipeline:tool-call' + | 'agent:event' + | 'agent:tool-call' | 'tts:streaming-event' | 'tts:tokens-result' | 'jambonz:error'; -/** Pipeline eventHook event types. */ -export type PipelineEventType = +/** Agent eventHook event types. */ +export type AgentEventType = | 'turn_end' | 'user_transcript' - | 'agent_response' + | 'llm_response' | 'user_interruption'; /** Preflight (early generation) metrics. */ -export interface PipelinePreflightMetrics { +export interface AgentPreflightMetrics { result: 'hit' | 'miss' | 'pending'; tokens?: number; } /** Per-turn latency metrics (all values in milliseconds). */ -export interface PipelineTurnLatency { +export interface AgentTurnLatency { /** STT processing latency: stop talking to final transcript received. */ transcriber_latency?: number; /** Additional wait after transcript for end-of-turn detection. */ @@ -143,41 +143,41 @@ export interface PipelineTurnLatency { /** TTS engine latency: first text sent to TTS until first audio received. */ voice_latency?: number; /** Early generation metrics. */ - preflight?: PipelinePreflightMetrics; + preflight?: AgentPreflightMetrics; } -/** Payload for pipeline:event turn_end messages. */ -export interface PipelineTurnEndEvent { +/** Payload for agent:event turn_end messages. */ +export interface AgentTurnEndEvent { type: 'turn_end'; transcript: string; response: string; interrupted: boolean; - latency: PipelineTurnLatency; + latency: AgentTurnLatency; } -/** Payload for pipeline:event user_transcript messages. */ -export interface PipelineUserTranscriptEvent { +/** Payload for agent:event user_transcript messages. */ +export interface AgentUserTranscriptEvent { type: 'user_transcript'; transcript: string; } -/** Payload for pipeline:event agent_response messages. */ -export interface PipelineAgentResponseEvent { - type: 'agent_response'; +/** Payload for agent:event llm_response messages. */ +export interface AgentLlmResponseEvent { + type: 'llm_response'; response: string; } -/** Payload for pipeline:event user_interruption messages. */ -export interface PipelineUserInterruptionEvent { +/** Payload for agent:event user_interruption messages. */ +export interface AgentUserInterruptionEvent { type: 'user_interruption'; } -/** Union of all pipeline eventHook payloads. */ -export type PipelineEvent = - | PipelineTurnEndEvent - | PipelineUserTranscriptEvent - | PipelineAgentResponseEvent - | PipelineUserInterruptionEvent; +/** Union of all agent eventHook payloads. */ +export type AgentEvent = + | AgentTurnEndEvent + | AgentUserTranscriptEvent + | AgentLlmResponseEvent + | AgentUserInterruptionEvent; /** Inbound WebSocket message from jambonz. */ export interface WsMessage { diff --git a/typescript/src/types/verbs.ts b/typescript/src/types/verbs.ts index 3a22f44..e29d7db 100644 --- a/typescript/src/types/verbs.ts +++ b/typescript/src/types/verbs.ts @@ -215,8 +215,8 @@ export interface DialogflowVerb { }; } -export interface PipelineVerb { - verb: 'pipeline'; +export interface AgentVerb { + verb: 'agent'; id?: string; /** STT configuration. */ stt: Recognizer; @@ -236,9 +236,9 @@ export interface PipelineVerb { }; /** LLM configuration. */ llm: Record; - /** Webhook when pipeline ends. */ + /** Webhook when agent ends. */ actionHook?: ActionHook; - /** Webhook for pipeline events. */ + /** Webhook for agent events. */ eventHook?: ActionHook; /** Webhook when the LLM requests a tool/function call. */ toolHook?: ActionHook; @@ -716,7 +716,7 @@ export type Verb = | DeepgramS2sVerb | UltravoxS2sVerb | DialogflowVerb - | PipelineVerb + | AgentVerb | ConferenceVerb | TranscribeVerb | EnqueueVerb diff --git a/typescript/src/verb-builder.ts b/typescript/src/verb-builder.ts index 41c7af2..532d13b 100644 --- a/typescript/src/verb-builder.ts +++ b/typescript/src/verb-builder.ts @@ -4,6 +4,7 @@ */ import type { + AgentVerb, AlertVerb, AnswerVerb, ConferenceVerb, @@ -22,7 +23,6 @@ import type { LlmVerb, MessageVerb, PauseVerb, - PipelineVerb, PlayVerb, RedirectVerb, S2sVerb, @@ -122,9 +122,9 @@ export class VerbBuilder { return this.addVerb({ verb: 'dialogflow', ...opts }); } - /** Voice AI pipeline with integrated turn detection. */ - pipeline(opts: Omit): this { - return this.addVerb({ verb: 'pipeline', ...opts }); + /** Voice AI agent with integrated turn detection. */ + agent(opts: Omit): this { + return this.addVerb({ verb: 'agent', ...opts }); } /** Stream real-time call audio to a WebSocket endpoint. Supports bidirectional audio. */ diff --git a/typescript/src/websocket/session.ts b/typescript/src/websocket/session.ts index 9c0882f..b55ea39 100644 --- a/typescript/src/websocket/session.ts +++ b/typescript/src/websocket/session.ts @@ -128,8 +128,8 @@ export class Session extends EventEmitter { ultravox_s2s(opts: Parameters[0]): this { this.builder.ultravox_s2s(opts); return this; } /** Connect the caller to a Google Dialogflow agent. */ dialogflow(opts: Parameters[0]): this { this.builder.dialogflow(opts); return this; } - /** Voice AI pipeline with integrated turn detection. */ - pipeline(opts: Parameters[0]): this { this.builder.pipeline(opts); return this; } + /** Voice AI agent with integrated turn detection. */ + agent(opts: Parameters[0]): this { this.builder.agent(opts); return this; } /** Stream real-time call audio to a WebSocket endpoint. Supports bidirectional audio. */ listen(opts: Parameters[0]): this { this.builder.listen(opts); return this; } /** Stream real-time call audio to a WebSocket endpoint. Synonym for {@link listen}. */ @@ -338,11 +338,11 @@ export class Session extends EventEmitter { }); } - /** Update an active pipeline conversation mid-call. */ - updatePipeline(data: Record): void { + /** Update an active agent conversation mid-call. */ + updateAgent(data: Record): void { this.wsSend({ type: 'command', - command: 'pipeline:update', + command: 'agent:update', data, }); } @@ -487,8 +487,8 @@ export class Session extends EventEmitter { case 'llm:event': case 'llm:tool-call': - case 'pipeline:event': - case 'pipeline:tool-call': + case 'agent:event': + case 'agent:tool-call': if (hook) { this.emit(hook, data); }