@openrouter/sdk 1.4.4 → 1.4.5
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/funcs/sttCreateTranscription.d.ts +1 -1
- package/esm/funcs/sttCreateTranscription.js +1 -1
- package/esm/funcs/sttCreateTranscriptionMultipart.d.ts +1 -1
- package/esm/funcs/sttCreateTranscriptionMultipart.js +32 -18
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/byokproviderslug.d.ts +1 -0
- package/esm/models/byokproviderslug.js +1 -0
- package/esm/models/imagegenerationproviderpreferences.d.ts +6 -0
- package/esm/models/imagegenerationproviderpreferences.js +1 -0
- package/esm/models/index.d.ts +3 -0
- package/esm/models/index.js +3 -0
- package/esm/models/operations/createaudiotranscriptionsmultipart.d.ts +23 -3
- package/esm/models/operations/createaudiotranscriptionsmultipart.js +7 -1
- package/esm/models/operations/listbyokkeys.d.ts +1 -0
- package/esm/models/operations/listbyokkeys.js +1 -0
- package/esm/models/providername.d.ts +1 -0
- package/esm/models/providername.js +1 -0
- package/esm/models/provideroptions.d.ts +6 -0
- package/esm/models/provideroptions.js +1 -0
- package/esm/models/providerresponse.d.ts +1 -0
- package/esm/models/providerresponse.js +1 -0
- package/esm/models/sttentity.d.ts +28 -0
- package/esm/models/sttentity.js +23 -0
- package/esm/models/sttinlineinputaudio.d.ts +23 -0
- package/esm/models/sttinlineinputaudio.js +14 -0
- package/esm/models/sttinputaudio.d.ts +5 -15
- package/esm/models/sttinputaudio.js +6 -4
- package/esm/models/sttrequest.d.ts +12 -2
- package/esm/models/sttrequest.js +2 -0
- package/esm/models/sttresponse.d.ts +9 -0
- package/esm/models/sttresponse.js +8 -0
- package/esm/models/sttsegment.d.ts +8 -0
- package/esm/models/sttsegment.js +3 -0
- package/esm/models/stturlinputaudio.d.ts +23 -0
- package/esm/models/stturlinputaudio.js +14 -0
- package/esm/models/sttword.d.ts +27 -1
- package/esm/models/sttword.js +18 -0
- package/esm/models/videogenerationrequest.d.ts +6 -0
- package/esm/models/videogenerationrequest.js +1 -0
- package/esm/sdk/stt.d.ts +2 -2
- package/esm/sdk/stt.js +2 -2
- package/jsr.json +1 -1
- package/package.json +6 -6
|
@@ -13,7 +13,7 @@ import { Result } from "../types/fp.js";
|
|
|
13
13
|
* Create transcription
|
|
14
14
|
*
|
|
15
15
|
* @remarks
|
|
16
|
-
* Transcribes audio into text. Accepts base64-encoded audio input as JSON
|
|
16
|
+
* Transcribes audio into text. Accepts base64-encoded audio input as JSON, an OpenAI-style multipart/form-data file upload, or a URL the provider downloads directly, and returns the transcribed text.
|
|
17
17
|
*/
|
|
18
18
|
export declare function sttCreateTranscription(client: OpenRouterCore, request: operations.CreateAudioTranscriptionsRequest, options?: RequestOptions): APIPromise<Result<models.STTResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.PaymentRequiredResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.PayloadTooLargeResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | errors.BadGatewayResponseError | errors.ServiceUnavailableResponseError | errors.GatewayTimeoutResponseError | errors.EdgeNetworkTimeoutResponseError | errors.ProviderOverloadedResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
19
19
|
//# sourceMappingURL=sttCreateTranscription.d.ts.map
|
|
@@ -17,7 +17,7 @@ import { APIPromise } from "../types/async.js";
|
|
|
17
17
|
* Create transcription
|
|
18
18
|
*
|
|
19
19
|
* @remarks
|
|
20
|
-
* Transcribes audio into text. Accepts base64-encoded audio input as JSON
|
|
20
|
+
* Transcribes audio into text. Accepts base64-encoded audio input as JSON, an OpenAI-style multipart/form-data file upload, or a URL the provider downloads directly, and returns the transcribed text.
|
|
21
21
|
*/
|
|
22
22
|
export function sttCreateTranscription(client, request, options) {
|
|
23
23
|
return new APIPromise($do(client, request, options));
|
|
@@ -13,7 +13,7 @@ import { Result } from "../types/fp.js";
|
|
|
13
13
|
* Create transcription
|
|
14
14
|
*
|
|
15
15
|
* @remarks
|
|
16
|
-
* Transcribes audio into text. Accepts base64-encoded audio input as JSON
|
|
16
|
+
* Transcribes audio into text. Accepts base64-encoded audio input as JSON, an OpenAI-style multipart/form-data file upload, or a URL the provider downloads directly, and returns the transcribed text.
|
|
17
17
|
*/
|
|
18
18
|
export declare function sttCreateTranscriptionMultipart(client: OpenRouterCore, request: operations.CreateAudioTranscriptionsMultipartRequest, options?: RequestOptions): APIPromise<Result<models.STTResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.PaymentRequiredResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.PayloadTooLargeResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | errors.BadGatewayResponseError | errors.ServiceUnavailableResponseError | errors.GatewayTimeoutResponseError | errors.EdgeNetworkTimeoutResponseError | errors.ProviderOverloadedResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
19
19
|
//# sourceMappingURL=sttCreateTranscriptionMultipart.d.ts.map
|
|
@@ -20,7 +20,7 @@ import { isReadableStream } from "../types/streams.js";
|
|
|
20
20
|
* Create transcription
|
|
21
21
|
*
|
|
22
22
|
* @remarks
|
|
23
|
-
* Transcribes audio into text. Accepts base64-encoded audio input as JSON
|
|
23
|
+
* Transcribes audio into text. Accepts base64-encoded audio input as JSON, an OpenAI-style multipart/form-data file upload, or a URL the provider downloads directly, and returns the transcribed text.
|
|
24
24
|
*/
|
|
25
25
|
export function sttCreateTranscriptionMultipart(client, request, options) {
|
|
26
26
|
return new APIPromise($do(client, request, options));
|
|
@@ -32,33 +32,47 @@ async function $do(client, request, options) {
|
|
|
32
32
|
}
|
|
33
33
|
const payload = parsed.value;
|
|
34
34
|
const body = new FormData();
|
|
35
|
-
if (isBlobLike(payload.RequestBody.file)) {
|
|
36
|
-
const file = payload.RequestBody.file;
|
|
37
|
-
const blob = await normalizeBlob(file);
|
|
38
|
-
const name = "name" in file ? file.name : undefined;
|
|
39
|
-
appendForm(body, "file", blob, name);
|
|
40
|
-
}
|
|
41
|
-
else if (isReadableStream(payload.RequestBody.file.content)) {
|
|
42
|
-
const buffer = await readableStreamToArrayBuffer(payload.RequestBody.file.content);
|
|
43
|
-
const contentType = getContentTypeFromFileName(payload.RequestBody.file.fileName)
|
|
44
|
-
|| "application/octet-stream";
|
|
45
|
-
appendForm(body, "file", bytesToBlob(buffer, contentType), payload.RequestBody.file.fileName);
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
const contentType = getContentTypeFromFileName(payload.RequestBody.file.fileName)
|
|
49
|
-
|| "application/octet-stream";
|
|
50
|
-
appendForm(body, "file", bytesToBlob(payload.RequestBody.file.content, contentType), payload.RequestBody.file.fileName);
|
|
51
|
-
}
|
|
52
35
|
appendForm(body, "model", payload.RequestBody.model);
|
|
36
|
+
if (payload.RequestBody.diarize !== undefined) {
|
|
37
|
+
appendForm(body, "diarize", payload.RequestBody.diarize);
|
|
38
|
+
}
|
|
39
|
+
if (payload.RequestBody.file !== undefined) {
|
|
40
|
+
if (isBlobLike(payload.RequestBody.file)) {
|
|
41
|
+
const file = payload.RequestBody.file;
|
|
42
|
+
const blob = await normalizeBlob(file);
|
|
43
|
+
const name = "name" in file ? file.name : undefined;
|
|
44
|
+
appendForm(body, "file", blob, name);
|
|
45
|
+
}
|
|
46
|
+
else if (isReadableStream(payload.RequestBody.file.content)) {
|
|
47
|
+
const buffer = await readableStreamToArrayBuffer(payload.RequestBody.file.content);
|
|
48
|
+
const contentType = getContentTypeFromFileName(payload.RequestBody.file.fileName)
|
|
49
|
+
|| "application/octet-stream";
|
|
50
|
+
appendForm(body, "file", bytesToBlob(buffer, contentType), payload.RequestBody.file.fileName);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
const contentType = getContentTypeFromFileName(payload.RequestBody.file.fileName)
|
|
54
|
+
|| "application/octet-stream";
|
|
55
|
+
appendForm(body, "file", bytesToBlob(payload.RequestBody.file.content, contentType), payload.RequestBody.file.fileName);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (payload.RequestBody["keyterms[]"] !== undefined) {
|
|
59
|
+
appendForm(body, "keyterms[]", payload.RequestBody["keyterms[]"]);
|
|
60
|
+
}
|
|
53
61
|
if (payload.RequestBody.language !== undefined) {
|
|
54
62
|
appendForm(body, "language", payload.RequestBody.language);
|
|
55
63
|
}
|
|
64
|
+
if (payload.RequestBody.provider !== undefined) {
|
|
65
|
+
appendForm(body, "provider", payload.RequestBody.provider);
|
|
66
|
+
}
|
|
56
67
|
if (payload.RequestBody.response_format !== undefined) {
|
|
57
68
|
appendForm(body, "response_format", payload.RequestBody.response_format);
|
|
58
69
|
}
|
|
59
70
|
if (payload.RequestBody.session_id !== undefined) {
|
|
60
71
|
appendForm(body, "session_id", payload.RequestBody.session_id);
|
|
61
72
|
}
|
|
73
|
+
if (payload.RequestBody.source_url !== undefined) {
|
|
74
|
+
appendForm(body, "source_url", payload.RequestBody.source_url);
|
|
75
|
+
}
|
|
62
76
|
if (payload.RequestBody.temperature !== undefined) {
|
|
63
77
|
appendForm(body, "temperature", payload.RequestBody.temperature);
|
|
64
78
|
}
|
package/esm/lib/config.d.ts
CHANGED
|
@@ -50,8 +50,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
50
50
|
export declare const SDK_METADATA: {
|
|
51
51
|
readonly language: "typescript";
|
|
52
52
|
readonly openapiDocVersion: "1.0.0";
|
|
53
|
-
readonly sdkVersion: "1.4.
|
|
53
|
+
readonly sdkVersion: "1.4.5";
|
|
54
54
|
readonly genVersion: "2.914.0";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.4.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.4.5 2.914.0 1.0.0 @openrouter/sdk";
|
|
56
56
|
};
|
|
57
57
|
//# sourceMappingURL=config.d.ts.map
|
package/esm/lib/config.js
CHANGED
|
@@ -29,8 +29,8 @@ export function serverURLFromOptions(options) {
|
|
|
29
29
|
export const SDK_METADATA = {
|
|
30
30
|
language: "typescript",
|
|
31
31
|
openapiDocVersion: "1.0.0",
|
|
32
|
-
sdkVersion: "1.4.
|
|
32
|
+
sdkVersion: "1.4.5",
|
|
33
33
|
genVersion: "2.914.0",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.4.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.4.5 2.914.0 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -41,6 +41,7 @@ export declare const BYOKProviderSlug: {
|
|
|
41
41
|
readonly Deepseek: "deepseek";
|
|
42
42
|
readonly Dekallm: "dekallm";
|
|
43
43
|
readonly Digitalocean: "digitalocean";
|
|
44
|
+
readonly Elevenlabs: "elevenlabs";
|
|
44
45
|
readonly Featherless: "featherless";
|
|
45
46
|
readonly Fireworks: "fireworks";
|
|
46
47
|
readonly FishAudio: "fish-audio";
|
|
@@ -137,6 +137,9 @@ export type ImageGenerationProviderPreferencesOptions = {
|
|
|
137
137
|
digitalocean?: {
|
|
138
138
|
[k: string]: any;
|
|
139
139
|
} | undefined;
|
|
140
|
+
elevenlabs?: {
|
|
141
|
+
[k: string]: any;
|
|
142
|
+
} | undefined;
|
|
140
143
|
enfer?: {
|
|
141
144
|
[k: string]: any;
|
|
142
145
|
} | undefined;
|
|
@@ -620,6 +623,9 @@ export type ImageGenerationProviderPreferencesOptions$Outbound = {
|
|
|
620
623
|
digitalocean?: {
|
|
621
624
|
[k: string]: any;
|
|
622
625
|
} | undefined;
|
|
626
|
+
elevenlabs?: {
|
|
627
|
+
[k: string]: any;
|
|
628
|
+
} | undefined;
|
|
623
629
|
enfer?: {
|
|
624
630
|
[k: string]: any;
|
|
625
631
|
} | undefined;
|
|
@@ -62,6 +62,7 @@ export const ImageGenerationProviderPreferencesOptions$outboundSchema = z.object
|
|
|
62
62
|
deepseek: z.record(z.string(), z.any()).optional(),
|
|
63
63
|
dekallm: z.record(z.string(), z.any()).optional(),
|
|
64
64
|
digitalocean: z.record(z.string(), z.any()).optional(),
|
|
65
|
+
elevenlabs: z.record(z.string(), z.any()).optional(),
|
|
65
66
|
enfer: z.record(z.string(), z.any()).optional(),
|
|
66
67
|
fakeProvider: z.record(z.string(), z.any()).optional(),
|
|
67
68
|
featherless: z.record(z.string(), z.any()).optional(),
|
package/esm/models/index.d.ts
CHANGED
|
@@ -696,11 +696,14 @@ export * from "./streameventsresponseoutputitemadded.js";
|
|
|
696
696
|
export * from "./streameventsresponseoutputitemdone.js";
|
|
697
697
|
export * from "./streamlogprob.js";
|
|
698
698
|
export * from "./streamlogprobtoplogprob.js";
|
|
699
|
+
export * from "./sttentity.js";
|
|
700
|
+
export * from "./sttinlineinputaudio.js";
|
|
699
701
|
export * from "./sttinputaudio.js";
|
|
700
702
|
export * from "./sttrequest.js";
|
|
701
703
|
export * from "./sttresponse.js";
|
|
702
704
|
export * from "./sttsegment.js";
|
|
703
705
|
export * from "./stttimestampgranularity.js";
|
|
706
|
+
export * from "./stturlinputaudio.js";
|
|
704
707
|
export * from "./sttusage.js";
|
|
705
708
|
export * from "./sttword.js";
|
|
706
709
|
export * from "./subagentnestedtool.js";
|
package/esm/models/index.js
CHANGED
|
@@ -700,11 +700,14 @@ export * from "./streameventsresponseoutputitemadded.js";
|
|
|
700
700
|
export * from "./streameventsresponseoutputitemdone.js";
|
|
701
701
|
export * from "./streamlogprob.js";
|
|
702
702
|
export * from "./streamlogprobtoplogprob.js";
|
|
703
|
+
export * from "./sttentity.js";
|
|
704
|
+
export * from "./sttinlineinputaudio.js";
|
|
703
705
|
export * from "./sttinputaudio.js";
|
|
704
706
|
export * from "./sttrequest.js";
|
|
705
707
|
export * from "./sttresponse.js";
|
|
706
708
|
export * from "./sttsegment.js";
|
|
707
709
|
export * from "./stttimestampgranularity.js";
|
|
710
|
+
export * from "./stturlinputaudio.js";
|
|
708
711
|
export * from "./sttusage.js";
|
|
709
712
|
export * from "./sttword.js";
|
|
710
713
|
export * from "./subagentnestedtool.js";
|
|
@@ -43,9 +43,17 @@ export declare const TimestampGranularities: {
|
|
|
43
43
|
export type TimestampGranularities = OpenEnum<typeof TimestampGranularities>;
|
|
44
44
|
export type CreateAudioTranscriptionsMultipartRequestBody = {
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
46
|
+
* Label each word with the speaker who said it (words[].speaker, words[].speaker_label). Requires response_format "verbose_json" (400 otherwise); word timestamps are included even when timestamp_granularities[] omits "word". Only supported by some providers; 400 when the selected model cannot diarize.
|
|
47
47
|
*/
|
|
48
|
-
|
|
48
|
+
diarize?: boolean | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* The audio file to transcribe. The format is derived from the filename extension or the file part content type. Max 25 MB; send larger files as base64 JSON via input_audio, or by URL via source_url. Exactly one of file or source_url is required.
|
|
51
|
+
*/
|
|
52
|
+
file?: CreateAudioTranscriptionsMultipartFile | Blob | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Domain terms, names, or phrases to bias recognition toward; repeat the part once per term (keyterms=... is also accepted). Only supported by some providers; 400 when the selected model cannot use keyterms.
|
|
55
|
+
*/
|
|
56
|
+
keyterms?: Array<string> | undefined;
|
|
49
57
|
/**
|
|
50
58
|
* The language of the input audio (ISO-639-1).
|
|
51
59
|
*/
|
|
@@ -54,6 +62,10 @@ export type CreateAudioTranscriptionsMultipartRequestBody = {
|
|
|
54
62
|
* The model to use for transcription.
|
|
55
63
|
*/
|
|
56
64
|
model: string;
|
|
65
|
+
/**
|
|
66
|
+
* JSON-encoded provider preferences object, the same shape as the JSON body field: { "options": { "<provider-slug>": { ... } } }. Only options for the matched provider are forwarded. Must decode to a JSON object.
|
|
67
|
+
*/
|
|
68
|
+
provider?: string | undefined;
|
|
57
69
|
/**
|
|
58
70
|
* The response format. "json" (default) returns { text, usage }; "verbose_json" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only).
|
|
59
71
|
*/
|
|
@@ -62,6 +74,10 @@ export type CreateAudioTranscriptionsMultipartRequestBody = {
|
|
|
62
74
|
* A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence.
|
|
63
75
|
*/
|
|
64
76
|
sessionId?: string | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* Publicly reachable http(s) URL of the audio file, downloaded by the provider directly (no size limit on our side). The format is derived from the URL path extension. Only supported by some providers; exactly one of file or source_url is required.
|
|
79
|
+
*/
|
|
80
|
+
sourceUrl?: string | undefined;
|
|
65
81
|
/**
|
|
66
82
|
* The sampling temperature.
|
|
67
83
|
*/
|
|
@@ -115,11 +131,15 @@ export declare const ResponseFormat$outboundSchema: z.ZodType<string, ResponseFo
|
|
|
115
131
|
export declare const TimestampGranularities$outboundSchema: z.ZodType<string, TimestampGranularities>;
|
|
116
132
|
/** @internal */
|
|
117
133
|
export type CreateAudioTranscriptionsMultipartRequestBody$Outbound = {
|
|
118
|
-
|
|
134
|
+
diarize?: boolean | undefined;
|
|
135
|
+
file?: CreateAudioTranscriptionsMultipartFile$Outbound | Blob | undefined;
|
|
136
|
+
"keyterms[]"?: Array<string> | undefined;
|
|
119
137
|
language?: string | undefined;
|
|
120
138
|
model: string;
|
|
139
|
+
provider?: string | undefined;
|
|
121
140
|
response_format?: string | undefined;
|
|
122
141
|
session_id?: string | undefined;
|
|
142
|
+
source_url?: string | undefined;
|
|
123
143
|
temperature?: number | undefined;
|
|
124
144
|
"timestamp_granularities[]"?: Array<string> | undefined;
|
|
125
145
|
trace?: string | undefined;
|
|
@@ -36,12 +36,16 @@ export const ResponseFormat$outboundSchema = openEnums.outboundSchema(ResponseFo
|
|
|
36
36
|
export const TimestampGranularities$outboundSchema = openEnums.outboundSchema(TimestampGranularities);
|
|
37
37
|
/** @internal */
|
|
38
38
|
export const CreateAudioTranscriptionsMultipartRequestBody$outboundSchema = z.object({
|
|
39
|
+
diarize: z.boolean().optional(),
|
|
39
40
|
file: z.lazy(() => CreateAudioTranscriptionsMultipartFile$outboundSchema)
|
|
40
|
-
.or(blobLikeSchema),
|
|
41
|
+
.or(blobLikeSchema).optional(),
|
|
42
|
+
keyterms: z.array(z.string()).optional(),
|
|
41
43
|
language: z.string().optional(),
|
|
42
44
|
model: z.string(),
|
|
45
|
+
provider: z.string().optional(),
|
|
43
46
|
responseFormat: ResponseFormat$outboundSchema.optional(),
|
|
44
47
|
sessionId: z.string().optional(),
|
|
48
|
+
sourceUrl: z.string().optional(),
|
|
45
49
|
temperature: z.number().optional(),
|
|
46
50
|
timestampGranularities: z.array(TimestampGranularities$outboundSchema)
|
|
47
51
|
.optional(),
|
|
@@ -49,8 +53,10 @@ export const CreateAudioTranscriptionsMultipartRequestBody$outboundSchema = z.ob
|
|
|
49
53
|
user: z.string().optional(),
|
|
50
54
|
}).transform((v) => {
|
|
51
55
|
return remap$(v, {
|
|
56
|
+
keyterms: "keyterms[]",
|
|
52
57
|
responseFormat: "response_format",
|
|
53
58
|
sessionId: "session_id",
|
|
59
|
+
sourceUrl: "source_url",
|
|
54
60
|
timestampGranularities: "timestamp_granularities[]",
|
|
55
61
|
});
|
|
56
62
|
});
|
|
@@ -65,6 +65,7 @@ export declare const Provider: {
|
|
|
65
65
|
readonly Deepseek: "deepseek";
|
|
66
66
|
readonly Dekallm: "dekallm";
|
|
67
67
|
readonly Digitalocean: "digitalocean";
|
|
68
|
+
readonly Elevenlabs: "elevenlabs";
|
|
68
69
|
readonly Featherless: "featherless";
|
|
69
70
|
readonly Fireworks: "fireworks";
|
|
70
71
|
readonly FishAudio: "fish-audio";
|
|
@@ -38,6 +38,7 @@ export declare const ProviderName: {
|
|
|
38
38
|
readonly DeepSeek: "DeepSeek";
|
|
39
39
|
readonly DekaLLM: "DekaLLM";
|
|
40
40
|
readonly DigitalOcean: "DigitalOcean";
|
|
41
|
+
readonly ElevenLabs: "ElevenLabs";
|
|
41
42
|
readonly Featherless: "Featherless";
|
|
42
43
|
readonly Fireworks: "Fireworks";
|
|
43
44
|
readonly FishAudio: "Fish Audio";
|
|
@@ -132,6 +132,9 @@ export type ProviderOptions = {
|
|
|
132
132
|
digitalocean?: {
|
|
133
133
|
[k: string]: any;
|
|
134
134
|
} | undefined;
|
|
135
|
+
elevenlabs?: {
|
|
136
|
+
[k: string]: any;
|
|
137
|
+
} | undefined;
|
|
135
138
|
enfer?: {
|
|
136
139
|
[k: string]: any;
|
|
137
140
|
} | undefined;
|
|
@@ -570,6 +573,9 @@ export type ProviderOptions$Outbound = {
|
|
|
570
573
|
digitalocean?: {
|
|
571
574
|
[k: string]: any;
|
|
572
575
|
} | undefined;
|
|
576
|
+
elevenlabs?: {
|
|
577
|
+
[k: string]: any;
|
|
578
|
+
} | undefined;
|
|
573
579
|
enfer?: {
|
|
574
580
|
[k: string]: any;
|
|
575
581
|
} | undefined;
|
|
@@ -49,6 +49,7 @@ export const ProviderOptions$outboundSchema = z.object({
|
|
|
49
49
|
deepseek: z.record(z.string(), z.any()).optional(),
|
|
50
50
|
dekallm: z.record(z.string(), z.any()).optional(),
|
|
51
51
|
digitalocean: z.record(z.string(), z.any()).optional(),
|
|
52
|
+
elevenlabs: z.record(z.string(), z.any()).optional(),
|
|
52
53
|
enfer: z.record(z.string(), z.any()).optional(),
|
|
53
54
|
fakeProvider: z.record(z.string(), z.any()).optional(),
|
|
54
55
|
featherless: z.record(z.string(), z.any()).optional(),
|
|
@@ -71,6 +71,7 @@ export declare const ProviderResponseProviderName: {
|
|
|
71
71
|
readonly DeepSeek: "DeepSeek";
|
|
72
72
|
readonly DekaLLM: "DekaLLM";
|
|
73
73
|
readonly DigitalOcean: "DigitalOcean";
|
|
74
|
+
readonly ElevenLabs: "ElevenLabs";
|
|
74
75
|
readonly Featherless: "Featherless";
|
|
75
76
|
readonly Fireworks: "Fireworks";
|
|
76
77
|
readonly FishAudio: "Fish Audio";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
/**
|
|
5
|
+
* A detected entity, returned when the provider runs entity detection
|
|
6
|
+
*/
|
|
7
|
+
export type STTEntity = {
|
|
8
|
+
/**
|
|
9
|
+
* Zero-based exclusive character offset of the entity end within the response-level text (not seconds)
|
|
10
|
+
*/
|
|
11
|
+
endChar: number;
|
|
12
|
+
/**
|
|
13
|
+
* Zero-based character offset of the entity start within the response-level text (not seconds)
|
|
14
|
+
*/
|
|
15
|
+
startChar: number;
|
|
16
|
+
/**
|
|
17
|
+
* Entity text as it appears in the transcript
|
|
18
|
+
*/
|
|
19
|
+
text: string;
|
|
20
|
+
/**
|
|
21
|
+
* Provider entity type label
|
|
22
|
+
*/
|
|
23
|
+
type: string;
|
|
24
|
+
};
|
|
25
|
+
/** @internal */
|
|
26
|
+
export declare const STTEntity$inboundSchema: z.ZodType<STTEntity, unknown>;
|
|
27
|
+
export declare function sttEntityFromJSON(jsonString: string): SafeParseResult<STTEntity, SDKValidationError>;
|
|
28
|
+
//# sourceMappingURL=sttentity.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 7178554c1194
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const STTEntity$inboundSchema = z.object({
|
|
10
|
+
end_char: z.int(),
|
|
11
|
+
start_char: z.int(),
|
|
12
|
+
text: z.string(),
|
|
13
|
+
type: z.string(),
|
|
14
|
+
}).transform((v) => {
|
|
15
|
+
return remap$(v, {
|
|
16
|
+
"end_char": "endChar",
|
|
17
|
+
"start_char": "startChar",
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
export function sttEntityFromJSON(jsonString) {
|
|
21
|
+
return safeParse(jsonString, (x) => STTEntity$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'STTEntity' from JSON`);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=sttentity.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
/**
|
|
3
|
+
* Inline base64 audio input for speech-to-text
|
|
4
|
+
*/
|
|
5
|
+
export type STTInlineInputAudio = {
|
|
6
|
+
/**
|
|
7
|
+
* Base64-encoded audio data (raw bytes, not a data URI)
|
|
8
|
+
*/
|
|
9
|
+
data: string;
|
|
10
|
+
/**
|
|
11
|
+
* Audio format (e.g., wav, mp3, flac, m4a, ogg, webm, aac). Supported formats vary by provider. "pcm" means headerless signed 16-bit little-endian mono audio at 16 kHz.
|
|
12
|
+
*/
|
|
13
|
+
format: string;
|
|
14
|
+
};
|
|
15
|
+
/** @internal */
|
|
16
|
+
export type STTInlineInputAudio$Outbound = {
|
|
17
|
+
data: string;
|
|
18
|
+
format: string;
|
|
19
|
+
};
|
|
20
|
+
/** @internal */
|
|
21
|
+
export declare const STTInlineInputAudio$outboundSchema: z.ZodType<STTInlineInputAudio$Outbound, STTInlineInputAudio>;
|
|
22
|
+
export declare function sttInlineInputAudioToJSON(sttInlineInputAudio: STTInlineInputAudio): string;
|
|
23
|
+
//# sourceMappingURL=sttinlineinputaudio.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 58a47542cf73
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
/** @internal */
|
|
7
|
+
export const STTInlineInputAudio$outboundSchema = z.object({
|
|
8
|
+
data: z.string(),
|
|
9
|
+
format: z.string(),
|
|
10
|
+
});
|
|
11
|
+
export function sttInlineInputAudioToJSON(sttInlineInputAudio) {
|
|
12
|
+
return JSON.stringify(STTInlineInputAudio$outboundSchema.parse(sttInlineInputAudio));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=sttinlineinputaudio.js.map
|
|
@@ -1,22 +1,12 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
+
import { STTInlineInputAudio, STTInlineInputAudio$Outbound } from "./sttinlineinputaudio.js";
|
|
3
|
+
import { STTUrlInputAudio, STTUrlInputAudio$Outbound } from "./stturlinputaudio.js";
|
|
2
4
|
/**
|
|
3
|
-
*
|
|
5
|
+
* Audio to transcribe: inline base64 bytes, or a URL the provider downloads directly.
|
|
4
6
|
*/
|
|
5
|
-
export type STTInputAudio =
|
|
6
|
-
/**
|
|
7
|
-
* Base64-encoded audio data (raw bytes, not a data URI)
|
|
8
|
-
*/
|
|
9
|
-
data: string;
|
|
10
|
-
/**
|
|
11
|
-
* Audio format (e.g., wav, mp3, flac, m4a, ogg, webm, aac). Supported formats vary by provider.
|
|
12
|
-
*/
|
|
13
|
-
format: string;
|
|
14
|
-
};
|
|
7
|
+
export type STTInputAudio = STTInlineInputAudio | STTUrlInputAudio;
|
|
15
8
|
/** @internal */
|
|
16
|
-
export type STTInputAudio$Outbound =
|
|
17
|
-
data: string;
|
|
18
|
-
format: string;
|
|
19
|
-
};
|
|
9
|
+
export type STTInputAudio$Outbound = STTInlineInputAudio$Outbound | STTUrlInputAudio$Outbound;
|
|
20
10
|
/** @internal */
|
|
21
11
|
export declare const STTInputAudio$outboundSchema: z.ZodType<STTInputAudio$Outbound, STTInputAudio>;
|
|
22
12
|
export declare function sttInputAudioToJSON(sttInputAudio: STTInputAudio): string;
|
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
* @generated-id: 2251488e7c0b
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
|
+
import { STTInlineInputAudio$outboundSchema, } from "./sttinlineinputaudio.js";
|
|
7
|
+
import { STTUrlInputAudio$outboundSchema, } from "./stturlinputaudio.js";
|
|
6
8
|
/** @internal */
|
|
7
|
-
export const STTInputAudio$outboundSchema = z.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
export const STTInputAudio$outboundSchema = z.union([
|
|
10
|
+
STTInlineInputAudio$outboundSchema,
|
|
11
|
+
STTUrlInputAudio$outboundSchema,
|
|
12
|
+
]);
|
|
11
13
|
export function sttInputAudioToJSON(sttInputAudio) {
|
|
12
14
|
return JSON.stringify(STTInputAudio$outboundSchema.parse(sttInputAudio));
|
|
13
15
|
}
|
|
@@ -25,13 +25,21 @@ export declare const STTRequestResponseFormat: {
|
|
|
25
25
|
*/
|
|
26
26
|
export type STTRequestResponseFormat = OpenEnum<typeof STTRequestResponseFormat>;
|
|
27
27
|
/**
|
|
28
|
-
* Speech-to-text request input. Accepts a JSON body with input_audio containing base64-encoded audio.
|
|
28
|
+
* Speech-to-text request input. Accepts a JSON body with input_audio containing base64-encoded audio or a URL the provider downloads.
|
|
29
29
|
*/
|
|
30
30
|
export type STTRequest = {
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* Label each word with the speaker who said it. Speaker labels are returned on the words array (speaker, speaker_label), so response_format must be "verbose_json" (a "json" request is rejected with a 400) and word timestamps are included even when timestamp_granularities omits "word". Only supported by some providers; the request is rejected with a 400 when the selected model cannot diarize. Providers may charge extra.
|
|
33
|
+
*/
|
|
34
|
+
diarize?: boolean | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Audio to transcribe: inline base64 bytes, or a URL the provider downloads directly.
|
|
33
37
|
*/
|
|
34
38
|
inputAudio: STTInputAudio;
|
|
39
|
+
/**
|
|
40
|
+
* Domain terms, names, or phrases to bias recognition toward. Only supported by some providers; the request is rejected with a 400 when the selected model cannot use keyterms. Providers may cap the number of terms or characters per term and may charge extra.
|
|
41
|
+
*/
|
|
42
|
+
keyterms?: Array<string> | undefined;
|
|
35
43
|
/**
|
|
36
44
|
* ISO-639-1 language code (e.g., "en", "ja"). Auto-detected if omitted.
|
|
37
45
|
*/
|
|
@@ -80,7 +88,9 @@ export declare function sttRequestProviderToJSON(sttRequestProvider: STTRequestP
|
|
|
80
88
|
export declare const STTRequestResponseFormat$outboundSchema: z.ZodType<string, STTRequestResponseFormat>;
|
|
81
89
|
/** @internal */
|
|
82
90
|
export type STTRequest$Outbound = {
|
|
91
|
+
diarize?: boolean | undefined;
|
|
83
92
|
input_audio: STTInputAudio$Outbound;
|
|
93
|
+
keyterms?: Array<string> | undefined;
|
|
84
94
|
language?: string | undefined;
|
|
85
95
|
model: string;
|
|
86
96
|
provider?: STTRequestProvider$Outbound | undefined;
|
package/esm/models/sttrequest.js
CHANGED
|
@@ -27,7 +27,9 @@ export function sttRequestProviderToJSON(sttRequestProvider) {
|
|
|
27
27
|
export const STTRequestResponseFormat$outboundSchema = openEnums.outboundSchema(STTRequestResponseFormat);
|
|
28
28
|
/** @internal */
|
|
29
29
|
export const STTRequest$outboundSchema = z.object({
|
|
30
|
+
diarize: z.boolean().optional(),
|
|
30
31
|
inputAudio: STTInputAudio$outboundSchema,
|
|
32
|
+
keyterms: z.array(z.string()).optional(),
|
|
31
33
|
language: z.string().optional(),
|
|
32
34
|
model: z.string(),
|
|
33
35
|
provider: z.lazy(() => STTRequestProvider$outboundSchema).optional(),
|
|
@@ -1,6 +1,7 @@
|
|
|
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 { STTEntity } from "./sttentity.js";
|
|
4
5
|
import { STTSegment } from "./sttsegment.js";
|
|
5
6
|
import { STTUsage } from "./sttusage.js";
|
|
6
7
|
import { STTWord } from "./sttword.js";
|
|
@@ -16,10 +17,18 @@ export type STTResponse = {
|
|
|
16
17
|
* Duration of the input audio in seconds, present when response_format is verbose_json
|
|
17
18
|
*/
|
|
18
19
|
duration?: number | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Detected entities with character offsets into text, present when the provider runs entity detection
|
|
22
|
+
*/
|
|
23
|
+
entities?: Array<STTEntity> | undefined;
|
|
19
24
|
/**
|
|
20
25
|
* Detected or forced language, present when response_format is verbose_json
|
|
21
26
|
*/
|
|
22
27
|
language?: string | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Provider confidence in the detected language from 0 to 1, present when response_format is verbose_json and the provider scores language detection
|
|
30
|
+
*/
|
|
31
|
+
languageConfidence?: number | undefined;
|
|
23
32
|
/**
|
|
24
33
|
* Timestamped transcript segments, present when response_format is verbose_json
|
|
25
34
|
*/
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
* @generated-id: 383a6e21047b
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import { STTEntity$inboundSchema } from "./sttentity.js";
|
|
7
9
|
import { STTSegment$inboundSchema } from "./sttsegment.js";
|
|
8
10
|
import { STTUsage$inboundSchema } from "./sttusage.js";
|
|
9
11
|
import { STTWord$inboundSchema } from "./sttword.js";
|
|
@@ -12,12 +14,18 @@ export const STTResponse$inboundSchema = z
|
|
|
12
14
|
.object({
|
|
13
15
|
confidence: z.number().optional(),
|
|
14
16
|
duration: z.number().optional(),
|
|
17
|
+
entities: z.array(STTEntity$inboundSchema).optional(),
|
|
15
18
|
language: z.string().optional(),
|
|
19
|
+
language_confidence: z.number().optional(),
|
|
16
20
|
segments: z.array(STTSegment$inboundSchema).optional(),
|
|
17
21
|
task: z.string().optional(),
|
|
18
22
|
text: z.string(),
|
|
19
23
|
usage: STTUsage$inboundSchema.optional(),
|
|
20
24
|
words: z.array(STTWord$inboundSchema).optional(),
|
|
25
|
+
}).transform((v) => {
|
|
26
|
+
return remap$(v, {
|
|
27
|
+
"language_confidence": "languageConfidence",
|
|
28
|
+
});
|
|
21
29
|
});
|
|
22
30
|
export function sttResponseFromJSON(jsonString) {
|
|
23
31
|
return safeParse(jsonString, (x) => STTResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'STTResponse' from JSON`);
|
|
@@ -9,6 +9,10 @@ export type STTSegment = {
|
|
|
9
9
|
* Average log probability of the segment
|
|
10
10
|
*/
|
|
11
11
|
avgLogprob?: number | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Zero-based audio channel index for the segment, present when the provider transcribes channels separately
|
|
14
|
+
*/
|
|
15
|
+
channel?: number | undefined;
|
|
12
16
|
/**
|
|
13
17
|
* Compression ratio of the segment
|
|
14
18
|
*/
|
|
@@ -33,6 +37,10 @@ export type STTSegment = {
|
|
|
33
37
|
* Speaker index for the segment, present when the provider returns diarization data
|
|
34
38
|
*/
|
|
35
39
|
speaker?: number | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Provider speaker label for the segment, present when the provider labels speakers with a string
|
|
42
|
+
*/
|
|
43
|
+
speakerLabel?: string | undefined;
|
|
36
44
|
/**
|
|
37
45
|
* Segment start time in seconds
|
|
38
46
|
*/
|
package/esm/models/sttsegment.js
CHANGED
|
@@ -9,12 +9,14 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
9
9
|
export const STTSegment$inboundSchema = z
|
|
10
10
|
.object({
|
|
11
11
|
avg_logprob: z.number().optional(),
|
|
12
|
+
channel: z.int().optional(),
|
|
12
13
|
compression_ratio: z.number().optional(),
|
|
13
14
|
end: z.number(),
|
|
14
15
|
id: z.int(),
|
|
15
16
|
no_speech_prob: z.number().optional(),
|
|
16
17
|
seek: z.int().optional(),
|
|
17
18
|
speaker: z.int().optional(),
|
|
19
|
+
speaker_label: z.string().optional(),
|
|
18
20
|
start: z.number(),
|
|
19
21
|
temperature: z.number().optional(),
|
|
20
22
|
text: z.string(),
|
|
@@ -24,6 +26,7 @@ export const STTSegment$inboundSchema = z
|
|
|
24
26
|
"avg_logprob": "avgLogprob",
|
|
25
27
|
"compression_ratio": "compressionRatio",
|
|
26
28
|
"no_speech_prob": "noSpeechProb",
|
|
29
|
+
"speaker_label": "speakerLabel",
|
|
27
30
|
});
|
|
28
31
|
});
|
|
29
32
|
export function sttSegmentFromJSON(jsonString) {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
/**
|
|
3
|
+
* Audio input fetched by the provider from a URL
|
|
4
|
+
*/
|
|
5
|
+
export type STTUrlInputAudio = {
|
|
6
|
+
/**
|
|
7
|
+
* Audio format of the file at the URL. Defaults to the extension of the URL path; required when the path has no extension.
|
|
8
|
+
*/
|
|
9
|
+
format?: string | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Publicly reachable http(s) URL of the audio file. The provider downloads it directly, so the inline upload size limit does not apply. Only supported by some providers.
|
|
12
|
+
*/
|
|
13
|
+
url: string;
|
|
14
|
+
};
|
|
15
|
+
/** @internal */
|
|
16
|
+
export type STTUrlInputAudio$Outbound = {
|
|
17
|
+
format?: string | undefined;
|
|
18
|
+
url: string;
|
|
19
|
+
};
|
|
20
|
+
/** @internal */
|
|
21
|
+
export declare const STTUrlInputAudio$outboundSchema: z.ZodType<STTUrlInputAudio$Outbound, STTUrlInputAudio>;
|
|
22
|
+
export declare function sttUrlInputAudioToJSON(sttUrlInputAudio: STTUrlInputAudio): string;
|
|
23
|
+
//# sourceMappingURL=stturlinputaudio.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: d7757cc949dd
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
/** @internal */
|
|
7
|
+
export const STTUrlInputAudio$outboundSchema = z.object({
|
|
8
|
+
format: z.string().optional(),
|
|
9
|
+
url: z.string(),
|
|
10
|
+
});
|
|
11
|
+
export function sttUrlInputAudioToJSON(sttUrlInputAudio) {
|
|
12
|
+
return JSON.stringify(STTUrlInputAudio$outboundSchema.parse(sttUrlInputAudio));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=stturlinputaudio.js.map
|
package/esm/models/sttword.d.ts
CHANGED
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
2
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
/**
|
|
6
|
+
* Kind of entry; omitted or "word" for spoken words, "audio_event" for non-speech sounds the provider tags with timestamps
|
|
7
|
+
*/
|
|
8
|
+
export declare const STTWordType: {
|
|
9
|
+
readonly Word: "word";
|
|
10
|
+
readonly AudioEvent: "audio_event";
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Kind of entry; omitted or "word" for spoken words, "audio_event" for non-speech sounds the provider tags with timestamps
|
|
14
|
+
*/
|
|
15
|
+
export type STTWordType = OpenEnum<typeof STTWordType>;
|
|
4
16
|
/**
|
|
5
17
|
* A timestamped word, returned when the provider includes word-level timestamps
|
|
6
18
|
*/
|
|
7
19
|
export type STTWord = {
|
|
20
|
+
/**
|
|
21
|
+
* Zero-based audio channel index for the word, present when the provider transcribes channels separately
|
|
22
|
+
*/
|
|
23
|
+
channel?: number | undefined;
|
|
8
24
|
/**
|
|
9
25
|
* Provider confidence for the word from 0 to 1, present when the provider returns per-word confidence
|
|
10
26
|
*/
|
|
@@ -17,16 +33,26 @@ export type STTWord = {
|
|
|
17
33
|
* Speaker index for the word, present when the provider returns diarization data
|
|
18
34
|
*/
|
|
19
35
|
speaker?: number | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Provider speaker label for the word, present when the provider labels speakers with a string
|
|
38
|
+
*/
|
|
39
|
+
speakerLabel?: string | undefined;
|
|
20
40
|
/**
|
|
21
41
|
* Word start time in seconds
|
|
22
42
|
*/
|
|
23
43
|
start: number;
|
|
24
44
|
/**
|
|
25
|
-
*
|
|
45
|
+
* Kind of entry; omitted or "word" for spoken words, "audio_event" for non-speech sounds the provider tags with timestamps
|
|
46
|
+
*/
|
|
47
|
+
type?: STTWordType | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* The transcribed word, or the event tag such as "(laughter)" when type is audio_event
|
|
26
50
|
*/
|
|
27
51
|
word: string;
|
|
28
52
|
};
|
|
29
53
|
/** @internal */
|
|
54
|
+
export declare const STTWordType$inboundSchema: z.ZodType<STTWordType, unknown>;
|
|
55
|
+
/** @internal */
|
|
30
56
|
export declare const STTWord$inboundSchema: z.ZodType<STTWord, unknown>;
|
|
31
57
|
export declare function sttWordFromJSON(jsonString: string): SafeParseResult<STTWord, SDKValidationError>;
|
|
32
58
|
//# sourceMappingURL=sttword.d.ts.map
|
package/esm/models/sttword.js
CHANGED
|
@@ -3,14 +3,32 @@
|
|
|
3
3
|
* @generated-id: 748744003b2c
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import * as openEnums from "../types/enums.js";
|
|
9
|
+
/**
|
|
10
|
+
* Kind of entry; omitted or "word" for spoken words, "audio_event" for non-speech sounds the provider tags with timestamps
|
|
11
|
+
*/
|
|
12
|
+
export const STTWordType = {
|
|
13
|
+
Word: "word",
|
|
14
|
+
AudioEvent: "audio_event",
|
|
15
|
+
};
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const STTWordType$inboundSchema = openEnums.inboundSchema(STTWordType);
|
|
7
18
|
/** @internal */
|
|
8
19
|
export const STTWord$inboundSchema = z.object({
|
|
20
|
+
channel: z.int().optional(),
|
|
9
21
|
confidence: z.number().optional(),
|
|
10
22
|
end: z.number(),
|
|
11
23
|
speaker: z.int().optional(),
|
|
24
|
+
speaker_label: z.string().optional(),
|
|
12
25
|
start: z.number(),
|
|
26
|
+
type: STTWordType$inboundSchema.optional(),
|
|
13
27
|
word: z.string(),
|
|
28
|
+
}).transform((v) => {
|
|
29
|
+
return remap$(v, {
|
|
30
|
+
"speaker_label": "speakerLabel",
|
|
31
|
+
});
|
|
14
32
|
});
|
|
15
33
|
export function sttWordFromJSON(jsonString) {
|
|
16
34
|
return safeParse(jsonString, (x) => STTWord$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'STTWord' from JSON`);
|
|
@@ -154,6 +154,9 @@ export type VideoGenerationRequestOptions = {
|
|
|
154
154
|
digitalocean?: {
|
|
155
155
|
[k: string]: any;
|
|
156
156
|
} | undefined;
|
|
157
|
+
elevenlabs?: {
|
|
158
|
+
[k: string]: any;
|
|
159
|
+
} | undefined;
|
|
157
160
|
enfer?: {
|
|
158
161
|
[k: string]: any;
|
|
159
162
|
} | undefined;
|
|
@@ -688,6 +691,9 @@ export type VideoGenerationRequestOptions$Outbound = {
|
|
|
688
691
|
digitalocean?: {
|
|
689
692
|
[k: string]: any;
|
|
690
693
|
} | undefined;
|
|
694
|
+
elevenlabs?: {
|
|
695
|
+
[k: string]: any;
|
|
696
|
+
} | undefined;
|
|
691
697
|
enfer?: {
|
|
692
698
|
[k: string]: any;
|
|
693
699
|
} | undefined;
|
|
@@ -82,6 +82,7 @@ export const VideoGenerationRequestOptions$outboundSchema = z.object({
|
|
|
82
82
|
deepseek: z.record(z.string(), z.any()).optional(),
|
|
83
83
|
dekallm: z.record(z.string(), z.any()).optional(),
|
|
84
84
|
digitalocean: z.record(z.string(), z.any()).optional(),
|
|
85
|
+
elevenlabs: z.record(z.string(), z.any()).optional(),
|
|
85
86
|
enfer: z.record(z.string(), z.any()).optional(),
|
|
86
87
|
fakeProvider: z.record(z.string(), z.any()).optional(),
|
|
87
88
|
featherless: z.record(z.string(), z.any()).optional(),
|
package/esm/sdk/stt.d.ts
CHANGED
|
@@ -6,14 +6,14 @@ export declare class STT extends ClientSDK {
|
|
|
6
6
|
* Create transcription
|
|
7
7
|
*
|
|
8
8
|
* @remarks
|
|
9
|
-
* Transcribes audio into text. Accepts base64-encoded audio input as JSON
|
|
9
|
+
* Transcribes audio into text. Accepts base64-encoded audio input as JSON, an OpenAI-style multipart/form-data file upload, or a URL the provider downloads directly, and returns the transcribed text.
|
|
10
10
|
*/
|
|
11
11
|
createTranscription(request: operations.CreateAudioTranscriptionsRequest, options?: RequestOptions): Promise<models.STTResponse>;
|
|
12
12
|
/**
|
|
13
13
|
* Create transcription
|
|
14
14
|
*
|
|
15
15
|
* @remarks
|
|
16
|
-
* Transcribes audio into text. Accepts base64-encoded audio input as JSON
|
|
16
|
+
* Transcribes audio into text. Accepts base64-encoded audio input as JSON, an OpenAI-style multipart/form-data file upload, or a URL the provider downloads directly, and returns the transcribed text.
|
|
17
17
|
*/
|
|
18
18
|
createTranscriptionMultipart(request: operations.CreateAudioTranscriptionsMultipartRequest, options?: RequestOptions): Promise<models.STTResponse>;
|
|
19
19
|
}
|
package/esm/sdk/stt.js
CHANGED
|
@@ -11,7 +11,7 @@ export class STT extends ClientSDK {
|
|
|
11
11
|
* Create transcription
|
|
12
12
|
*
|
|
13
13
|
* @remarks
|
|
14
|
-
* Transcribes audio into text. Accepts base64-encoded audio input as JSON
|
|
14
|
+
* Transcribes audio into text. Accepts base64-encoded audio input as JSON, an OpenAI-style multipart/form-data file upload, or a URL the provider downloads directly, and returns the transcribed text.
|
|
15
15
|
*/
|
|
16
16
|
async createTranscription(request, options) {
|
|
17
17
|
return unwrapAsync(sttCreateTranscription(this, request, options));
|
|
@@ -20,7 +20,7 @@ export class STT extends ClientSDK {
|
|
|
20
20
|
* Create transcription
|
|
21
21
|
*
|
|
22
22
|
* @remarks
|
|
23
|
-
* Transcribes audio into text. Accepts base64-encoded audio input as JSON
|
|
23
|
+
* Transcribes audio into text. Accepts base64-encoded audio input as JSON, an OpenAI-style multipart/form-data file upload, or a URL the provider downloads directly, and returns the transcribed text.
|
|
24
24
|
*/
|
|
25
25
|
async createTranscriptionMultipart(request, options) {
|
|
26
26
|
return unwrapAsync(sttCreateTranscriptionMultipart(this, request, options));
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.5",
|
|
4
4
|
"author": "OpenRouter",
|
|
5
5
|
"description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 400+ language models through a unified API.",
|
|
6
6
|
"keywords": [
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"license": "Apache-2.0",
|
|
22
22
|
"packageManager": "pnpm@10.22.0",
|
|
23
23
|
"publishConfig": {
|
|
24
|
-
"
|
|
25
|
-
"
|
|
24
|
+
"provenance": true,
|
|
25
|
+
"access": "public"
|
|
26
26
|
},
|
|
27
27
|
"type": "module",
|
|
28
28
|
"main": "./esm/index.js",
|
|
@@ -73,15 +73,15 @@
|
|
|
73
73
|
"lint": "eslint --cache --max-warnings=0 src",
|
|
74
74
|
"build": "tsc && node scripts/unbarrel-imports.js",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
-
"
|
|
76
|
+
"compile": "tsc && node scripts/unbarrel-imports.js",
|
|
77
77
|
"postinstall": "node scripts/check-types.js || true",
|
|
78
78
|
"prepare": "npm run build",
|
|
79
79
|
"test": "vitest --run --project unit",
|
|
80
80
|
"test:transit": "exit 0",
|
|
81
81
|
"test:watch": "vitest --watch --project unit",
|
|
82
|
-
"compile": "tsc && node scripts/unbarrel-imports.js",
|
|
83
82
|
"test:e2e": "vitest --run --project e2e",
|
|
84
|
-
"typecheck": "tsc --noEmit"
|
|
83
|
+
"typecheck": "tsc --noEmit",
|
|
84
|
+
"typecheck:transit": "exit 0"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
|