From 984c95dfc304279ed3d1bfc1b70448449c7f8336 Mon Sep 17 00:00:00 2001 From: Frano Sincic Date: Tue, 28 Jan 2025 15:34:35 +0100 Subject: [PATCH] Add new property to turn detection server vad type --- dist/lib/client.d.ts | 7 ++++--- dist/lib/client.d.ts.map | 2 +- lib/client.js | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dist/lib/client.d.ts b/dist/lib/client.d.ts index 7ea2201..54e5e8f 100644 --- a/dist/lib/client.d.ts +++ b/dist/lib/client.d.ts @@ -12,6 +12,7 @@ * @property {number} [threshold] * @property {number} [prefix_padding_ms] * @property {number} [silence_duration_ms] + * @property {boolean} [create_response] */ /** * Tool definitions @@ -320,6 +321,7 @@ export type TurnDetectionServerVadType = { threshold?: number; prefix_padding_ms?: number; silence_duration_ms?: number; + create_response?: boolean; }; /** * Tool definitions @@ -336,8 +338,7 @@ export type SessionResourceType = { model?: string; modalities?: string[]; instructions?: string; - voice?: "alloy"|"ash"|"ballad"|"coral"|"echo"|"sage"|"shimmer"|"verse"; - + voice?: "alloy" | "ash" | "ballad" | "coral" | "echo" | "sage" | "shimmer" | "verse"; input_audio_format?: AudioFormatType; output_audio_format?: AudioFormatType; input_audio_transcription?: AudioTranscriptionType | null; @@ -457,4 +458,4 @@ export type ResponseResourceType = { import { RealtimeEventHandler } from './event_handler.js'; import { RealtimeAPI } from './api.js'; import { RealtimeConversation } from './conversation.js'; -//# sourceMappingURL=client.d.ts.map +//# sourceMappingURL=client.d.ts.map \ No newline at end of file diff --git a/dist/lib/client.d.ts.map b/dist/lib/client.d.ts.map index 10e52f3..1eec3d6 100644 --- a/dist/lib/client.d.ts.map +++ b/dist/lib/client.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../lib/client.js"],"names":[],"mappings":"AAKA;;;GAGG;AAEH;;;GAGG;AAEH;;;;;;GAMG;AAEH;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;GAcG;AAEH;;GAEG;AA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M,GAAC,IAAI;UACX,SAAS;YACT,cAAc;UACd,QAAQ;aACR,KAAK,CAAC,oBAAoB,CAAC;;;uBAK3B,MAAM,GAAC,IAAI;UACX,SAAS;YACT,cAAc;UACd,MAAM;aACN,KAAK,CAAC,oBAAoB,GAAC,qBAAqB,CAAC;;;uBAKjD,MAAM,GAAC,IAAI;UACX,SAAS;YACT,cAAc;UACd,WAAW;aACX,KAAK,CAAC,eAAe,GAAC,gBAAgB,CAAC;;;uBAKvC,MAAM,GAAC,IAAI;UACX,eAAe;YACf,cAAc;aACd,MAAM;UACN,MAAM;eACN,MAAM;;;uBAKN,MAAM,GAAC,IAAI;UACX,sBAAsB;aACtB,MAAM;YACN,MAAM;;;UAKN,UAAU;UACV,MAAM;aACN,MAAM;eACN,MAAM;;;YAKN,UAAU;WACV,MAAM;iBACN,MAAM;WACN,iBAAiB;aACjB,MAAM;WACN,GAAG;;;QAKH,MAAM;YACN,MAAM;WACN,MAAM,GAAC,WAAW,GAAC,QAAQ;eAC3B,qBAAqB;;2BAItB,cAAc,GAAC,YAAY,GAAC,iBAAiB,GAAC,oBAAoB,GAAC,0BAA0B;uBAI7F,iBAAiB,GAAG,YAAY;;UAK/B,YAAY;YACZ,cAAc,GAAC,mBAAmB,GAAC,gBAAgB;;;UAKnD,QAAQ;WACR;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAC,GAAC,IAAI;;;kBAKpC,MAAM;kBACN,MAAM;mBACN,MAAM;;;YAKN,aAAa,GAAC,WAAW,GAAC,YAAY,GAAC,WAAW,GAAC,QAAQ;oBAC3D,4BAA4B,GAAC,wBAAwB,GAAC,IAAI;YAC1D,QAAQ,EAAE;WACV,SAAS,GAAC,IAAI;;qCArLS,oBAAoB;4BAC7B,UAAU;qCACD,mBAAmB"} \ No newline at end of file +{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../lib/client.js"],"names":[],"mappings":"AAKA;;;GAGG;AAEH;;;GAGG;AA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I;;qCAtLS,oBAAoB;4BAC7B,UAAU;qCACD,mBAAmB"} \ No newline at end of file diff --git a/lib/client.js b/lib/client.js index 2c48d7f..6b9ffd1 100644 --- a/lib/client.js +++ b/lib/client.js @@ -19,6 +19,7 @@ import { RealtimeUtils } from './utils.js'; * @property {number} [threshold] * @property {number} [prefix_padding_ms] * @property {number} [silence_duration_ms] + * @property {boolean} [create_response] */ /**