@mistralai/mistralai 3.3.0 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/extra/realtime/connection.d.ts +16 -3
- package/esm/extra/realtime/connection.d.ts.map +1 -1
- package/esm/extra/realtime/connection.js +35 -9
- package/esm/extra/realtime/connection.js.map +1 -1
- package/esm/extra/realtime/errors.d.ts +18 -0
- package/esm/extra/realtime/errors.d.ts.map +1 -1
- package/esm/extra/realtime/errors.js +19 -0
- package/esm/extra/realtime/errors.js.map +1 -1
- package/esm/extra/realtime/index.d.ts +20 -1
- package/esm/extra/realtime/index.d.ts.map +1 -1
- package/esm/extra/realtime/index.js +5 -0
- package/esm/extra/realtime/index.js.map +1 -1
- package/esm/extra/realtime/speech.d.ts +64 -0
- package/esm/extra/realtime/speech.d.ts.map +1 -0
- package/esm/extra/realtime/speech.js +461 -0
- package/esm/extra/realtime/speech.js.map +1 -0
- package/esm/extra/realtime/transcription.d.ts +2 -2
- package/esm/extra/realtime/transcription.d.ts.map +1 -1
- package/esm/extra/realtime/transcription.js +11 -2
- package/esm/extra/realtime/transcription.js.map +1 -1
- package/esm/extra/workflows/encoding/payload-encoder.d.ts.map +1 -1
- package/esm/extra/workflows/encoding/payload-encoder.js +2 -2
- package/esm/extra/workflows/encoding/payload-encoder.js.map +1 -1
- package/esm/extra/workflows/encoding/python-json.d.ts +3 -2
- package/esm/extra/workflows/encoding/python-json.d.ts.map +1 -1
- package/esm/extra/workflows/encoding/python-json.js +24 -9
- package/esm/extra/workflows/encoding/python-json.js.map +1 -1
- package/esm/funcs/betaRagManagedIndexesCreate.js +1 -1
- package/esm/funcs/betaRagManagedIndexesCreate.js.map +1 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/components/connectionpreference.d.ts +12 -2
- package/esm/models/components/connectionpreference.d.ts.map +1 -1
- package/esm/models/components/connectionpreference.js +3 -3
- package/esm/models/components/connectionpreference.js.map +1 -1
- package/esm/models/components/index.d.ts +11 -5
- package/esm/models/components/index.d.ts.map +1 -1
- package/esm/models/components/index.js +11 -5
- package/esm/models/components/index.js.map +1 -1
- package/esm/models/components/observabilityerrorcode.d.ts +1 -0
- package/esm/models/components/observabilityerrorcode.d.ts.map +1 -1
- package/esm/models/components/observabilityerrorcode.js +1 -0
- package/esm/models/components/observabilityerrorcode.js.map +1 -1
- package/esm/models/components/realtimespeecherror.d.ts +20 -0
- package/esm/models/components/realtimespeecherror.d.ts.map +1 -0
- package/esm/models/components/realtimespeecherror.js +23 -0
- package/esm/models/components/realtimespeecherror.js.map +1 -0
- package/esm/models/components/realtimespeecherrordetail.d.ts +45 -0
- package/esm/models/components/realtimespeecherrordetail.d.ts.map +1 -0
- package/esm/models/components/realtimespeecherrordetail.js +33 -0
- package/esm/models/components/realtimespeecherrordetail.js.map +1 -0
- package/esm/models/components/realtimespeechinputtextappend.d.ts +19 -0
- package/esm/models/components/realtimespeechinputtextappend.d.ts.map +1 -0
- package/esm/models/components/realtimespeechinputtextappend.js +22 -0
- package/esm/models/components/realtimespeechinputtextappend.js.map +1 -0
- package/esm/models/components/realtimespeechinputtextend.d.ts +17 -0
- package/esm/models/components/realtimespeechinputtextend.d.ts.map +1 -0
- package/esm/models/components/realtimespeechinputtextend.js +20 -0
- package/esm/models/components/realtimespeechinputtextend.js.map +1 -0
- package/esm/models/components/realtimespeechinputtextflush.d.ts +19 -0
- package/esm/models/components/realtimespeechinputtextflush.d.ts.map +1 -0
- package/esm/models/components/realtimespeechinputtextflush.js +22 -0
- package/esm/models/components/realtimespeechinputtextflush.js.map +1 -0
- package/esm/models/components/realtimespeechsession.d.ts +31 -0
- package/esm/models/components/realtimespeechsession.d.ts.map +1 -0
- package/esm/models/components/realtimespeechsession.js +49 -0
- package/esm/models/components/realtimespeechsession.js.map +1 -0
- package/esm/models/components/realtimespeechsessioncreated.d.ts +20 -0
- package/esm/models/components/realtimespeechsessioncreated.d.ts.map +1 -0
- package/esm/models/components/realtimespeechsessioncreated.js +23 -0
- package/esm/models/components/realtimespeechsessioncreated.js.map +1 -0
- package/esm/models/components/realtimespeechsessionupdated.d.ts +20 -0
- package/esm/models/components/realtimespeechsessionupdated.d.ts.map +1 -0
- package/esm/models/components/realtimespeechsessionupdated.js +23 -0
- package/esm/models/components/realtimespeechsessionupdated.js.map +1 -0
- package/esm/models/components/realtimespeechsessionupdatemessage.d.ts +20 -0
- package/esm/models/components/realtimespeechsessionupdatemessage.d.ts.map +1 -0
- package/esm/models/components/realtimespeechsessionupdatemessage.js +23 -0
- package/esm/models/components/realtimespeechsessionupdatemessage.js.map +1 -0
- package/esm/models/components/realtimespeechsessionupdatepayload.d.ts +42 -0
- package/esm/models/components/realtimespeechsessionupdatepayload.d.ts.map +1 -0
- package/esm/models/components/realtimespeechsessionupdatepayload.js +45 -0
- package/esm/models/components/realtimespeechsessionupdatepayload.js.map +1 -0
- package/esm/models/components/realtimespeechstreamingmode.d.ts +12 -0
- package/esm/models/components/realtimespeechstreamingmode.d.ts.map +1 -0
- package/esm/models/components/realtimespeechstreamingmode.js +13 -0
- package/esm/models/components/realtimespeechstreamingmode.js.map +1 -0
- package/esm/models/components/speechoutputformat.d.ts +2 -0
- package/esm/models/components/speechoutputformat.d.ts.map +1 -1
- package/esm/models/components/speechoutputformat.js +3 -1
- package/esm/models/components/speechoutputformat.js.map +1 -1
- package/esm/models/components/speechstreamaudiodelta.d.ts +8 -0
- package/esm/models/components/speechstreamaudiodelta.d.ts.map +1 -1
- package/esm/models/components/speechstreamaudiodelta.js +12 -0
- package/esm/models/components/speechstreamaudiodelta.js.map +1 -1
- package/esm/models/components/speechstreamdone.d.ts +10 -2
- package/esm/models/components/speechstreamdone.d.ts.map +1 -1
- package/esm/models/components/speechstreamdone.js +10 -2
- package/esm/models/components/speechstreamdone.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +12 -12
- package/src/extra/realtime/connection.ts +88 -13
- package/src/extra/realtime/errors.ts +32 -0
- package/src/extra/realtime/index.ts +42 -1
- package/src/extra/realtime/speech.ts +646 -0
- package/src/extra/realtime/transcription.ts +22 -9
- package/src/extra/workflows/encoding/payload-encoder.ts +2 -1
- package/src/extra/workflows/encoding/python-json.ts +34 -8
- package/src/funcs/betaRagManagedIndexesCreate.ts +1 -1
- package/src/lib/config.ts +2 -2
- package/src/models/components/connectionpreference.ts +15 -5
- package/src/models/components/index.ts +11 -5
- package/src/models/components/observabilityerrorcode.ts +2 -0
- package/src/models/components/realtimespeecherror.ts +59 -0
- package/src/models/components/realtimespeecherrordetail.ts +100 -0
- package/src/models/components/realtimespeechinputtextappend.ts +55 -0
- package/src/models/components/realtimespeechinputtextend.ts +49 -0
- package/src/models/components/realtimespeechinputtextflush.ts +55 -0
- package/src/models/components/realtimespeechsession.ts +98 -0
- package/src/models/components/realtimespeechsessioncreated.ts +61 -0
- package/src/models/components/realtimespeechsessionupdated.ts +61 -0
- package/src/models/components/realtimespeechsessionupdatemessage.ts +62 -0
- package/src/models/components/realtimespeechsessionupdatepayload.ts +108 -0
- package/src/models/components/realtimespeechstreamingmode.ts +23 -0
- package/src/models/components/speechoutputformat.ts +5 -1
- package/src/models/components/speechstreamaudiodelta.ts +25 -0
- package/src/models/components/speechstreamdone.ts +28 -5
- package/tests/extra/realtime-speech-ws.test.ts +193 -0
- package/tests/extra/realtime-speech.test.ts +532 -0
- package/tests/extra/realtime.test.ts +217 -0
- package/tests/extra/workflow-encryption.test.ts +2 -2
- package/tests/hooks/workflow-encoding.test.ts +1 -1
- package/esm/models/components/completiontokensdetails.d.ts +0 -19
- package/esm/models/components/completiontokensdetails.d.ts.map +0 -1
- package/esm/models/components/completiontokensdetails.js +0 -18
- package/esm/models/components/completiontokensdetails.js.map +0 -1
- package/esm/models/components/messagetokens.d.ts +0 -18
- package/esm/models/components/messagetokens.d.ts.map +0 -1
- package/esm/models/components/messagetokens.js +0 -26
- package/esm/models/components/messagetokens.js.map +0 -1
- package/esm/models/components/prompttokensdetails.d.ts +0 -16
- package/esm/models/components/prompttokensdetails.d.ts.map +0 -1
- package/esm/models/components/prompttokensdetails.js +0 -22
- package/esm/models/components/prompttokensdetails.js.map +0 -1
- package/esm/models/components/roles.d.ts +0 -12
- package/esm/models/components/roles.d.ts.map +0 -1
- package/esm/models/components/roles.js +0 -14
- package/esm/models/components/roles.js.map +0 -1
- package/esm/models/components/usageinfodollardefs.d.ts +0 -24
- package/esm/models/components/usageinfodollardefs.d.ts.map +0 -1
- package/esm/models/components/usageinfodollardefs.js +0 -41
- package/esm/models/components/usageinfodollardefs.js.map +0 -1
- package/src/models/components/completiontokensdetails.ts +0 -44
- package/src/models/components/messagetokens.ts +0 -47
- package/src/models/components/prompttokensdetails.ts +0 -44
- package/src/models/components/roles.ts +0 -19
- package/src/models/components/usageinfodollardefs.ts +0 -76
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
4
|
+
import { RealtimeSpeechSession, RealtimeSpeechSession$Outbound } from "./realtimespeechsession.js";
|
|
5
|
+
export type RealtimeSpeechSessionUpdated = {
|
|
6
|
+
type?: "session.updated" | undefined;
|
|
7
|
+
session: RealtimeSpeechSession;
|
|
8
|
+
};
|
|
9
|
+
/** @internal */
|
|
10
|
+
export declare const RealtimeSpeechSessionUpdated$inboundSchema: z.ZodType<RealtimeSpeechSessionUpdated, unknown>;
|
|
11
|
+
/** @internal */
|
|
12
|
+
export type RealtimeSpeechSessionUpdated$Outbound = {
|
|
13
|
+
type: "session.updated";
|
|
14
|
+
session: RealtimeSpeechSession$Outbound;
|
|
15
|
+
};
|
|
16
|
+
/** @internal */
|
|
17
|
+
export declare const RealtimeSpeechSessionUpdated$outboundSchema: z.ZodType<RealtimeSpeechSessionUpdated$Outbound, RealtimeSpeechSessionUpdated>;
|
|
18
|
+
export declare function realtimeSpeechSessionUpdatedToJSON(realtimeSpeechSessionUpdated: RealtimeSpeechSessionUpdated): string;
|
|
19
|
+
export declare function realtimeSpeechSessionUpdatedFromJSON(jsonString: string): SafeParseResult<RealtimeSpeechSessionUpdated, SDKValidationError>;
|
|
20
|
+
//# sourceMappingURL=realtimespeechsessionupdated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"realtimespeechsessionupdated.d.ts","sourceRoot":"","sources":["../../../src/models/components/realtimespeechsessionupdated.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EACL,qBAAqB,EAErB,8BAA8B,EAE/B,MAAM,4BAA4B,CAAC;AAEpC,MAAM,MAAM,4BAA4B,GAAG;IACzC,IAAI,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACrC,OAAO,EAAE,qBAAqB,CAAC;CAChC,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,0CAA0C,EAAE,CAAC,CAAC,OAAO,CAChE,4BAA4B,EAC5B,OAAO,CAIP,CAAC;AACH,gBAAgB;AAChB,MAAM,MAAM,qCAAqC,GAAG;IAClD,IAAI,EAAE,iBAAiB,CAAC;IACxB,OAAO,EAAE,8BAA8B,CAAC;CACzC,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,2CAA2C,EAAE,CAAC,CAAC,OAAO,CACjE,qCAAqC,EACrC,4BAA4B,CAI5B,CAAC;AAEH,wBAAgB,kCAAkC,CAChD,4BAA4B,EAAE,4BAA4B,GACzD,MAAM,CAMR;AACD,wBAAgB,oCAAoC,CAClD,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,CAMnE"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4";
|
|
5
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
6
|
+
import { RealtimeSpeechSession$inboundSchema, RealtimeSpeechSession$outboundSchema, } from "./realtimespeechsession.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const RealtimeSpeechSessionUpdated$inboundSchema = z.object({
|
|
9
|
+
type: z.literal("session.updated").default("session.updated"),
|
|
10
|
+
session: RealtimeSpeechSession$inboundSchema,
|
|
11
|
+
});
|
|
12
|
+
/** @internal */
|
|
13
|
+
export const RealtimeSpeechSessionUpdated$outboundSchema = z.object({
|
|
14
|
+
type: z.literal("session.updated").default("session.updated"),
|
|
15
|
+
session: RealtimeSpeechSession$outboundSchema,
|
|
16
|
+
});
|
|
17
|
+
export function realtimeSpeechSessionUpdatedToJSON(realtimeSpeechSessionUpdated) {
|
|
18
|
+
return JSON.stringify(RealtimeSpeechSessionUpdated$outboundSchema.parse(realtimeSpeechSessionUpdated));
|
|
19
|
+
}
|
|
20
|
+
export function realtimeSpeechSessionUpdatedFromJSON(jsonString) {
|
|
21
|
+
return safeParse(jsonString, (x) => RealtimeSpeechSessionUpdated$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RealtimeSpeechSessionUpdated' from JSON`);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=realtimespeechsessionupdated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"realtimespeechsessionupdated.js","sourceRoot":"","sources":["../../../src/models/components/realtimespeechsessionupdated.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGjD,OAAO,EAEL,mCAAmC,EAEnC,oCAAoC,GACrC,MAAM,4BAA4B,CAAC;AAOpC,gBAAgB;AAChB,MAAM,CAAC,MAAM,0CAA0C,GAGnD,CAAC,CAAC,MAAM,CAAC;IACX,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC;IAC7D,OAAO,EAAE,mCAAmC;CAC7C,CAAC,CAAC;AAOH,gBAAgB;AAChB,MAAM,CAAC,MAAM,2CAA2C,GAGpD,CAAC,CAAC,MAAM,CAAC;IACX,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,iBAA0B,CAAC;IACtE,OAAO,EAAE,oCAAoC;CAC9C,CAAC,CAAC;AAEH,MAAM,UAAU,kCAAkC,CAChD,4BAA0D,EAClD;IACR,OAAO,IAAI,CAAC,SAAS,CACnB,2CAA2C,CAAC,KAAK,CAC/C,4BAA4B,CAC7B,CACF,CAAC;AAAA,CACH;AACD,MAAM,UAAU,oCAAoC,CAClD,UAAkB,EACiD;IACnE,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,0CAA0C,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACtE,0DAA0D,CAC3D,CAAC;AAAA,CACH"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
4
|
+
import { RealtimeSpeechSessionUpdatePayload, RealtimeSpeechSessionUpdatePayload$Outbound } from "./realtimespeechsessionupdatepayload.js";
|
|
5
|
+
export type RealtimeSpeechSessionUpdateMessage = {
|
|
6
|
+
type?: "session.update" | undefined;
|
|
7
|
+
session: RealtimeSpeechSessionUpdatePayload;
|
|
8
|
+
};
|
|
9
|
+
/** @internal */
|
|
10
|
+
export declare const RealtimeSpeechSessionUpdateMessage$inboundSchema: z.ZodType<RealtimeSpeechSessionUpdateMessage, unknown>;
|
|
11
|
+
/** @internal */
|
|
12
|
+
export type RealtimeSpeechSessionUpdateMessage$Outbound = {
|
|
13
|
+
type: "session.update";
|
|
14
|
+
session: RealtimeSpeechSessionUpdatePayload$Outbound;
|
|
15
|
+
};
|
|
16
|
+
/** @internal */
|
|
17
|
+
export declare const RealtimeSpeechSessionUpdateMessage$outboundSchema: z.ZodType<RealtimeSpeechSessionUpdateMessage$Outbound, RealtimeSpeechSessionUpdateMessage>;
|
|
18
|
+
export declare function realtimeSpeechSessionUpdateMessageToJSON(realtimeSpeechSessionUpdateMessage: RealtimeSpeechSessionUpdateMessage): string;
|
|
19
|
+
export declare function realtimeSpeechSessionUpdateMessageFromJSON(jsonString: string): SafeParseResult<RealtimeSpeechSessionUpdateMessage, SDKValidationError>;
|
|
20
|
+
//# sourceMappingURL=realtimespeechsessionupdatemessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"realtimespeechsessionupdatemessage.d.ts","sourceRoot":"","sources":["../../../src/models/components/realtimespeechsessionupdatemessage.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EACL,kCAAkC,EAElC,2CAA2C,EAE5C,MAAM,yCAAyC,CAAC;AAEjD,MAAM,MAAM,kCAAkC,GAAG;IAC/C,IAAI,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;IACpC,OAAO,EAAE,kCAAkC,CAAC;CAC7C,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,gDAAgD,EAAE,CAAC,CAAC,OAAO,CACtE,kCAAkC,EAClC,OAAO,CAIP,CAAC;AACH,gBAAgB;AAChB,MAAM,MAAM,2CAA2C,GAAG;IACxD,IAAI,EAAE,gBAAgB,CAAC;IACvB,OAAO,EAAE,2CAA2C,CAAC;CACtD,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,iDAAiD,EAAE,CAAC,CAAC,OAAO,CACvE,2CAA2C,EAC3C,kCAAkC,CAIlC,CAAC;AAEH,wBAAgB,wCAAwC,CACtD,kCAAkC,EAAE,kCAAkC,GACrE,MAAM,CAMR;AACD,wBAAgB,0CAA0C,CACxD,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,kCAAkC,EAAE,kBAAkB,CAAC,CAOzE"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4";
|
|
5
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
6
|
+
import { RealtimeSpeechSessionUpdatePayload$inboundSchema, RealtimeSpeechSessionUpdatePayload$outboundSchema, } from "./realtimespeechsessionupdatepayload.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const RealtimeSpeechSessionUpdateMessage$inboundSchema = z.object({
|
|
9
|
+
type: z.literal("session.update").default("session.update"),
|
|
10
|
+
session: RealtimeSpeechSessionUpdatePayload$inboundSchema,
|
|
11
|
+
});
|
|
12
|
+
/** @internal */
|
|
13
|
+
export const RealtimeSpeechSessionUpdateMessage$outboundSchema = z.object({
|
|
14
|
+
type: z.literal("session.update").default("session.update"),
|
|
15
|
+
session: RealtimeSpeechSessionUpdatePayload$outboundSchema,
|
|
16
|
+
});
|
|
17
|
+
export function realtimeSpeechSessionUpdateMessageToJSON(realtimeSpeechSessionUpdateMessage) {
|
|
18
|
+
return JSON.stringify(RealtimeSpeechSessionUpdateMessage$outboundSchema.parse(realtimeSpeechSessionUpdateMessage));
|
|
19
|
+
}
|
|
20
|
+
export function realtimeSpeechSessionUpdateMessageFromJSON(jsonString) {
|
|
21
|
+
return safeParse(jsonString, (x) => RealtimeSpeechSessionUpdateMessage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RealtimeSpeechSessionUpdateMessage' from JSON`);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=realtimespeechsessionupdatemessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"realtimespeechsessionupdatemessage.js","sourceRoot":"","sources":["../../../src/models/components/realtimespeechsessionupdatemessage.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGjD,OAAO,EAEL,gDAAgD,EAEhD,iDAAiD,GAClD,MAAM,yCAAyC,CAAC;AAOjD,gBAAgB;AAChB,MAAM,CAAC,MAAM,gDAAgD,GAGzD,CAAC,CAAC,MAAM,CAAC;IACX,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC;IAC3D,OAAO,EAAE,gDAAgD;CAC1D,CAAC,CAAC;AAOH,gBAAgB;AAChB,MAAM,CAAC,MAAM,iDAAiD,GAG1D,CAAC,CAAC,MAAM,CAAC;IACX,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC,gBAAyB,CAAC;IACpE,OAAO,EAAE,iDAAiD;CAC3D,CAAC,CAAC;AAEH,MAAM,UAAU,wCAAwC,CACtD,kCAAsE,EAC9D;IACR,OAAO,IAAI,CAAC,SAAS,CACnB,iDAAiD,CAAC,KAAK,CACrD,kCAAkC,CACnC,CACF,CAAC;AAAA,CACH;AACD,MAAM,UAAU,0CAA0C,CACxD,UAAkB,EACuD;IACzE,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CACJ,gDAAgD,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACvE,gEAAgE,CACjE,CAAC;AAAA,CACH"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
4
|
+
import { RealtimeSpeechStreamingMode } from "./realtimespeechstreamingmode.js";
|
|
5
|
+
import { SpeechOutputFormat } from "./speechoutputformat.js";
|
|
6
|
+
export type RealtimeSpeechSessionUpdatePayload = {
|
|
7
|
+
/**
|
|
8
|
+
* Preset voice identifier. Mutually exclusive with ref_audio and voice_profile.
|
|
9
|
+
*/
|
|
10
|
+
voice?: string | null | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Base64-encoded reference audio. Mutually exclusive with voice and voice_profile.
|
|
13
|
+
*/
|
|
14
|
+
refAudio?: string | null | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* responsive (default): short chunks, for conversational turns. long_form: chunks grow as the text goes on, for smoother delivery of long texts.
|
|
17
|
+
*/
|
|
18
|
+
streamingMode?: RealtimeSpeechStreamingMode | null | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Audio encoding of speech.audio.delta events. pcm is raw 32-bit float little-endian mono.
|
|
21
|
+
*/
|
|
22
|
+
responseFormat?: SpeechOutputFormat | null | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Higher values make the delivery more expressive. Minimum 1.0.
|
|
25
|
+
*/
|
|
26
|
+
expressiveness?: number | null | undefined;
|
|
27
|
+
};
|
|
28
|
+
/** @internal */
|
|
29
|
+
export declare const RealtimeSpeechSessionUpdatePayload$inboundSchema: z.ZodType<RealtimeSpeechSessionUpdatePayload, unknown>;
|
|
30
|
+
/** @internal */
|
|
31
|
+
export type RealtimeSpeechSessionUpdatePayload$Outbound = {
|
|
32
|
+
voice?: string | null | undefined;
|
|
33
|
+
ref_audio?: string | null | undefined;
|
|
34
|
+
streaming_mode?: string | null | undefined;
|
|
35
|
+
response_format?: string | null | undefined;
|
|
36
|
+
expressiveness?: number | null | undefined;
|
|
37
|
+
};
|
|
38
|
+
/** @internal */
|
|
39
|
+
export declare const RealtimeSpeechSessionUpdatePayload$outboundSchema: z.ZodType<RealtimeSpeechSessionUpdatePayload$Outbound, RealtimeSpeechSessionUpdatePayload>;
|
|
40
|
+
export declare function realtimeSpeechSessionUpdatePayloadToJSON(realtimeSpeechSessionUpdatePayload: RealtimeSpeechSessionUpdatePayload): string;
|
|
41
|
+
export declare function realtimeSpeechSessionUpdatePayloadFromJSON(jsonString: string): SafeParseResult<RealtimeSpeechSessionUpdatePayload, SDKValidationError>;
|
|
42
|
+
//# sourceMappingURL=realtimespeechsessionupdatepayload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"realtimespeechsessionupdatepayload.d.ts","sourceRoot":"","sources":["../../../src/models/components/realtimespeechsessionupdatepayload.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EACL,2BAA2B,EAG5B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,kBAAkB,EAGnB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,kCAAkC,GAAG;IAC/C;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAClC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACrC;;OAEG;IACH,aAAa,CAAC,EAAE,2BAA2B,GAAG,IAAI,GAAG,SAAS,CAAC;IAC/D;;OAEG;IACH,cAAc,CAAC,EAAE,kBAAkB,GAAG,IAAI,GAAG,SAAS,CAAC;IACvD;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CAC5C,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,gDAAgD,EAAE,CAAC,CAAC,OAAO,CACtE,kCAAkC,EAClC,OAAO,CAcP,CAAC;AACH,gBAAgB;AAChB,MAAM,MAAM,2CAA2C,GAAG;IACxD,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACtC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3C,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC5C,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CAC5C,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,iDAAiD,EAAE,CAAC,CAAC,OAAO,CACvE,2CAA2C,EAC3C,kCAAkC,CAclC,CAAC;AAEH,wBAAgB,wCAAwC,CACtD,kCAAkC,EAAE,kCAAkC,GACrE,MAAM,CAMR;AACD,wBAAgB,0CAA0C,CACxD,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,kCAAkC,EAAE,kBAAkB,CAAC,CAOzE"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4";
|
|
5
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { RealtimeSpeechStreamingMode$inboundSchema, RealtimeSpeechStreamingMode$outboundSchema, } from "./realtimespeechstreamingmode.js";
|
|
8
|
+
import { SpeechOutputFormat$inboundSchema, SpeechOutputFormat$outboundSchema, } from "./speechoutputformat.js";
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const RealtimeSpeechSessionUpdatePayload$inboundSchema = z.object({
|
|
11
|
+
voice: z.nullable(z.string()).optional(),
|
|
12
|
+
ref_audio: z.nullable(z.string()).optional(),
|
|
13
|
+
streaming_mode: z.nullable(RealtimeSpeechStreamingMode$inboundSchema)
|
|
14
|
+
.optional(),
|
|
15
|
+
response_format: z.nullable(SpeechOutputFormat$inboundSchema).optional(),
|
|
16
|
+
expressiveness: z.nullable(z.number()).optional(),
|
|
17
|
+
}).transform((v) => {
|
|
18
|
+
return remap$(v, {
|
|
19
|
+
"ref_audio": "refAudio",
|
|
20
|
+
"streaming_mode": "streamingMode",
|
|
21
|
+
"response_format": "responseFormat",
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const RealtimeSpeechSessionUpdatePayload$outboundSchema = z.object({
|
|
26
|
+
voice: z.nullable(z.string()).optional(),
|
|
27
|
+
refAudio: z.nullable(z.string()).optional(),
|
|
28
|
+
streamingMode: z.nullable(RealtimeSpeechStreamingMode$outboundSchema)
|
|
29
|
+
.optional(),
|
|
30
|
+
responseFormat: z.nullable(SpeechOutputFormat$outboundSchema).optional(),
|
|
31
|
+
expressiveness: z.nullable(z.number()).optional(),
|
|
32
|
+
}).transform((v) => {
|
|
33
|
+
return remap$(v, {
|
|
34
|
+
refAudio: "ref_audio",
|
|
35
|
+
streamingMode: "streaming_mode",
|
|
36
|
+
responseFormat: "response_format",
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
export function realtimeSpeechSessionUpdatePayloadToJSON(realtimeSpeechSessionUpdatePayload) {
|
|
40
|
+
return JSON.stringify(RealtimeSpeechSessionUpdatePayload$outboundSchema.parse(realtimeSpeechSessionUpdatePayload));
|
|
41
|
+
}
|
|
42
|
+
export function realtimeSpeechSessionUpdatePayloadFromJSON(jsonString) {
|
|
43
|
+
return safeParse(jsonString, (x) => RealtimeSpeechSessionUpdatePayload$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RealtimeSpeechSessionUpdatePayload' from JSON`);
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=realtimespeechsessionupdatepayload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"realtimespeechsessionupdatepayload.js","sourceRoot":"","sources":["../../../src/models/components/realtimespeechsessionupdatepayload.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGjD,OAAO,EAEL,yCAAyC,EACzC,0CAA0C,GAC3C,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAEL,gCAAgC,EAChC,iCAAiC,GAClC,MAAM,yBAAyB,CAAC;AAyBjC,gBAAgB;AAChB,MAAM,CAAC,MAAM,gDAAgD,GAGzD,CAAC,CAAC,MAAM,CAAC;IACX,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACxC,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC5C,cAAc,EAAE,CAAC,CAAC,QAAQ,CAAC,yCAAyC,CAAC;SAClE,QAAQ,EAAE;IACb,eAAe,EAAE,CAAC,CAAC,QAAQ,CAAC,gCAAgC,CAAC,CAAC,QAAQ,EAAE;IACxE,cAAc,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CAClD,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAClB,OAAO,MAAM,CAAC,CAAC,EAAE;QACf,WAAW,EAAE,UAAU;QACvB,gBAAgB,EAAE,eAAe;QACjC,iBAAiB,EAAE,gBAAgB;KACpC,CAAC,CAAC;AAAA,CACJ,CAAC,CAAC;AAUH,gBAAgB;AAChB,MAAM,CAAC,MAAM,iDAAiD,GAG1D,CAAC,CAAC,MAAM,CAAC;IACX,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACxC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC3C,aAAa,EAAE,CAAC,CAAC,QAAQ,CAAC,0CAA0C,CAAC;SAClE,QAAQ,EAAE;IACb,cAAc,EAAE,CAAC,CAAC,QAAQ,CAAC,iCAAiC,CAAC,CAAC,QAAQ,EAAE;IACxE,cAAc,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CAClD,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAClB,OAAO,MAAM,CAAC,CAAC,EAAE;QACf,QAAQ,EAAE,WAAW;QACrB,aAAa,EAAE,gBAAgB;QAC/B,cAAc,EAAE,iBAAiB;KAClC,CAAC,CAAC;AAAA,CACJ,CAAC,CAAC;AAEH,MAAM,UAAU,wCAAwC,CACtD,kCAAsE,EAC9D;IACR,OAAO,IAAI,CAAC,SAAS,CACnB,iDAAiD,CAAC,KAAK,CACrD,kCAAkC,CACnC,CACF,CAAC;AAAA,CACH;AACD,MAAM,UAAU,0CAA0C,CACxD,UAAkB,EACuD;IACzE,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CACJ,gDAAgD,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACvE,gEAAgE,CACjE,CAAC;AAAA,CACH"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
3
|
+
export declare const RealtimeSpeechStreamingMode: {
|
|
4
|
+
readonly Responsive: "responsive";
|
|
5
|
+
readonly LongForm: "long_form";
|
|
6
|
+
};
|
|
7
|
+
export type RealtimeSpeechStreamingMode = ClosedEnum<typeof RealtimeSpeechStreamingMode>;
|
|
8
|
+
/** @internal */
|
|
9
|
+
export declare const RealtimeSpeechStreamingMode$inboundSchema: z.ZodEnum<typeof RealtimeSpeechStreamingMode>;
|
|
10
|
+
/** @internal */
|
|
11
|
+
export declare const RealtimeSpeechStreamingMode$outboundSchema: z.ZodEnum<typeof RealtimeSpeechStreamingMode>;
|
|
12
|
+
//# sourceMappingURL=realtimespeechstreamingmode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"realtimespeechstreamingmode.d.ts","sourceRoot":"","sources":["../../../src/models/components/realtimespeechstreamingmode.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,eAAO,MAAM,2BAA2B;;;CAG9B,CAAC;AACX,MAAM,MAAM,2BAA2B,GAAG,UAAU,CAClD,OAAO,2BAA2B,CACnC,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,yCAAyC,EAAE,CAAC,CAAC,OAAO,CAC/D,OAAO,2BAA2B,CACG,CAAC;AACxC,gBAAgB;AAChB,eAAO,MAAM,0CAA0C,EAAE,CAAC,CAAC,OAAO,CAChE,OAAO,2BAA2B,CACS,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4";
|
|
5
|
+
export const RealtimeSpeechStreamingMode = {
|
|
6
|
+
Responsive: "responsive",
|
|
7
|
+
LongForm: "long_form",
|
|
8
|
+
};
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const RealtimeSpeechStreamingMode$inboundSchema = z.enum(RealtimeSpeechStreamingMode);
|
|
11
|
+
/** @internal */
|
|
12
|
+
export const RealtimeSpeechStreamingMode$outboundSchema = RealtimeSpeechStreamingMode$inboundSchema;
|
|
13
|
+
//# sourceMappingURL=realtimespeechstreamingmode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"realtimespeechstreamingmode.js","sourceRoot":"","sources":["../../../src/models/components/realtimespeechstreamingmode.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,UAAU,EAAE,YAAY;IACxB,QAAQ,EAAE,WAAW;CACb,CAAC;AAKX,gBAAgB;AAChB,MAAM,CAAC,MAAM,yCAAyC,GAElD,CAAC,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;AACxC,gBAAgB;AAChB,MAAM,CAAC,MAAM,0CAA0C,GAEnD,yCAAyC,CAAC"}
|
|
@@ -9,5 +9,7 @@ export declare const SpeechOutputFormat: {
|
|
|
9
9
|
};
|
|
10
10
|
export type SpeechOutputFormat = ClosedEnum<typeof SpeechOutputFormat>;
|
|
11
11
|
/** @internal */
|
|
12
|
+
export declare const SpeechOutputFormat$inboundSchema: z.ZodEnum<typeof SpeechOutputFormat>;
|
|
13
|
+
/** @internal */
|
|
12
14
|
export declare const SpeechOutputFormat$outboundSchema: z.ZodEnum<typeof SpeechOutputFormat>;
|
|
13
15
|
//# sourceMappingURL=speechoutputformat.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speechoutputformat.d.ts","sourceRoot":"","sources":["../../../src/models/components/speechoutputformat.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,eAAO,MAAM,kBAAkB;;;;;;CAMrB,CAAC;AACX,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEvE,gBAAgB;AAChB,eAAO,MAAM,iCAAiC,EAAE,CAAC,CAAC,OAAO,CACvD,OAAO,kBAAkB,
|
|
1
|
+
{"version":3,"file":"speechoutputformat.d.ts","sourceRoot":"","sources":["../../../src/models/components/speechoutputformat.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,eAAO,MAAM,kBAAkB;;;;;;CAMrB,CAAC;AACX,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEvE,gBAAgB;AAChB,eAAO,MAAM,gCAAgC,EAAE,CAAC,CAAC,OAAO,CACtD,OAAO,kBAAkB,CACG,CAAC;AAC/B,gBAAgB;AAChB,eAAO,MAAM,iCAAiC,EAAE,CAAC,CAAC,OAAO,CACvD,OAAO,kBAAkB,CACS,CAAC"}
|
|
@@ -10,5 +10,7 @@ export const SpeechOutputFormat = {
|
|
|
10
10
|
Opus: "opus",
|
|
11
11
|
};
|
|
12
12
|
/** @internal */
|
|
13
|
-
export const SpeechOutputFormat$
|
|
13
|
+
export const SpeechOutputFormat$inboundSchema = z.enum(SpeechOutputFormat);
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const SpeechOutputFormat$outboundSchema = SpeechOutputFormat$inboundSchema;
|
|
14
16
|
//# sourceMappingURL=speechoutputformat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speechoutputformat.js","sourceRoot":"","sources":["../../../src/models/components/speechoutputformat.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;CACJ,CAAC;AAGX,gBAAgB;AAChB,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"speechoutputformat.js","sourceRoot":"","sources":["../../../src/models/components/speechoutputformat.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;CACJ,CAAC;AAGX,gBAAgB;AAChB,MAAM,CAAC,MAAM,gCAAgC,GAEzC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;AAC/B,gBAAgB;AAChB,MAAM,CAAC,MAAM,iCAAiC,GAE1C,gCAAgC,CAAC"}
|
|
@@ -7,5 +7,13 @@ export type SpeechStreamAudioDelta = {
|
|
|
7
7
|
};
|
|
8
8
|
/** @internal */
|
|
9
9
|
export declare const SpeechStreamAudioDelta$inboundSchema: z.ZodType<SpeechStreamAudioDelta, unknown>;
|
|
10
|
+
/** @internal */
|
|
11
|
+
export type SpeechStreamAudioDelta$Outbound = {
|
|
12
|
+
type: "speech.audio.delta";
|
|
13
|
+
audio_data: string;
|
|
14
|
+
};
|
|
15
|
+
/** @internal */
|
|
16
|
+
export declare const SpeechStreamAudioDelta$outboundSchema: z.ZodType<SpeechStreamAudioDelta$Outbound, SpeechStreamAudioDelta>;
|
|
17
|
+
export declare function speechStreamAudioDeltaToJSON(speechStreamAudioDelta: SpeechStreamAudioDelta): string;
|
|
10
18
|
export declare function speechStreamAudioDeltaFromJSON(jsonString: string): SafeParseResult<SpeechStreamAudioDelta, SDKValidationError>;
|
|
11
19
|
//# sourceMappingURL=speechstreamaudiodelta.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speechstreamaudiodelta.d.ts","sourceRoot":"","sources":["../../../src/models/components/speechstreamaudiodelta.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,oBAAoB,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,oCAAoC,EAAE,CAAC,CAAC,OAAO,CAC1D,sBAAsB,EACtB,OAAO,CAQP,CAAC;AAEH,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,sBAAsB,EAAE,kBAAkB,CAAC,CAM7D"}
|
|
1
|
+
{"version":3,"file":"speechstreamaudiodelta.d.ts","sourceRoot":"","sources":["../../../src/models/components/speechstreamaudiodelta.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,oBAAoB,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,oCAAoC,EAAE,CAAC,CAAC,OAAO,CAC1D,sBAAsB,EACtB,OAAO,CAQP,CAAC;AACH,gBAAgB;AAChB,MAAM,MAAM,+BAA+B,GAAG;IAC5C,IAAI,EAAE,oBAAoB,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,qCAAqC,EAAE,CAAC,CAAC,OAAO,CAC3D,+BAA+B,EAC/B,sBAAsB,CAQtB,CAAC;AAEH,wBAAgB,4BAA4B,CAC1C,sBAAsB,EAAE,sBAAsB,GAC7C,MAAM,CAIR;AACD,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,sBAAsB,EAAE,kBAAkB,CAAC,CAM7D"}
|
|
@@ -13,6 +13,18 @@ export const SpeechStreamAudioDelta$inboundSchema = z.object({
|
|
|
13
13
|
"audio_data": "audioData",
|
|
14
14
|
});
|
|
15
15
|
});
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const SpeechStreamAudioDelta$outboundSchema = z.object({
|
|
18
|
+
type: z.literal("speech.audio.delta"),
|
|
19
|
+
audioData: z.string(),
|
|
20
|
+
}).transform((v) => {
|
|
21
|
+
return remap$(v, {
|
|
22
|
+
audioData: "audio_data",
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
export function speechStreamAudioDeltaToJSON(speechStreamAudioDelta) {
|
|
26
|
+
return JSON.stringify(SpeechStreamAudioDelta$outboundSchema.parse(speechStreamAudioDelta));
|
|
27
|
+
}
|
|
16
28
|
export function speechStreamAudioDeltaFromJSON(jsonString) {
|
|
17
29
|
return safeParse(jsonString, (x) => SpeechStreamAudioDelta$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SpeechStreamAudioDelta' from JSON`);
|
|
18
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speechstreamaudiodelta.js","sourceRoot":"","sources":["../../../src/models/components/speechstreamaudiodelta.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AASjD,gBAAgB;AAChB,MAAM,CAAC,MAAM,oCAAoC,GAG7C,CAAC,CAAC,MAAM,CAAC;IACX,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC;IACrC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;CACvB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAClB,OAAO,MAAM,CAAC,CAAC,EAAE;QACf,YAAY,EAAE,WAAW;KAC1B,CAAC,CAAC;AAAA,CACJ,CAAC,CAAC;AAEH,MAAM,UAAU,8BAA8B,CAC5C,UAAkB,EAC2C;IAC7D,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,oCAAoC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAChE,oDAAoD,CACrD,CAAC;AAAA,CACH"}
|
|
1
|
+
{"version":3,"file":"speechstreamaudiodelta.js","sourceRoot":"","sources":["../../../src/models/components/speechstreamaudiodelta.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AASjD,gBAAgB;AAChB,MAAM,CAAC,MAAM,oCAAoC,GAG7C,CAAC,CAAC,MAAM,CAAC;IACX,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC;IACrC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;CACvB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAClB,OAAO,MAAM,CAAC,CAAC,EAAE;QACf,YAAY,EAAE,WAAW;KAC1B,CAAC,CAAC;AAAA,CACJ,CAAC,CAAC;AAOH,gBAAgB;AAChB,MAAM,CAAC,MAAM,qCAAqC,GAG9C,CAAC,CAAC,MAAM,CAAC;IACX,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC;IACrC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAClB,OAAO,MAAM,CAAC,CAAC,EAAE;QACf,SAAS,EAAE,YAAY;KACxB,CAAC,CAAC;AAAA,CACJ,CAAC,CAAC;AAEH,MAAM,UAAU,4BAA4B,CAC1C,sBAA8C,EACtC;IACR,OAAO,IAAI,CAAC,SAAS,CACnB,qCAAqC,CAAC,KAAK,CAAC,sBAAsB,CAAC,CACpE,CAAC;AAAA,CACH;AACD,MAAM,UAAU,8BAA8B,CAC5C,UAAkB,EAC2C;IAC7D,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,oCAAoC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAChE,oDAAoD,CACrD,CAAC;AAAA,CACH"}
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
3
3
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
4
|
-
import {
|
|
4
|
+
import { UsageInfo, UsageInfo$Outbound } from "./usageinfo.js";
|
|
5
5
|
export type SpeechStreamDone = {
|
|
6
6
|
type: "speech.audio.done";
|
|
7
|
-
usage:
|
|
7
|
+
usage: UsageInfo;
|
|
8
8
|
};
|
|
9
9
|
/** @internal */
|
|
10
10
|
export declare const SpeechStreamDone$inboundSchema: z.ZodType<SpeechStreamDone, unknown>;
|
|
11
|
+
/** @internal */
|
|
12
|
+
export type SpeechStreamDone$Outbound = {
|
|
13
|
+
type: "speech.audio.done";
|
|
14
|
+
usage: UsageInfo$Outbound;
|
|
15
|
+
};
|
|
16
|
+
/** @internal */
|
|
17
|
+
export declare const SpeechStreamDone$outboundSchema: z.ZodType<SpeechStreamDone$Outbound, SpeechStreamDone>;
|
|
18
|
+
export declare function speechStreamDoneToJSON(speechStreamDone: SpeechStreamDone): string;
|
|
11
19
|
export declare function speechStreamDoneFromJSON(jsonString: string): SafeParseResult<SpeechStreamDone, SDKValidationError>;
|
|
12
20
|
//# sourceMappingURL=speechstreamdone.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speechstreamdone.d.ts","sourceRoot":"","sources":["../../../src/models/components/speechstreamdone.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"speechstreamdone.d.ts","sourceRoot":"","sources":["../../../src/models/components/speechstreamdone.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EACL,SAAS,EAET,kBAAkB,EAEnB,MAAM,gBAAgB,CAAC;AAExB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,mBAAmB,CAAC;IAC1B,KAAK,EAAE,SAAS,CAAC;CAClB,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,8BAA8B,EAAE,CAAC,CAAC,OAAO,CACpD,gBAAgB,EAChB,OAAO,CAIP,CAAC;AACH,gBAAgB;AAChB,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,EAAE,mBAAmB,CAAC;IAC1B,KAAK,EAAE,kBAAkB,CAAC;CAC3B,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,+BAA+B,EAAE,CAAC,CAAC,OAAO,CACrD,yBAAyB,EACzB,gBAAgB,CAIhB,CAAC;AAEH,wBAAgB,sBAAsB,CACpC,gBAAgB,EAAE,gBAAgB,GACjC,MAAM,CAIR;AACD,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAMvD"}
|
|
@@ -3,12 +3,20 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as z from "zod/v4";
|
|
5
5
|
import { safeParse } from "../../lib/schemas.js";
|
|
6
|
-
import {
|
|
6
|
+
import { UsageInfo$inboundSchema, UsageInfo$outboundSchema, } from "./usageinfo.js";
|
|
7
7
|
/** @internal */
|
|
8
8
|
export const SpeechStreamDone$inboundSchema = z.object({
|
|
9
9
|
type: z.literal("speech.audio.done"),
|
|
10
|
-
usage:
|
|
10
|
+
usage: UsageInfo$inboundSchema,
|
|
11
11
|
});
|
|
12
|
+
/** @internal */
|
|
13
|
+
export const SpeechStreamDone$outboundSchema = z.object({
|
|
14
|
+
type: z.literal("speech.audio.done"),
|
|
15
|
+
usage: UsageInfo$outboundSchema,
|
|
16
|
+
});
|
|
17
|
+
export function speechStreamDoneToJSON(speechStreamDone) {
|
|
18
|
+
return JSON.stringify(SpeechStreamDone$outboundSchema.parse(speechStreamDone));
|
|
19
|
+
}
|
|
12
20
|
export function speechStreamDoneFromJSON(jsonString) {
|
|
13
21
|
return safeParse(jsonString, (x) => SpeechStreamDone$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SpeechStreamDone' from JSON`);
|
|
14
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speechstreamdone.js","sourceRoot":"","sources":["../../../src/models/components/speechstreamdone.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGjD,OAAO,EAEL,
|
|
1
|
+
{"version":3,"file":"speechstreamdone.js","sourceRoot":"","sources":["../../../src/models/components/speechstreamdone.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGjD,OAAO,EAEL,uBAAuB,EAEvB,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AAOxB,gBAAgB;AAChB,MAAM,CAAC,MAAM,8BAA8B,GAGvC,CAAC,CAAC,MAAM,CAAC;IACX,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC;IACpC,KAAK,EAAE,uBAAuB;CAC/B,CAAC,CAAC;AAOH,gBAAgB;AAChB,MAAM,CAAC,MAAM,+BAA+B,GAGxC,CAAC,CAAC,MAAM,CAAC;IACX,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC;IACpC,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAC;AAEH,MAAM,UAAU,sBAAsB,CACpC,gBAAkC,EAC1B;IACR,OAAO,IAAI,CAAC,SAAS,CACnB,+BAA+B,CAAC,KAAK,CAAC,gBAAgB,CAAC,CACxD,CAAC;AAAA,CACH;AACD,MAAM,UAAU,wBAAwB,CACtC,UAAkB,EACqC;IACvD,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,8BAA8B,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAC1D,8CAA8C,CAC/C,CAAC;AAAA,CACH"}
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mistralai/mistralai",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"author": "Mistral AI",
|
|
5
5
|
"description": "TypeScript client library for the Mistral AI API",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"peerDependenciesMeta": {
|
|
8
|
-
"@
|
|
8
|
+
"@opentelemetry/resources": {
|
|
9
9
|
"optional": true
|
|
10
10
|
},
|
|
11
11
|
"@hpcc-js/wasm-zstd": {
|
|
12
12
|
"optional": true
|
|
13
13
|
},
|
|
14
|
-
"@livekit/rtc-node": {
|
|
15
|
-
"optional": true
|
|
16
|
-
},
|
|
17
14
|
"@opentelemetry/api": {
|
|
18
15
|
"optional": true
|
|
19
16
|
},
|
|
20
|
-
"@opentelemetry/
|
|
17
|
+
"@opentelemetry/sdk-trace-base": {
|
|
21
18
|
"optional": true
|
|
22
19
|
},
|
|
23
|
-
"
|
|
20
|
+
"livekit-client": {
|
|
24
21
|
"optional": true
|
|
25
22
|
},
|
|
26
23
|
"@aws-sdk/client-s3": {
|
|
27
24
|
"optional": true
|
|
28
25
|
},
|
|
29
|
-
"@
|
|
26
|
+
"@azure/identity": {
|
|
30
27
|
"optional": true
|
|
31
28
|
},
|
|
32
|
-
"@
|
|
29
|
+
"@azure/storage-blob": {
|
|
33
30
|
"optional": true
|
|
34
31
|
},
|
|
35
|
-
"
|
|
32
|
+
"@google-cloud/storage": {
|
|
36
33
|
"optional": true
|
|
37
34
|
},
|
|
38
|
-
"@
|
|
35
|
+
"@livekit/rtc-node": {
|
|
39
36
|
"optional": true
|
|
40
37
|
},
|
|
41
|
-
"@
|
|
38
|
+
"@msgpack/msgpack": {
|
|
39
|
+
"optional": true
|
|
40
|
+
},
|
|
41
|
+
"@opentelemetry/exporter-trace-otlp-http": {
|
|
42
42
|
"optional": true
|
|
43
43
|
}
|
|
44
44
|
},
|
|
@@ -16,10 +16,7 @@ import {
|
|
|
16
16
|
TranscriptionStreamTextDelta,
|
|
17
17
|
TranscriptionStreamTextDelta$inboundSchema,
|
|
18
18
|
} from "../../models/components/transcriptionstreamtextdelta.js";
|
|
19
|
-
import {
|
|
20
|
-
AudioFormat$outboundSchema,
|
|
21
|
-
type AudioFormat,
|
|
22
|
-
} from "../../models/components/audioformat.js";
|
|
19
|
+
import type { AudioFormat } from "../../models/components/audioformat.js";
|
|
23
20
|
import {
|
|
24
21
|
RealtimeTranscriptionError$inboundSchema,
|
|
25
22
|
type RealtimeTranscriptionError,
|
|
@@ -35,6 +32,26 @@ import {
|
|
|
35
32
|
RealtimeTranscriptionSessionUpdated$inboundSchema,
|
|
36
33
|
type RealtimeTranscriptionSessionUpdated,
|
|
37
34
|
} from "../../models/components/realtimetranscriptionsessionupdated.js";
|
|
35
|
+
import {
|
|
36
|
+
RealtimeTranscriptionSessionUpdatePayload$outboundSchema,
|
|
37
|
+
} from "../../models/components/realtimetranscriptionsessionupdatepayload.js";
|
|
38
|
+
import type { TurnDetectionConfig } from "../../models/components/turndetectionconfig.js";
|
|
39
|
+
import {
|
|
40
|
+
TurnDetectionEagerEndEvent$inboundSchema,
|
|
41
|
+
type TurnDetectionEagerEndEvent,
|
|
42
|
+
} from "../../models/components/turndetectioneagerendevent.js";
|
|
43
|
+
import {
|
|
44
|
+
TurnDetectionEndEvent$inboundSchema,
|
|
45
|
+
type TurnDetectionEndEvent,
|
|
46
|
+
} from "../../models/components/turndetectionendevent.js";
|
|
47
|
+
import {
|
|
48
|
+
TurnDetectionResumeEvent$inboundSchema,
|
|
49
|
+
type TurnDetectionResumeEvent,
|
|
50
|
+
} from "../../models/components/turndetectionresumeevent.js";
|
|
51
|
+
import {
|
|
52
|
+
TurnDetectionStartEvent$inboundSchema,
|
|
53
|
+
type TurnDetectionStartEvent,
|
|
54
|
+
} from "../../models/components/turndetectionstartevent.js";
|
|
38
55
|
|
|
39
56
|
const WS_CLOSING = 2;
|
|
40
57
|
const WS_CLOSED = 3;
|
|
@@ -46,7 +63,20 @@ export type KnownRealtimeEvent =
|
|
|
46
63
|
| TranscriptionStreamLanguage
|
|
47
64
|
| TranscriptionStreamSegmentDelta
|
|
48
65
|
| TranscriptionStreamTextDelta
|
|
49
|
-
| TranscriptionStreamDone
|
|
66
|
+
| TranscriptionStreamDone
|
|
67
|
+
| TurnDetectionStartEvent
|
|
68
|
+
| TurnDetectionEagerEndEvent
|
|
69
|
+
| TurnDetectionResumeEvent
|
|
70
|
+
| TurnDetectionEndEvent;
|
|
71
|
+
|
|
72
|
+
export type RealtimeSessionOptions = {
|
|
73
|
+
targetStreamingDelayMs?: number | undefined;
|
|
74
|
+
diarize?: boolean | undefined;
|
|
75
|
+
contextBias?: ReadonlyArray<string> | undefined;
|
|
76
|
+
language?: string | undefined;
|
|
77
|
+
speakerReferences?: Record<string, string> | undefined;
|
|
78
|
+
turnDetection?: TurnDetectionConfig | undefined;
|
|
79
|
+
};
|
|
50
80
|
|
|
51
81
|
export type UnknownRealtimeEvent = {
|
|
52
82
|
type: string;
|
|
@@ -229,20 +259,33 @@ export class RealtimeConnection implements AsyncIterable<RealtimeEvent> {
|
|
|
229
259
|
await this.sendJson({ type: "input_audio.flush" });
|
|
230
260
|
}
|
|
231
261
|
|
|
232
|
-
async updateSession(
|
|
262
|
+
async updateSession(
|
|
263
|
+
audioFormat?: AudioFormat | undefined,
|
|
264
|
+
options: RealtimeSessionOptions = {},
|
|
265
|
+
): Promise<void> {
|
|
233
266
|
if (this.isClosed) {
|
|
234
267
|
throw new Error("Connection is closed");
|
|
235
268
|
}
|
|
236
269
|
|
|
237
|
-
const
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
270
|
+
const fields = {
|
|
271
|
+
audioFormat,
|
|
272
|
+
targetStreamingDelayMs: options.targetStreamingDelayMs,
|
|
273
|
+
diarize: options.diarize,
|
|
274
|
+
contextBias: options.contextBias,
|
|
275
|
+
language: options.language,
|
|
276
|
+
speakerReferences: options.speakerReferences,
|
|
277
|
+
turnDetection: options.turnDetection,
|
|
242
278
|
};
|
|
279
|
+
if (Object.values(fields).every((value) => value == null)) {
|
|
280
|
+
throw new Error("At least one session field must be provided");
|
|
281
|
+
}
|
|
282
|
+
const session = RealtimeTranscriptionSessionUpdatePayload$outboundSchema
|
|
283
|
+
.parse(fields);
|
|
243
284
|
|
|
244
|
-
await this.sendJson(
|
|
245
|
-
|
|
285
|
+
await this.sendJson({ type: "session.update", session });
|
|
286
|
+
if (audioFormat) {
|
|
287
|
+
this.currentAudioFormat = audioFormat;
|
|
288
|
+
}
|
|
246
289
|
}
|
|
247
290
|
|
|
248
291
|
async endAudio(): Promise<void> {
|
|
@@ -374,6 +417,38 @@ function parseRealtimeEvent(payload: unknown): RealtimeEvent {
|
|
|
374
417
|
);
|
|
375
418
|
}
|
|
376
419
|
|
|
420
|
+
if (msgType === "turn.start") {
|
|
421
|
+
return parseWithSchema(
|
|
422
|
+
TurnDetectionStartEvent$inboundSchema,
|
|
423
|
+
payload,
|
|
424
|
+
msgType,
|
|
425
|
+
);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
if (msgType === "turn.eager_end") {
|
|
429
|
+
return parseWithSchema(
|
|
430
|
+
TurnDetectionEagerEndEvent$inboundSchema,
|
|
431
|
+
payload,
|
|
432
|
+
msgType,
|
|
433
|
+
);
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
if (msgType === "turn.resume") {
|
|
437
|
+
return parseWithSchema(
|
|
438
|
+
TurnDetectionResumeEvent$inboundSchema,
|
|
439
|
+
payload,
|
|
440
|
+
msgType,
|
|
441
|
+
);
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
if (msgType === "turn.end") {
|
|
445
|
+
return parseWithSchema(
|
|
446
|
+
TurnDetectionEndEvent$inboundSchema,
|
|
447
|
+
payload,
|
|
448
|
+
msgType,
|
|
449
|
+
);
|
|
450
|
+
}
|
|
451
|
+
|
|
377
452
|
return unknownEvent(msgType, payload);
|
|
378
453
|
}
|
|
379
454
|
|