From 1c4b4745959538f94a01f2b85a73d237cce30d80 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Mon, 20 Jul 2026 11:43:16 -0400 Subject: [PATCH] =?UTF-8?q?feat(sdk):=20qwen=5Fs2s=20verb=20=E2=80=94=20Al?= =?UTF-8?q?ibaba=20Qwen=20Omni-Realtime=20S2S=20vendor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds the qwen_s2s shortcut verb (synonym for llm with vendor 'qwen'), mirroring openai_s2s across the three seams: - types/verbs.ts: QwenS2sVerb with typed DashScope auth — apiKey (optional when the account stores a qwen credential; keys are region-bound) and host (optional; default dashscope-intl.aliyuncs.com international, or a workspace-scoped ws-..maas.aliyuncs.com / dashscope.aliyuncs.com for Beijing) — added to the Verb union - verb-builder.ts: qwen_s2s() builder method - websocket/session.ts: session.qwen_s2s() delegation - @jambonz/schema bumped to ^0.4.1 (ships the qwen_s2s verb schema), lockfile synced Build (ESM/CJS/DTS) + all tests green. Co-Authored-By: Claude Opus 4.8 --- typescript/package-lock.json | 8 ++++---- typescript/package.json | 2 +- typescript/src/types/verbs.ts | 18 ++++++++++++++++++ typescript/src/verb-builder.ts | 4 ++++ typescript/src/websocket/session.ts | 1 + 5 files changed, 28 insertions(+), 5 deletions(-) diff --git a/typescript/package-lock.json b/typescript/package-lock.json index 0e33a77..64e850d 100644 --- a/typescript/package-lock.json +++ b/typescript/package-lock.json @@ -9,7 +9,7 @@ "version": "0.9.0", "license": "MIT", "dependencies": { - "@jambonz/schema": "^0.4.0", + "@jambonz/schema": "^0.4.1", "ajv": "^8.17.1", "ws": "^8.18.0" }, @@ -582,9 +582,9 @@ } }, "node_modules/@jambonz/schema": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@jambonz/schema/-/schema-0.4.0.tgz", - "integrity": "sha512-FtjudIkHFaQgGCS1jVO08u3QcCwpBNIx85Yee74mwOiTfZvl7YTYt+FRT5xrfMUI0Kd4pcYxYZCGdHxLWo5d+w==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@jambonz/schema/-/schema-0.4.1.tgz", + "integrity": "sha512-Q1YTuIgcGbU3dvI7Gc0aBvlHDUz8Pbz1XX6YTYZ8nEifuJc1AtQbW+mFCJhidodV7FBzW3eY7bQ1feoL0G91lw==", "license": "MIT", "dependencies": { "ajv": "^8.17.1", diff --git a/typescript/package.json b/typescript/package.json index 9fe349c..0f57522 100644 --- a/typescript/package.json +++ b/typescript/package.json @@ -95,7 +95,7 @@ "postpublish": "npm run clean-docs" }, "dependencies": { - "@jambonz/schema": "^0.4.0", + "@jambonz/schema": "^0.4.1", "ajv": "^8.17.1", "ws": "^8.18.0" }, diff --git a/typescript/src/types/verbs.ts b/typescript/src/types/verbs.ts index f9733ed..2a6fdf2 100644 --- a/typescript/src/types/verbs.ts +++ b/typescript/src/types/verbs.ts @@ -249,6 +249,23 @@ export interface UltravoxS2sVerb extends LlmBaseOptions { verb: 'ultravox_s2s'; } +export interface QwenS2sVerb extends LlmBaseOptions { + verb: 'qwen_s2s'; + /** DashScope authentication. Keys are region-bound: key and host must + * belong to the same region. */ + auth?: { + /** DashScope API key (sk-...). May be omitted when the account has a + * stored credential for the qwen vendor. */ + apiKey?: string; + /** DashScope endpoint host. Default: 'dashscope-intl.aliyuncs.com' + * (international). Use a workspace-scoped host + * ('ws-..maas.aliyuncs.com', Alibaba-recommended) + * or 'dashscope.aliyuncs.com' for the China (Beijing) region. */ + host?: string; + [key: string]: unknown; + }; +} + export interface DialogflowVerb { verb: 'dialogflow'; id?: string; @@ -927,6 +944,7 @@ export type Verb = | ElevenlabsS2sVerb | DeepgramS2sVerb | UltravoxS2sVerb + | QwenS2sVerb | DialogflowVerb | AgentVerb | ConferenceVerb diff --git a/typescript/src/verb-builder.ts b/typescript/src/verb-builder.ts index 6ab69ae..befdb2b 100644 --- a/typescript/src/verb-builder.ts +++ b/typescript/src/verb-builder.ts @@ -99,6 +99,10 @@ export class VerbBuilder { return this.addVerb({ verb: 'openai_s2s', ...opts }); } + qwen_s2s(opts: Omit): this { + return this.addVerb({ verb: 'qwen_s2s', ...opts }); + } + /** Shortcut for s2s with vendor='google'. */ google_s2s(opts: Omit): this { return this.addVerb({ verb: 'google_s2s', ...opts }); diff --git a/typescript/src/websocket/session.ts b/typescript/src/websocket/session.ts index d0b521e..77eb6a9 100644 --- a/typescript/src/websocket/session.ts +++ b/typescript/src/websocket/session.ts @@ -118,6 +118,7 @@ export class Session extends EventEmitter { s2s(opts: Parameters[0]): this { this.builder.s2s(opts); return this; } /** Shortcut for s2s with vendor='openai'. */ openai_s2s(opts: Parameters[0]): this { this.builder.openai_s2s(opts); return this; } + qwen_s2s(opts: Parameters[0]): this { this.builder.qwen_s2s(opts); return this; } /** Shortcut for s2s with vendor='google'. */ google_s2s(opts: Parameters[0]): this { this.builder.google_s2s(opts); return this; } /** Shortcut for s2s with vendor='elevenlabs'. */