@opencode/ai 2.0.15 → 2.0.16
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/README.md +286 -2
- package/dist/generation.d.ts +36 -22
- package/dist/generation.js +53 -24
- package/dist/image-client.d.ts +14 -7
- package/dist/image-client.js +24 -8
- package/dist/image.d.ts +398 -47
- package/dist/image.js +47 -45
- package/dist/index.d.ts +13 -1
- package/dist/index.js +9 -0
- package/dist/media-model.d.ts +44 -0
- package/dist/media-model.js +49 -0
- package/dist/media.d.ts +10 -9
- package/dist/media.js +9 -10
- package/dist/promise.d.ts +428 -8
- package/dist/promise.js +40 -3
- package/dist/protocols/alibaba-chat.d.ts +12 -0
- package/dist/protocols/alibaba-responses.d.ts +2 -2
- package/dist/protocols/anthropic-messages.js +1 -2
- package/dist/protocols/assemblyai-transcription.d.ts +40 -0
- package/dist/protocols/assemblyai-transcription.js +138 -0
- package/dist/protocols/bedrock-converse.js +5 -11
- package/dist/protocols/bfl-images.d.ts +32 -0
- package/dist/protocols/bfl-images.js +153 -0
- package/dist/protocols/cartesia-speech.d.ts +127 -0
- package/dist/protocols/cartesia-speech.js +126 -0
- package/dist/protocols/deepgram-speech.d.ts +119 -0
- package/dist/protocols/deepgram-speech.js +92 -0
- package/dist/protocols/deepgram-transcription.d.ts +25 -0
- package/dist/protocols/deepgram-transcription.js +129 -0
- package/dist/protocols/elevenlabs-speech.d.ts +122 -0
- package/dist/protocols/elevenlabs-speech.js +115 -0
- package/dist/protocols/fal-images.d.ts +24 -0
- package/dist/protocols/fal-images.js +114 -0
- package/dist/protocols/fal-video.d.ts +29 -0
- package/dist/protocols/fal-video.js +88 -0
- package/dist/protocols/gemini.d.ts +9 -9
- package/dist/protocols/gemini.js +8 -34
- package/dist/protocols/google-images.js +2 -14
- package/dist/protocols/google-speech.d.ts +130 -0
- package/dist/protocols/google-speech.js +84 -0
- package/dist/protocols/google-transcription.d.ts +173 -0
- package/dist/protocols/google-transcription.js +138 -0
- package/dist/protocols/google-video.d.ts +26 -0
- package/dist/protocols/google-video.js +158 -0
- package/dist/protocols/meta-images.js +2 -9
- package/dist/protocols/meta-responses.d.ts +4 -4
- package/dist/protocols/meta-responses.js +1 -1
- package/dist/protocols/open-responses.d.ts +6 -6
- package/dist/protocols/open-responses.js +1 -2
- package/dist/protocols/openai-chat.d.ts +84 -0
- package/dist/protocols/openai-chat.js +26 -14
- package/dist/protocols/openai-compatible-chat.d.ts +12 -0
- package/dist/protocols/openai-compatible-responses.d.ts +2 -2
- package/dist/protocols/openai-images.d.ts +124 -3
- package/dist/protocols/openai-images.js +107 -54
- package/dist/protocols/openai-responses.d.ts +15 -15
- package/dist/protocols/openai-responses.js +5 -6
- package/dist/protocols/openai-speech.d.ts +116 -0
- package/dist/protocols/openai-speech.js +98 -0
- package/dist/protocols/openai-transcription.d.ts +207 -0
- package/dist/protocols/openai-transcription.js +190 -0
- package/dist/protocols/replicate-images.d.ts +28 -0
- package/dist/protocols/replicate-images.js +133 -0
- package/dist/protocols/runway-video.d.ts +38 -0
- package/dist/protocols/runway-video.js +146 -0
- package/dist/protocols/shared.d.ts +13 -3
- package/dist/protocols/shared.js +23 -3
- package/dist/protocols/stability-images.d.ts +38 -0
- package/dist/protocols/stability-images.js +148 -0
- package/dist/protocols/utils/fal-queue.d.ts +28 -0
- package/dist/protocols/utils/fal-queue.js +69 -0
- package/dist/protocols/utils/gemini-generate-content.d.ts +65 -0
- package/dist/protocols/utils/gemini-generate-content.js +65 -0
- package/dist/protocols/utils/gemini-json-schema.d.ts +3 -0
- package/dist/protocols/utils/gemini-json-schema.js +76 -0
- package/dist/protocols/utils/media-input.d.ts +8 -0
- package/dist/protocols/utils/media-input.js +18 -0
- package/dist/protocols/utils/speech-stream.d.ts +49 -0
- package/dist/protocols/utils/speech-stream.js +67 -0
- package/dist/protocols/utils/tool-schema.d.ts +2 -2
- package/dist/protocols/utils/tool-schema.js +40 -17
- package/dist/protocols/xai-images.js +1 -12
- package/dist/protocols/xai-responses.d.ts +2 -2
- package/dist/protocols/xai-video.d.ts +34 -0
- package/dist/protocols/xai-video.js +147 -0
- package/dist/protocols/zai-chat.d.ts +13 -1
- package/dist/provider-error.js +3 -0
- package/dist/providers/alibaba.d.ts +14 -2
- package/dist/providers/amazon-bedrock-mantle.d.ts +14 -2
- package/dist/providers/assemblyai.d.ts +25 -0
- package/dist/providers/assemblyai.js +29 -0
- package/dist/providers/azure.d.ts +18 -6
- package/dist/providers/baseten.d.ts +24 -0
- package/dist/providers/black-forest-labs.d.ts +25 -0
- package/dist/providers/black-forest-labs.js +28 -0
- package/dist/providers/cartesia.d.ts +24 -0
- package/dist/providers/cartesia.js +22 -0
- package/dist/providers/cerebras.d.ts +24 -0
- package/dist/providers/cloudflare-ai-gateway.d.ts +30 -6
- package/dist/providers/cloudflare-workers-ai.d.ts +24 -0
- package/dist/providers/deepgram.d.ts +29 -0
- package/dist/providers/deepgram.js +31 -0
- package/dist/providers/deepinfra.d.ts +24 -0
- package/dist/providers/deepseek.d.ts +24 -0
- package/dist/providers/elevenlabs.d.ts +24 -0
- package/dist/providers/elevenlabs.js +28 -0
- package/dist/providers/fal.d.ts +29 -0
- package/dist/providers/fal.js +33 -0
- package/dist/providers/fireworks.d.ts +24 -0
- package/dist/providers/google-vertex-chat.d.ts +12 -0
- package/dist/providers/google-vertex-responses.d.ts +2 -2
- package/dist/providers/google-vertex.d.ts +3 -3
- package/dist/providers/google.d.ts +18 -3
- package/dist/providers/google.js +11 -2
- package/dist/providers/groq.d.ts +24 -0
- package/dist/providers/index.d.ts +9 -0
- package/dist/providers/index.js +9 -0
- package/dist/providers/meta.d.ts +14 -2
- package/dist/providers/minimax.d.ts +14 -2
- package/dist/providers/moonshot.d.ts +14 -2
- package/dist/providers/moonshot.js +3 -3
- package/dist/providers/openai-compatible-responses.d.ts +2 -2
- package/dist/providers/openai-compatible.d.ts +12 -0
- package/dist/providers/openai.d.ts +25 -3
- package/dist/providers/openai.js +10 -1
- package/dist/providers/openrouter.d.ts +48 -0
- package/dist/providers/replicate.d.ts +25 -0
- package/dist/providers/replicate.js +22 -0
- package/dist/providers/runway.d.ts +24 -0
- package/dist/providers/runway.js +22 -0
- package/dist/providers/stability.d.ts +28 -0
- package/dist/providers/stability.js +23 -0
- package/dist/providers/togetherai.d.ts +24 -0
- package/dist/providers/xai.d.ts +17 -0
- package/dist/providers/xai.js +5 -2
- package/dist/providers/zai-coding-plan.d.ts +15 -3
- package/dist/providers/zai.d.ts +13 -1
- package/dist/route/auth.d.ts +4 -1
- package/dist/route/auth.js +6 -0
- package/dist/route/framing.d.ts +5 -1
- package/dist/route/framing.js +9 -0
- package/dist/route/media-protocol.d.ts +116 -3
- package/dist/route/media-protocol.js +60 -4
- package/dist/route/media.d.ts +58 -7
- package/dist/route/media.js +201 -29
- package/dist/schema/events.d.ts +0 -6
- package/dist/schema/messages.d.ts +0 -3
- package/dist/schema/options.d.ts +4 -3
- package/dist/schema/options.js +3 -2
- package/dist/speech-client.d.ts +21 -0
- package/dist/speech-client.js +25 -0
- package/dist/speech.d.ts +1150 -0
- package/dist/speech.js +119 -0
- package/dist/transcription-client.d.ts +28 -0
- package/dist/transcription-client.js +44 -0
- package/dist/transcription.d.ts +1504 -0
- package/dist/transcription.js +133 -0
- package/dist/utils/bytes.d.ts +1 -0
- package/dist/utils/bytes.js +10 -0
- package/dist/utils/media-type.d.ts +1 -0
- package/dist/utils/media-type.js +22 -1
- package/dist/video-client.d.ts +28 -0
- package/dist/video-client.js +40 -0
- package/dist/video.d.ts +1359 -0
- package/dist/video.js +119 -0
- package/package.json +3 -3
- package/dist/protocols/utils/gemini-tool-schema.d.ts +0 -2
- package/dist/protocols/utils/gemini-tool-schema.js +0 -103
|
@@ -0,0 +1,1504 @@
|
|
|
1
|
+
import { Effect, Schema, Stream } from "effect";
|
|
2
|
+
import { Generation, type AwaitOptions } from "./generation.js";
|
|
3
|
+
import { Media } from "./media.js";
|
|
4
|
+
import { MediaModel } from "./media-model.js";
|
|
5
|
+
import { MediaRoute } from "./route/media.js";
|
|
6
|
+
import type { MediaProtocol } from "./route/media-protocol.js";
|
|
7
|
+
import { AIError, HttpOptions } from "./schema/index.js";
|
|
8
|
+
import { Service } from "./transcription-client.js";
|
|
9
|
+
export type TranscriptionOptions = Record<string, unknown>;
|
|
10
|
+
export type TranscriptionRoute<Options extends TranscriptionOptions = TranscriptionOptions> = MediaRoute.AnyRoute<TranscriptionRequestFor<Options>, TranscriptionEvent, TranscriptionResponse>;
|
|
11
|
+
export declare class TranscriptionModel<Options extends TranscriptionOptions = TranscriptionOptions> extends MediaModel<TranscriptionRoute<Options>, Options> {
|
|
12
|
+
protected readonly _TranscriptionModel: void;
|
|
13
|
+
static make<Options extends TranscriptionOptions = TranscriptionOptions>(input: MediaModel.Input<TranscriptionRoute<Options>>): TranscriptionModel<Options>;
|
|
14
|
+
/** The number of type arguments selects the kind: `<Options>`, `<Options, Frame, State>`, or `<Options, Token>`. */
|
|
15
|
+
static fromRoute<Options extends TranscriptionOptions>(route: TranscriptionModel.InlineRouteInput<Options>, input: MediaRoute.ModelInput): TranscriptionModel<Options>;
|
|
16
|
+
static fromRoute<Options extends TranscriptionOptions, Frame, State>(route: TranscriptionModel.StreamRouteInput<Options, Frame, State>, input: MediaRoute.ModelInput): TranscriptionModel<Options>;
|
|
17
|
+
static fromRoute<Options extends TranscriptionOptions, Token>(route: TranscriptionModel.QueuedRouteInput<Options, Token>, input: MediaRoute.ModelInput): TranscriptionModel<Options>;
|
|
18
|
+
}
|
|
19
|
+
export declare namespace TranscriptionModel {
|
|
20
|
+
type InlineRouteInput<Options extends TranscriptionOptions = TranscriptionOptions> = MediaModel.RouteInput<TranscriptionRequestFor<Options>, MediaProtocol.Inline<TranscriptionRequestFor<Options>, TranscriptionResponse>>;
|
|
21
|
+
type StreamRouteInput<Options extends TranscriptionOptions = TranscriptionOptions, Frame = unknown, State = unknown> = MediaModel.RouteInput<MediaProtocol.Addressed<TranscriptionRequestFor<Options>>, MediaProtocol.Streamed<TranscriptionRequestFor<Options>, TranscriptionEvent, Frame, State>>;
|
|
22
|
+
type QueuedRouteInput<Options extends TranscriptionOptions = TranscriptionOptions, Token = unknown> = MediaModel.RouteInput<TranscriptionRequestFor<Options>, MediaProtocol.Queued<TranscriptionRequestFor<Options>, TranscriptionResponse, Token>>;
|
|
23
|
+
type RouteInput<Options extends TranscriptionOptions = TranscriptionOptions, Frame = unknown, State = unknown, Token = unknown> = MediaModel.AnyRouteInput<TranscriptionRequestFor<Options>, TranscriptionEvent, TranscriptionResponse, Frame, State, Token>;
|
|
24
|
+
}
|
|
25
|
+
export declare const TranscriptionModelSchema: Schema.declare<TranscriptionModel<TranscriptionOptions>, TranscriptionModel<TranscriptionOptions>>;
|
|
26
|
+
export declare const TranscriptionTimestamps: Schema.Literals<readonly ["none", "segment", "word"]>;
|
|
27
|
+
export type TranscriptionTimestamps = Schema.Schema.Type<typeof TranscriptionTimestamps>;
|
|
28
|
+
declare const TranscriptionRequest_base: Schema.Class<TranscriptionRequest, Schema.Struct<{
|
|
29
|
+
readonly model: Schema.declare<TranscriptionModel<TranscriptionOptions>, TranscriptionModel<TranscriptionOptions>>;
|
|
30
|
+
readonly audio: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
31
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
32
|
+
readonly type: Schema.Literal<"bytes">;
|
|
33
|
+
readonly data: Schema.Uint8Array;
|
|
34
|
+
readonly mediaType: Schema.String;
|
|
35
|
+
}>, Schema.Struct<{
|
|
36
|
+
readonly type: Schema.Literal<"base64">;
|
|
37
|
+
readonly data: Schema.String;
|
|
38
|
+
readonly mediaType: Schema.String;
|
|
39
|
+
}>, Schema.Struct<{
|
|
40
|
+
readonly type: Schema.Literal<"url">;
|
|
41
|
+
readonly url: Schema.String;
|
|
42
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
43
|
+
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
44
|
+
}>, Schema.Struct<{
|
|
45
|
+
readonly type: Schema.Literal<"ref">;
|
|
46
|
+
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
47
|
+
readonly id: Schema.String;
|
|
48
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
49
|
+
}>]>;
|
|
50
|
+
readonly info: Schema.optional<Schema.Struct<{
|
|
51
|
+
readonly width: Schema.optional<Schema.Number>;
|
|
52
|
+
readonly height: Schema.optional<Schema.Number>;
|
|
53
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
54
|
+
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
55
|
+
readonly channels: Schema.optional<Schema.Number>;
|
|
56
|
+
readonly encoding: Schema.optional<Schema.String>;
|
|
57
|
+
readonly format: Schema.optional<Schema.String>;
|
|
58
|
+
}>>;
|
|
59
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
60
|
+
}>, never, never>;
|
|
61
|
+
readonly language: Schema.optional<Schema.String>;
|
|
62
|
+
readonly prompt: Schema.optional<Schema.String>;
|
|
63
|
+
/** Routes that cannot produce the requested granularity fail typed; routes may return more than asked. */
|
|
64
|
+
readonly timestamps: Schema.optional<Schema.Literals<readonly ["none", "segment", "word"]>>;
|
|
65
|
+
readonly diarize: Schema.optional<Schema.Boolean>;
|
|
66
|
+
readonly speakers: Schema.optional<Schema.Int>;
|
|
67
|
+
readonly providerOptions: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
68
|
+
readonly http: Schema.optional<typeof HttpOptions>;
|
|
69
|
+
}>, {}>;
|
|
70
|
+
export declare class TranscriptionRequest extends TranscriptionRequest_base {
|
|
71
|
+
protected readonly _TranscriptionRequest: void;
|
|
72
|
+
}
|
|
73
|
+
export type TranscriptionRequestFor<Options extends TranscriptionOptions = TranscriptionOptions> = Omit<TranscriptionRequest, "model" | "providerOptions"> & {
|
|
74
|
+
readonly model: TranscriptionModel<Options>;
|
|
75
|
+
readonly providerOptions?: Options;
|
|
76
|
+
};
|
|
77
|
+
export type TranscriptionModelOptions<Model> = Model extends TranscriptionModel<infer Options> ? Options : never;
|
|
78
|
+
export type TranscriptionRequestInput<Model extends TranscriptionModel = TranscriptionModel> = Omit<ConstructorParameters<typeof TranscriptionRequest>[0], "model" | "providerOptions" | "http"> & {
|
|
79
|
+
readonly model: Model;
|
|
80
|
+
readonly providerOptions?: NoInfer<TranscriptionModelOptions<Model>>;
|
|
81
|
+
readonly http?: HttpOptions.Input;
|
|
82
|
+
};
|
|
83
|
+
/** Speaker labels are provider-native (`A`, `0`, `spk:0`, or a known speaker name). */
|
|
84
|
+
export declare const TranscriptionSegment: Schema.Struct<{
|
|
85
|
+
readonly text: Schema.String;
|
|
86
|
+
readonly startSeconds: Schema.Number;
|
|
87
|
+
readonly endSeconds: Schema.Number;
|
|
88
|
+
readonly speaker: Schema.optional<Schema.String>;
|
|
89
|
+
}>;
|
|
90
|
+
export type TranscriptionSegment = Schema.Schema.Type<typeof TranscriptionSegment>;
|
|
91
|
+
export declare const TranscriptionWord: Schema.Struct<{
|
|
92
|
+
readonly text: Schema.String;
|
|
93
|
+
readonly startSeconds: Schema.Number;
|
|
94
|
+
readonly endSeconds: Schema.Number;
|
|
95
|
+
readonly speaker: Schema.optional<Schema.String>;
|
|
96
|
+
readonly confidence: Schema.optional<Schema.Number>;
|
|
97
|
+
}>;
|
|
98
|
+
export type TranscriptionWord = Schema.Schema.Type<typeof TranscriptionWord>;
|
|
99
|
+
declare const TranscriptionResponse_base: Schema.Class<TranscriptionResponse, Schema.Struct<{
|
|
100
|
+
text: Schema.String;
|
|
101
|
+
segments: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
102
|
+
readonly text: Schema.String;
|
|
103
|
+
readonly startSeconds: Schema.Number;
|
|
104
|
+
readonly endSeconds: Schema.Number;
|
|
105
|
+
readonly speaker: Schema.optional<Schema.String>;
|
|
106
|
+
}>>>;
|
|
107
|
+
words: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
108
|
+
readonly text: Schema.String;
|
|
109
|
+
readonly startSeconds: Schema.Number;
|
|
110
|
+
readonly endSeconds: Schema.Number;
|
|
111
|
+
readonly speaker: Schema.optional<Schema.String>;
|
|
112
|
+
readonly confidence: Schema.optional<Schema.Number>;
|
|
113
|
+
}>>>;
|
|
114
|
+
/** Provider-native language as detected or echoed (`en`, `english`, `en_us`), lowercased but not normalized. */
|
|
115
|
+
language: Schema.optional<Schema.String>;
|
|
116
|
+
durationSeconds: Schema.optional<Schema.Number>;
|
|
117
|
+
usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
118
|
+
readonly type: Schema.Literal<"tokens">;
|
|
119
|
+
readonly input: Schema.optional<Schema.Number>;
|
|
120
|
+
readonly output: Schema.optional<Schema.Number>;
|
|
121
|
+
readonly total: Schema.optional<Schema.Number>;
|
|
122
|
+
readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
123
|
+
}>, Schema.Struct<{
|
|
124
|
+
readonly type: Schema.Literal<"seconds">;
|
|
125
|
+
readonly seconds: Schema.Number;
|
|
126
|
+
}>, Schema.Struct<{
|
|
127
|
+
readonly type: Schema.Literal<"characters">;
|
|
128
|
+
readonly characters: Schema.Number;
|
|
129
|
+
}>, Schema.Struct<{
|
|
130
|
+
readonly type: Schema.Literal<"credits">;
|
|
131
|
+
readonly credits: Schema.Number;
|
|
132
|
+
}>, Schema.Struct<{
|
|
133
|
+
readonly type: Schema.Literal<"compute">;
|
|
134
|
+
readonly seconds: Schema.Number;
|
|
135
|
+
}>]>>;
|
|
136
|
+
notices: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
137
|
+
readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
|
|
138
|
+
readonly message: Schema.String;
|
|
139
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
140
|
+
}>>>;
|
|
141
|
+
providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
142
|
+
}>, {}>;
|
|
143
|
+
export declare class TranscriptionResponse extends TranscriptionResponse_base {
|
|
144
|
+
}
|
|
145
|
+
export declare const TranscriptionTextDeltaEvent: Schema.Struct<{
|
|
146
|
+
readonly type: Schema.tag<"text-delta">;
|
|
147
|
+
readonly delta: Schema.String;
|
|
148
|
+
}>;
|
|
149
|
+
export declare const TranscriptionSegmentEvent: Schema.Struct<{
|
|
150
|
+
readonly type: Schema.tag<"segment">;
|
|
151
|
+
readonly segment: Schema.Struct<{
|
|
152
|
+
readonly text: Schema.String;
|
|
153
|
+
readonly startSeconds: Schema.Number;
|
|
154
|
+
readonly endSeconds: Schema.Number;
|
|
155
|
+
readonly speaker: Schema.optional<Schema.String>;
|
|
156
|
+
}>;
|
|
157
|
+
}>;
|
|
158
|
+
export declare const TranscriptionFinishEvent: Schema.Struct<{
|
|
159
|
+
readonly text: Schema.String;
|
|
160
|
+
readonly segments: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
161
|
+
readonly text: Schema.String;
|
|
162
|
+
readonly startSeconds: Schema.Number;
|
|
163
|
+
readonly endSeconds: Schema.Number;
|
|
164
|
+
readonly speaker: Schema.optional<Schema.String>;
|
|
165
|
+
}>>>;
|
|
166
|
+
readonly words: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
167
|
+
readonly text: Schema.String;
|
|
168
|
+
readonly startSeconds: Schema.Number;
|
|
169
|
+
readonly endSeconds: Schema.Number;
|
|
170
|
+
readonly speaker: Schema.optional<Schema.String>;
|
|
171
|
+
readonly confidence: Schema.optional<Schema.Number>;
|
|
172
|
+
}>>>;
|
|
173
|
+
readonly language: Schema.optional<Schema.String>;
|
|
174
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
175
|
+
readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
176
|
+
readonly type: Schema.Literal<"tokens">;
|
|
177
|
+
readonly input: Schema.optional<Schema.Number>;
|
|
178
|
+
readonly output: Schema.optional<Schema.Number>;
|
|
179
|
+
readonly total: Schema.optional<Schema.Number>;
|
|
180
|
+
readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
181
|
+
}>, Schema.Struct<{
|
|
182
|
+
readonly type: Schema.Literal<"seconds">;
|
|
183
|
+
readonly seconds: Schema.Number;
|
|
184
|
+
}>, Schema.Struct<{
|
|
185
|
+
readonly type: Schema.Literal<"characters">;
|
|
186
|
+
readonly characters: Schema.Number;
|
|
187
|
+
}>, Schema.Struct<{
|
|
188
|
+
readonly type: Schema.Literal<"credits">;
|
|
189
|
+
readonly credits: Schema.Number;
|
|
190
|
+
}>, Schema.Struct<{
|
|
191
|
+
readonly type: Schema.Literal<"compute">;
|
|
192
|
+
readonly seconds: Schema.Number;
|
|
193
|
+
}>]>>;
|
|
194
|
+
readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
195
|
+
readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
|
|
196
|
+
readonly message: Schema.String;
|
|
197
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
198
|
+
}>>>;
|
|
199
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
200
|
+
readonly type: Schema.tag<"finish">;
|
|
201
|
+
}>;
|
|
202
|
+
declare const transcriptionEventTagged: Schema.toTaggedUnion<"type", readonly [Schema.Struct<{
|
|
203
|
+
readonly type: Schema.tag<"generation-queued">;
|
|
204
|
+
readonly id: Schema.String;
|
|
205
|
+
readonly position: Schema.optional<Schema.Number>;
|
|
206
|
+
}>, Schema.Struct<{
|
|
207
|
+
readonly type: Schema.tag<"generation-progress">;
|
|
208
|
+
readonly id: Schema.String;
|
|
209
|
+
readonly progress: Schema.optional<Schema.Number>;
|
|
210
|
+
}>, Schema.Struct<{
|
|
211
|
+
readonly type: Schema.tag<"text-delta">;
|
|
212
|
+
readonly delta: Schema.String;
|
|
213
|
+
}>, Schema.Struct<{
|
|
214
|
+
readonly type: Schema.tag<"segment">;
|
|
215
|
+
readonly segment: Schema.Struct<{
|
|
216
|
+
readonly text: Schema.String;
|
|
217
|
+
readonly startSeconds: Schema.Number;
|
|
218
|
+
readonly endSeconds: Schema.Number;
|
|
219
|
+
readonly speaker: Schema.optional<Schema.String>;
|
|
220
|
+
}>;
|
|
221
|
+
}>, Schema.Struct<{
|
|
222
|
+
readonly text: Schema.String;
|
|
223
|
+
readonly segments: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
224
|
+
readonly text: Schema.String;
|
|
225
|
+
readonly startSeconds: Schema.Number;
|
|
226
|
+
readonly endSeconds: Schema.Number;
|
|
227
|
+
readonly speaker: Schema.optional<Schema.String>;
|
|
228
|
+
}>>>;
|
|
229
|
+
readonly words: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
230
|
+
readonly text: Schema.String;
|
|
231
|
+
readonly startSeconds: Schema.Number;
|
|
232
|
+
readonly endSeconds: Schema.Number;
|
|
233
|
+
readonly speaker: Schema.optional<Schema.String>;
|
|
234
|
+
readonly confidence: Schema.optional<Schema.Number>;
|
|
235
|
+
}>>>;
|
|
236
|
+
readonly language: Schema.optional<Schema.String>;
|
|
237
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
238
|
+
readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
239
|
+
readonly type: Schema.Literal<"tokens">;
|
|
240
|
+
readonly input: Schema.optional<Schema.Number>;
|
|
241
|
+
readonly output: Schema.optional<Schema.Number>;
|
|
242
|
+
readonly total: Schema.optional<Schema.Number>;
|
|
243
|
+
readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
244
|
+
}>, Schema.Struct<{
|
|
245
|
+
readonly type: Schema.Literal<"seconds">;
|
|
246
|
+
readonly seconds: Schema.Number;
|
|
247
|
+
}>, Schema.Struct<{
|
|
248
|
+
readonly type: Schema.Literal<"characters">;
|
|
249
|
+
readonly characters: Schema.Number;
|
|
250
|
+
}>, Schema.Struct<{
|
|
251
|
+
readonly type: Schema.Literal<"credits">;
|
|
252
|
+
readonly credits: Schema.Number;
|
|
253
|
+
}>, Schema.Struct<{
|
|
254
|
+
readonly type: Schema.Literal<"compute">;
|
|
255
|
+
readonly seconds: Schema.Number;
|
|
256
|
+
}>]>>;
|
|
257
|
+
readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
258
|
+
readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
|
|
259
|
+
readonly message: Schema.String;
|
|
260
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
261
|
+
}>>>;
|
|
262
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
263
|
+
readonly type: Schema.tag<"finish">;
|
|
264
|
+
}>]>;
|
|
265
|
+
export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
|
|
266
|
+
readonly type: Schema.tag<"generation-queued">;
|
|
267
|
+
readonly id: Schema.String;
|
|
268
|
+
readonly position: Schema.optional<Schema.Number>;
|
|
269
|
+
}>, Schema.Struct<{
|
|
270
|
+
readonly type: Schema.tag<"generation-progress">;
|
|
271
|
+
readonly id: Schema.String;
|
|
272
|
+
readonly progress: Schema.optional<Schema.Number>;
|
|
273
|
+
}>, Schema.Struct<{
|
|
274
|
+
readonly type: Schema.tag<"text-delta">;
|
|
275
|
+
readonly delta: Schema.String;
|
|
276
|
+
}>, Schema.Struct<{
|
|
277
|
+
readonly type: Schema.tag<"segment">;
|
|
278
|
+
readonly segment: Schema.Struct<{
|
|
279
|
+
readonly text: Schema.String;
|
|
280
|
+
readonly startSeconds: Schema.Number;
|
|
281
|
+
readonly endSeconds: Schema.Number;
|
|
282
|
+
readonly speaker: Schema.optional<Schema.String>;
|
|
283
|
+
}>;
|
|
284
|
+
}>, Schema.Struct<{
|
|
285
|
+
readonly text: Schema.String;
|
|
286
|
+
readonly segments: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
287
|
+
readonly text: Schema.String;
|
|
288
|
+
readonly startSeconds: Schema.Number;
|
|
289
|
+
readonly endSeconds: Schema.Number;
|
|
290
|
+
readonly speaker: Schema.optional<Schema.String>;
|
|
291
|
+
}>>>;
|
|
292
|
+
readonly words: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
293
|
+
readonly text: Schema.String;
|
|
294
|
+
readonly startSeconds: Schema.Number;
|
|
295
|
+
readonly endSeconds: Schema.Number;
|
|
296
|
+
readonly speaker: Schema.optional<Schema.String>;
|
|
297
|
+
readonly confidence: Schema.optional<Schema.Number>;
|
|
298
|
+
}>>>;
|
|
299
|
+
readonly language: Schema.optional<Schema.String>;
|
|
300
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
301
|
+
readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
302
|
+
readonly type: Schema.Literal<"tokens">;
|
|
303
|
+
readonly input: Schema.optional<Schema.Number>;
|
|
304
|
+
readonly output: Schema.optional<Schema.Number>;
|
|
305
|
+
readonly total: Schema.optional<Schema.Number>;
|
|
306
|
+
readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
307
|
+
}>, Schema.Struct<{
|
|
308
|
+
readonly type: Schema.Literal<"seconds">;
|
|
309
|
+
readonly seconds: Schema.Number;
|
|
310
|
+
}>, Schema.Struct<{
|
|
311
|
+
readonly type: Schema.Literal<"characters">;
|
|
312
|
+
readonly characters: Schema.Number;
|
|
313
|
+
}>, Schema.Struct<{
|
|
314
|
+
readonly type: Schema.Literal<"credits">;
|
|
315
|
+
readonly credits: Schema.Number;
|
|
316
|
+
}>, Schema.Struct<{
|
|
317
|
+
readonly type: Schema.Literal<"compute">;
|
|
318
|
+
readonly seconds: Schema.Number;
|
|
319
|
+
}>]>>;
|
|
320
|
+
readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
321
|
+
readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
|
|
322
|
+
readonly message: Schema.String;
|
|
323
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
324
|
+
}>>>;
|
|
325
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
326
|
+
readonly type: Schema.tag<"finish">;
|
|
327
|
+
}>]> & {
|
|
328
|
+
readonly discriminants: readonly ["generation-queued", "generation-progress", "text-delta", "segment", "finish"];
|
|
329
|
+
readonly cases: {
|
|
330
|
+
"generation-queued": Schema.Struct<{
|
|
331
|
+
readonly type: Schema.tag<"generation-queued">;
|
|
332
|
+
readonly id: Schema.String;
|
|
333
|
+
readonly position: Schema.optional<Schema.Number>;
|
|
334
|
+
}>;
|
|
335
|
+
"generation-progress": Schema.Struct<{
|
|
336
|
+
readonly type: Schema.tag<"generation-progress">;
|
|
337
|
+
readonly id: Schema.String;
|
|
338
|
+
readonly progress: Schema.optional<Schema.Number>;
|
|
339
|
+
}>;
|
|
340
|
+
"text-delta": Schema.Struct<{
|
|
341
|
+
readonly type: Schema.tag<"text-delta">;
|
|
342
|
+
readonly delta: Schema.String;
|
|
343
|
+
}>;
|
|
344
|
+
segment: Schema.Struct<{
|
|
345
|
+
readonly type: Schema.tag<"segment">;
|
|
346
|
+
readonly segment: Schema.Struct<{
|
|
347
|
+
readonly text: Schema.String;
|
|
348
|
+
readonly startSeconds: Schema.Number;
|
|
349
|
+
readonly endSeconds: Schema.Number;
|
|
350
|
+
readonly speaker: Schema.optional<Schema.String>;
|
|
351
|
+
}>;
|
|
352
|
+
}>;
|
|
353
|
+
finish: Schema.Struct<{
|
|
354
|
+
readonly text: Schema.String;
|
|
355
|
+
readonly segments: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
356
|
+
readonly text: Schema.String;
|
|
357
|
+
readonly startSeconds: Schema.Number;
|
|
358
|
+
readonly endSeconds: Schema.Number;
|
|
359
|
+
readonly speaker: Schema.optional<Schema.String>;
|
|
360
|
+
}>>>;
|
|
361
|
+
readonly words: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
362
|
+
readonly text: Schema.String;
|
|
363
|
+
readonly startSeconds: Schema.Number;
|
|
364
|
+
readonly endSeconds: Schema.Number;
|
|
365
|
+
readonly speaker: Schema.optional<Schema.String>;
|
|
366
|
+
readonly confidence: Schema.optional<Schema.Number>;
|
|
367
|
+
}>>>;
|
|
368
|
+
readonly language: Schema.optional<Schema.String>;
|
|
369
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
370
|
+
readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
371
|
+
readonly type: Schema.Literal<"tokens">;
|
|
372
|
+
readonly input: Schema.optional<Schema.Number>;
|
|
373
|
+
readonly output: Schema.optional<Schema.Number>;
|
|
374
|
+
readonly total: Schema.optional<Schema.Number>;
|
|
375
|
+
readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
376
|
+
}>, Schema.Struct<{
|
|
377
|
+
readonly type: Schema.Literal<"seconds">;
|
|
378
|
+
readonly seconds: Schema.Number;
|
|
379
|
+
}>, Schema.Struct<{
|
|
380
|
+
readonly type: Schema.Literal<"characters">;
|
|
381
|
+
readonly characters: Schema.Number;
|
|
382
|
+
}>, Schema.Struct<{
|
|
383
|
+
readonly type: Schema.Literal<"credits">;
|
|
384
|
+
readonly credits: Schema.Number;
|
|
385
|
+
}>, Schema.Struct<{
|
|
386
|
+
readonly type: Schema.Literal<"compute">;
|
|
387
|
+
readonly seconds: Schema.Number;
|
|
388
|
+
}>]>>;
|
|
389
|
+
readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
390
|
+
readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
|
|
391
|
+
readonly message: Schema.String;
|
|
392
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
393
|
+
}>>>;
|
|
394
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
395
|
+
readonly type: Schema.tag<"finish">;
|
|
396
|
+
}>;
|
|
397
|
+
};
|
|
398
|
+
readonly isAnyOf: <const Keys>(keys: readonly Keys[]) => (value: {
|
|
399
|
+
readonly id: string;
|
|
400
|
+
readonly type: "generation-queued";
|
|
401
|
+
readonly position?: number | undefined;
|
|
402
|
+
} | {
|
|
403
|
+
readonly id: string;
|
|
404
|
+
readonly type: "generation-progress";
|
|
405
|
+
readonly progress?: number | undefined;
|
|
406
|
+
} | {
|
|
407
|
+
readonly type: "text-delta";
|
|
408
|
+
readonly delta: string;
|
|
409
|
+
} | {
|
|
410
|
+
readonly type: "segment";
|
|
411
|
+
readonly segment: {
|
|
412
|
+
readonly text: string;
|
|
413
|
+
readonly startSeconds: number;
|
|
414
|
+
readonly endSeconds: number;
|
|
415
|
+
readonly speaker?: string | undefined;
|
|
416
|
+
};
|
|
417
|
+
} | {
|
|
418
|
+
readonly type: "finish";
|
|
419
|
+
readonly text: string;
|
|
420
|
+
readonly durationSeconds?: number | undefined;
|
|
421
|
+
readonly providerMetadata?: {
|
|
422
|
+
readonly [x: string]: {
|
|
423
|
+
readonly [x: string]: unknown;
|
|
424
|
+
};
|
|
425
|
+
} | undefined;
|
|
426
|
+
readonly usage?: {
|
|
427
|
+
readonly type: "tokens";
|
|
428
|
+
readonly input?: number | undefined;
|
|
429
|
+
readonly output?: number | undefined;
|
|
430
|
+
readonly total?: number | undefined;
|
|
431
|
+
readonly details?: {
|
|
432
|
+
readonly [x: string]: unknown;
|
|
433
|
+
} | undefined;
|
|
434
|
+
} | {
|
|
435
|
+
readonly type: "seconds";
|
|
436
|
+
readonly seconds: number;
|
|
437
|
+
} | {
|
|
438
|
+
readonly type: "characters";
|
|
439
|
+
readonly characters: number;
|
|
440
|
+
} | {
|
|
441
|
+
readonly type: "credits";
|
|
442
|
+
readonly credits: number;
|
|
443
|
+
} | {
|
|
444
|
+
readonly type: "compute";
|
|
445
|
+
readonly seconds: number;
|
|
446
|
+
} | undefined;
|
|
447
|
+
readonly notices?: readonly {
|
|
448
|
+
readonly type: "other" | "moderated" | "filtered";
|
|
449
|
+
readonly message: string;
|
|
450
|
+
readonly providerMetadata?: {
|
|
451
|
+
readonly [x: string]: {
|
|
452
|
+
readonly [x: string]: unknown;
|
|
453
|
+
};
|
|
454
|
+
} | undefined;
|
|
455
|
+
}[] | undefined;
|
|
456
|
+
readonly language?: string | undefined;
|
|
457
|
+
readonly segments?: readonly {
|
|
458
|
+
readonly text: string;
|
|
459
|
+
readonly startSeconds: number;
|
|
460
|
+
readonly endSeconds: number;
|
|
461
|
+
readonly speaker?: string | undefined;
|
|
462
|
+
}[] | undefined;
|
|
463
|
+
readonly words?: readonly {
|
|
464
|
+
readonly text: string;
|
|
465
|
+
readonly startSeconds: number;
|
|
466
|
+
readonly endSeconds: number;
|
|
467
|
+
readonly speaker?: string | undefined;
|
|
468
|
+
readonly confidence?: number | undefined;
|
|
469
|
+
}[] | undefined;
|
|
470
|
+
}) => value is Extract<{
|
|
471
|
+
readonly id: string;
|
|
472
|
+
readonly type: "generation-queued";
|
|
473
|
+
readonly position?: number | undefined;
|
|
474
|
+
}, {
|
|
475
|
+
readonly type: Keys;
|
|
476
|
+
}> | Extract<{
|
|
477
|
+
readonly id: string;
|
|
478
|
+
readonly type: "generation-progress";
|
|
479
|
+
readonly progress?: number | undefined;
|
|
480
|
+
}, {
|
|
481
|
+
readonly type: Keys;
|
|
482
|
+
}> | Extract<{
|
|
483
|
+
readonly type: "text-delta";
|
|
484
|
+
readonly delta: string;
|
|
485
|
+
}, {
|
|
486
|
+
readonly type: Keys;
|
|
487
|
+
}> | Extract<{
|
|
488
|
+
readonly type: "segment";
|
|
489
|
+
readonly segment: {
|
|
490
|
+
readonly text: string;
|
|
491
|
+
readonly startSeconds: number;
|
|
492
|
+
readonly endSeconds: number;
|
|
493
|
+
readonly speaker?: string | undefined;
|
|
494
|
+
};
|
|
495
|
+
}, {
|
|
496
|
+
readonly type: Keys;
|
|
497
|
+
}> | Extract<{
|
|
498
|
+
readonly type: "finish";
|
|
499
|
+
readonly text: string;
|
|
500
|
+
readonly durationSeconds?: number | undefined;
|
|
501
|
+
readonly providerMetadata?: {
|
|
502
|
+
readonly [x: string]: {
|
|
503
|
+
readonly [x: string]: unknown;
|
|
504
|
+
};
|
|
505
|
+
} | undefined;
|
|
506
|
+
readonly usage?: {
|
|
507
|
+
readonly type: "tokens";
|
|
508
|
+
readonly input?: number | undefined;
|
|
509
|
+
readonly output?: number | undefined;
|
|
510
|
+
readonly total?: number | undefined;
|
|
511
|
+
readonly details?: {
|
|
512
|
+
readonly [x: string]: unknown;
|
|
513
|
+
} | undefined;
|
|
514
|
+
} | {
|
|
515
|
+
readonly type: "seconds";
|
|
516
|
+
readonly seconds: number;
|
|
517
|
+
} | {
|
|
518
|
+
readonly type: "characters";
|
|
519
|
+
readonly characters: number;
|
|
520
|
+
} | {
|
|
521
|
+
readonly type: "credits";
|
|
522
|
+
readonly credits: number;
|
|
523
|
+
} | {
|
|
524
|
+
readonly type: "compute";
|
|
525
|
+
readonly seconds: number;
|
|
526
|
+
} | undefined;
|
|
527
|
+
readonly notices?: readonly {
|
|
528
|
+
readonly type: "other" | "moderated" | "filtered";
|
|
529
|
+
readonly message: string;
|
|
530
|
+
readonly providerMetadata?: {
|
|
531
|
+
readonly [x: string]: {
|
|
532
|
+
readonly [x: string]: unknown;
|
|
533
|
+
};
|
|
534
|
+
} | undefined;
|
|
535
|
+
}[] | undefined;
|
|
536
|
+
readonly language?: string | undefined;
|
|
537
|
+
readonly segments?: readonly {
|
|
538
|
+
readonly text: string;
|
|
539
|
+
readonly startSeconds: number;
|
|
540
|
+
readonly endSeconds: number;
|
|
541
|
+
readonly speaker?: string | undefined;
|
|
542
|
+
}[] | undefined;
|
|
543
|
+
readonly words?: readonly {
|
|
544
|
+
readonly text: string;
|
|
545
|
+
readonly startSeconds: number;
|
|
546
|
+
readonly endSeconds: number;
|
|
547
|
+
readonly speaker?: string | undefined;
|
|
548
|
+
readonly confidence?: number | undefined;
|
|
549
|
+
}[] | undefined;
|
|
550
|
+
}, {
|
|
551
|
+
readonly type: Keys;
|
|
552
|
+
}>;
|
|
553
|
+
readonly guards: {
|
|
554
|
+
"generation-queued": (u: unknown) => u is {
|
|
555
|
+
readonly id: string;
|
|
556
|
+
readonly type: "generation-queued";
|
|
557
|
+
readonly position?: number | undefined;
|
|
558
|
+
};
|
|
559
|
+
"generation-progress": (u: unknown) => u is {
|
|
560
|
+
readonly id: string;
|
|
561
|
+
readonly type: "generation-progress";
|
|
562
|
+
readonly progress?: number | undefined;
|
|
563
|
+
};
|
|
564
|
+
"text-delta": (u: unknown) => u is {
|
|
565
|
+
readonly type: "text-delta";
|
|
566
|
+
readonly delta: string;
|
|
567
|
+
};
|
|
568
|
+
segment: (u: unknown) => u is {
|
|
569
|
+
readonly type: "segment";
|
|
570
|
+
readonly segment: {
|
|
571
|
+
readonly text: string;
|
|
572
|
+
readonly startSeconds: number;
|
|
573
|
+
readonly endSeconds: number;
|
|
574
|
+
readonly speaker?: string | undefined;
|
|
575
|
+
};
|
|
576
|
+
};
|
|
577
|
+
finish: (u: unknown) => u is {
|
|
578
|
+
readonly type: "finish";
|
|
579
|
+
readonly text: string;
|
|
580
|
+
readonly durationSeconds?: number | undefined;
|
|
581
|
+
readonly providerMetadata?: {
|
|
582
|
+
readonly [x: string]: {
|
|
583
|
+
readonly [x: string]: unknown;
|
|
584
|
+
};
|
|
585
|
+
} | undefined;
|
|
586
|
+
readonly usage?: {
|
|
587
|
+
readonly type: "tokens";
|
|
588
|
+
readonly input?: number | undefined;
|
|
589
|
+
readonly output?: number | undefined;
|
|
590
|
+
readonly total?: number | undefined;
|
|
591
|
+
readonly details?: {
|
|
592
|
+
readonly [x: string]: unknown;
|
|
593
|
+
} | undefined;
|
|
594
|
+
} | {
|
|
595
|
+
readonly type: "seconds";
|
|
596
|
+
readonly seconds: number;
|
|
597
|
+
} | {
|
|
598
|
+
readonly type: "characters";
|
|
599
|
+
readonly characters: number;
|
|
600
|
+
} | {
|
|
601
|
+
readonly type: "credits";
|
|
602
|
+
readonly credits: number;
|
|
603
|
+
} | {
|
|
604
|
+
readonly type: "compute";
|
|
605
|
+
readonly seconds: number;
|
|
606
|
+
} | undefined;
|
|
607
|
+
readonly notices?: readonly {
|
|
608
|
+
readonly type: "other" | "moderated" | "filtered";
|
|
609
|
+
readonly message: string;
|
|
610
|
+
readonly providerMetadata?: {
|
|
611
|
+
readonly [x: string]: {
|
|
612
|
+
readonly [x: string]: unknown;
|
|
613
|
+
};
|
|
614
|
+
} | undefined;
|
|
615
|
+
}[] | undefined;
|
|
616
|
+
readonly language?: string | undefined;
|
|
617
|
+
readonly segments?: readonly {
|
|
618
|
+
readonly text: string;
|
|
619
|
+
readonly startSeconds: number;
|
|
620
|
+
readonly endSeconds: number;
|
|
621
|
+
readonly speaker?: string | undefined;
|
|
622
|
+
}[] | undefined;
|
|
623
|
+
readonly words?: readonly {
|
|
624
|
+
readonly text: string;
|
|
625
|
+
readonly startSeconds: number;
|
|
626
|
+
readonly endSeconds: number;
|
|
627
|
+
readonly speaker?: string | undefined;
|
|
628
|
+
readonly confidence?: number | undefined;
|
|
629
|
+
}[] | undefined;
|
|
630
|
+
};
|
|
631
|
+
};
|
|
632
|
+
readonly match: {
|
|
633
|
+
<Cases extends {
|
|
634
|
+
"generation-queued": (value: {
|
|
635
|
+
readonly id: string;
|
|
636
|
+
readonly type: "generation-queued";
|
|
637
|
+
readonly position?: number | undefined;
|
|
638
|
+
}) => any;
|
|
639
|
+
"generation-progress": (value: {
|
|
640
|
+
readonly id: string;
|
|
641
|
+
readonly type: "generation-progress";
|
|
642
|
+
readonly progress?: number | undefined;
|
|
643
|
+
}) => any;
|
|
644
|
+
"text-delta": (value: {
|
|
645
|
+
readonly type: "text-delta";
|
|
646
|
+
readonly delta: string;
|
|
647
|
+
}) => any;
|
|
648
|
+
segment: (value: {
|
|
649
|
+
readonly type: "segment";
|
|
650
|
+
readonly segment: {
|
|
651
|
+
readonly text: string;
|
|
652
|
+
readonly startSeconds: number;
|
|
653
|
+
readonly endSeconds: number;
|
|
654
|
+
readonly speaker?: string | undefined;
|
|
655
|
+
};
|
|
656
|
+
}) => any;
|
|
657
|
+
finish: (value: {
|
|
658
|
+
readonly type: "finish";
|
|
659
|
+
readonly text: string;
|
|
660
|
+
readonly durationSeconds?: number | undefined;
|
|
661
|
+
readonly providerMetadata?: {
|
|
662
|
+
readonly [x: string]: {
|
|
663
|
+
readonly [x: string]: unknown;
|
|
664
|
+
};
|
|
665
|
+
} | undefined;
|
|
666
|
+
readonly usage?: {
|
|
667
|
+
readonly type: "tokens";
|
|
668
|
+
readonly input?: number | undefined;
|
|
669
|
+
readonly output?: number | undefined;
|
|
670
|
+
readonly total?: number | undefined;
|
|
671
|
+
readonly details?: {
|
|
672
|
+
readonly [x: string]: unknown;
|
|
673
|
+
} | undefined;
|
|
674
|
+
} | {
|
|
675
|
+
readonly type: "seconds";
|
|
676
|
+
readonly seconds: number;
|
|
677
|
+
} | {
|
|
678
|
+
readonly type: "characters";
|
|
679
|
+
readonly characters: number;
|
|
680
|
+
} | {
|
|
681
|
+
readonly type: "credits";
|
|
682
|
+
readonly credits: number;
|
|
683
|
+
} | {
|
|
684
|
+
readonly type: "compute";
|
|
685
|
+
readonly seconds: number;
|
|
686
|
+
} | undefined;
|
|
687
|
+
readonly notices?: readonly {
|
|
688
|
+
readonly type: "other" | "moderated" | "filtered";
|
|
689
|
+
readonly message: string;
|
|
690
|
+
readonly providerMetadata?: {
|
|
691
|
+
readonly [x: string]: {
|
|
692
|
+
readonly [x: string]: unknown;
|
|
693
|
+
};
|
|
694
|
+
} | undefined;
|
|
695
|
+
}[] | undefined;
|
|
696
|
+
readonly language?: string | undefined;
|
|
697
|
+
readonly segments?: readonly {
|
|
698
|
+
readonly text: string;
|
|
699
|
+
readonly startSeconds: number;
|
|
700
|
+
readonly endSeconds: number;
|
|
701
|
+
readonly speaker?: string | undefined;
|
|
702
|
+
}[] | undefined;
|
|
703
|
+
readonly words?: readonly {
|
|
704
|
+
readonly text: string;
|
|
705
|
+
readonly startSeconds: number;
|
|
706
|
+
readonly endSeconds: number;
|
|
707
|
+
readonly speaker?: string | undefined;
|
|
708
|
+
readonly confidence?: number | undefined;
|
|
709
|
+
}[] | undefined;
|
|
710
|
+
}) => any;
|
|
711
|
+
}>(value: {
|
|
712
|
+
readonly id: string;
|
|
713
|
+
readonly type: "generation-queued";
|
|
714
|
+
readonly position?: number | undefined;
|
|
715
|
+
} | {
|
|
716
|
+
readonly id: string;
|
|
717
|
+
readonly type: "generation-progress";
|
|
718
|
+
readonly progress?: number | undefined;
|
|
719
|
+
} | {
|
|
720
|
+
readonly type: "text-delta";
|
|
721
|
+
readonly delta: string;
|
|
722
|
+
} | {
|
|
723
|
+
readonly type: "segment";
|
|
724
|
+
readonly segment: {
|
|
725
|
+
readonly text: string;
|
|
726
|
+
readonly startSeconds: number;
|
|
727
|
+
readonly endSeconds: number;
|
|
728
|
+
readonly speaker?: string | undefined;
|
|
729
|
+
};
|
|
730
|
+
} | {
|
|
731
|
+
readonly type: "finish";
|
|
732
|
+
readonly text: string;
|
|
733
|
+
readonly durationSeconds?: number | undefined;
|
|
734
|
+
readonly providerMetadata?: {
|
|
735
|
+
readonly [x: string]: {
|
|
736
|
+
readonly [x: string]: unknown;
|
|
737
|
+
};
|
|
738
|
+
} | undefined;
|
|
739
|
+
readonly usage?: {
|
|
740
|
+
readonly type: "tokens";
|
|
741
|
+
readonly input?: number | undefined;
|
|
742
|
+
readonly output?: number | undefined;
|
|
743
|
+
readonly total?: number | undefined;
|
|
744
|
+
readonly details?: {
|
|
745
|
+
readonly [x: string]: unknown;
|
|
746
|
+
} | undefined;
|
|
747
|
+
} | {
|
|
748
|
+
readonly type: "seconds";
|
|
749
|
+
readonly seconds: number;
|
|
750
|
+
} | {
|
|
751
|
+
readonly type: "characters";
|
|
752
|
+
readonly characters: number;
|
|
753
|
+
} | {
|
|
754
|
+
readonly type: "credits";
|
|
755
|
+
readonly credits: number;
|
|
756
|
+
} | {
|
|
757
|
+
readonly type: "compute";
|
|
758
|
+
readonly seconds: number;
|
|
759
|
+
} | undefined;
|
|
760
|
+
readonly notices?: readonly {
|
|
761
|
+
readonly type: "other" | "moderated" | "filtered";
|
|
762
|
+
readonly message: string;
|
|
763
|
+
readonly providerMetadata?: {
|
|
764
|
+
readonly [x: string]: {
|
|
765
|
+
readonly [x: string]: unknown;
|
|
766
|
+
};
|
|
767
|
+
} | undefined;
|
|
768
|
+
}[] | undefined;
|
|
769
|
+
readonly language?: string | undefined;
|
|
770
|
+
readonly segments?: readonly {
|
|
771
|
+
readonly text: string;
|
|
772
|
+
readonly startSeconds: number;
|
|
773
|
+
readonly endSeconds: number;
|
|
774
|
+
readonly speaker?: string | undefined;
|
|
775
|
+
}[] | undefined;
|
|
776
|
+
readonly words?: readonly {
|
|
777
|
+
readonly text: string;
|
|
778
|
+
readonly startSeconds: number;
|
|
779
|
+
readonly endSeconds: number;
|
|
780
|
+
readonly speaker?: string | undefined;
|
|
781
|
+
readonly confidence?: number | undefined;
|
|
782
|
+
}[] | undefined;
|
|
783
|
+
}, cases: Cases): Cases[keyof Cases] extends (value: any) => infer R ? import("effect/Unify").Unify<R> : never;
|
|
784
|
+
<Cases extends {
|
|
785
|
+
"generation-queued": (value: {
|
|
786
|
+
readonly id: string;
|
|
787
|
+
readonly type: "generation-queued";
|
|
788
|
+
readonly position?: number | undefined;
|
|
789
|
+
}) => any;
|
|
790
|
+
"generation-progress": (value: {
|
|
791
|
+
readonly id: string;
|
|
792
|
+
readonly type: "generation-progress";
|
|
793
|
+
readonly progress?: number | undefined;
|
|
794
|
+
}) => any;
|
|
795
|
+
"text-delta": (value: {
|
|
796
|
+
readonly type: "text-delta";
|
|
797
|
+
readonly delta: string;
|
|
798
|
+
}) => any;
|
|
799
|
+
segment: (value: {
|
|
800
|
+
readonly type: "segment";
|
|
801
|
+
readonly segment: {
|
|
802
|
+
readonly text: string;
|
|
803
|
+
readonly startSeconds: number;
|
|
804
|
+
readonly endSeconds: number;
|
|
805
|
+
readonly speaker?: string | undefined;
|
|
806
|
+
};
|
|
807
|
+
}) => any;
|
|
808
|
+
finish: (value: {
|
|
809
|
+
readonly type: "finish";
|
|
810
|
+
readonly text: string;
|
|
811
|
+
readonly durationSeconds?: number | undefined;
|
|
812
|
+
readonly providerMetadata?: {
|
|
813
|
+
readonly [x: string]: {
|
|
814
|
+
readonly [x: string]: unknown;
|
|
815
|
+
};
|
|
816
|
+
} | undefined;
|
|
817
|
+
readonly usage?: {
|
|
818
|
+
readonly type: "tokens";
|
|
819
|
+
readonly input?: number | undefined;
|
|
820
|
+
readonly output?: number | undefined;
|
|
821
|
+
readonly total?: number | undefined;
|
|
822
|
+
readonly details?: {
|
|
823
|
+
readonly [x: string]: unknown;
|
|
824
|
+
} | undefined;
|
|
825
|
+
} | {
|
|
826
|
+
readonly type: "seconds";
|
|
827
|
+
readonly seconds: number;
|
|
828
|
+
} | {
|
|
829
|
+
readonly type: "characters";
|
|
830
|
+
readonly characters: number;
|
|
831
|
+
} | {
|
|
832
|
+
readonly type: "credits";
|
|
833
|
+
readonly credits: number;
|
|
834
|
+
} | {
|
|
835
|
+
readonly type: "compute";
|
|
836
|
+
readonly seconds: number;
|
|
837
|
+
} | undefined;
|
|
838
|
+
readonly notices?: readonly {
|
|
839
|
+
readonly type: "other" | "moderated" | "filtered";
|
|
840
|
+
readonly message: string;
|
|
841
|
+
readonly providerMetadata?: {
|
|
842
|
+
readonly [x: string]: {
|
|
843
|
+
readonly [x: string]: unknown;
|
|
844
|
+
};
|
|
845
|
+
} | undefined;
|
|
846
|
+
}[] | undefined;
|
|
847
|
+
readonly language?: string | undefined;
|
|
848
|
+
readonly segments?: readonly {
|
|
849
|
+
readonly text: string;
|
|
850
|
+
readonly startSeconds: number;
|
|
851
|
+
readonly endSeconds: number;
|
|
852
|
+
readonly speaker?: string | undefined;
|
|
853
|
+
}[] | undefined;
|
|
854
|
+
readonly words?: readonly {
|
|
855
|
+
readonly text: string;
|
|
856
|
+
readonly startSeconds: number;
|
|
857
|
+
readonly endSeconds: number;
|
|
858
|
+
readonly speaker?: string | undefined;
|
|
859
|
+
readonly confidence?: number | undefined;
|
|
860
|
+
}[] | undefined;
|
|
861
|
+
}) => any;
|
|
862
|
+
}>(cases: Cases): (value: {
|
|
863
|
+
readonly id: string;
|
|
864
|
+
readonly type: "generation-queued";
|
|
865
|
+
readonly position?: number | undefined;
|
|
866
|
+
} | {
|
|
867
|
+
readonly id: string;
|
|
868
|
+
readonly type: "generation-progress";
|
|
869
|
+
readonly progress?: number | undefined;
|
|
870
|
+
} | {
|
|
871
|
+
readonly type: "text-delta";
|
|
872
|
+
readonly delta: string;
|
|
873
|
+
} | {
|
|
874
|
+
readonly type: "segment";
|
|
875
|
+
readonly segment: {
|
|
876
|
+
readonly text: string;
|
|
877
|
+
readonly startSeconds: number;
|
|
878
|
+
readonly endSeconds: number;
|
|
879
|
+
readonly speaker?: string | undefined;
|
|
880
|
+
};
|
|
881
|
+
} | {
|
|
882
|
+
readonly type: "finish";
|
|
883
|
+
readonly text: string;
|
|
884
|
+
readonly durationSeconds?: number | undefined;
|
|
885
|
+
readonly providerMetadata?: {
|
|
886
|
+
readonly [x: string]: {
|
|
887
|
+
readonly [x: string]: unknown;
|
|
888
|
+
};
|
|
889
|
+
} | undefined;
|
|
890
|
+
readonly usage?: {
|
|
891
|
+
readonly type: "tokens";
|
|
892
|
+
readonly input?: number | undefined;
|
|
893
|
+
readonly output?: number | undefined;
|
|
894
|
+
readonly total?: number | undefined;
|
|
895
|
+
readonly details?: {
|
|
896
|
+
readonly [x: string]: unknown;
|
|
897
|
+
} | undefined;
|
|
898
|
+
} | {
|
|
899
|
+
readonly type: "seconds";
|
|
900
|
+
readonly seconds: number;
|
|
901
|
+
} | {
|
|
902
|
+
readonly type: "characters";
|
|
903
|
+
readonly characters: number;
|
|
904
|
+
} | {
|
|
905
|
+
readonly type: "credits";
|
|
906
|
+
readonly credits: number;
|
|
907
|
+
} | {
|
|
908
|
+
readonly type: "compute";
|
|
909
|
+
readonly seconds: number;
|
|
910
|
+
} | undefined;
|
|
911
|
+
readonly notices?: readonly {
|
|
912
|
+
readonly type: "other" | "moderated" | "filtered";
|
|
913
|
+
readonly message: string;
|
|
914
|
+
readonly providerMetadata?: {
|
|
915
|
+
readonly [x: string]: {
|
|
916
|
+
readonly [x: string]: unknown;
|
|
917
|
+
};
|
|
918
|
+
} | undefined;
|
|
919
|
+
}[] | undefined;
|
|
920
|
+
readonly language?: string | undefined;
|
|
921
|
+
readonly segments?: readonly {
|
|
922
|
+
readonly text: string;
|
|
923
|
+
readonly startSeconds: number;
|
|
924
|
+
readonly endSeconds: number;
|
|
925
|
+
readonly speaker?: string | undefined;
|
|
926
|
+
}[] | undefined;
|
|
927
|
+
readonly words?: readonly {
|
|
928
|
+
readonly text: string;
|
|
929
|
+
readonly startSeconds: number;
|
|
930
|
+
readonly endSeconds: number;
|
|
931
|
+
readonly speaker?: string | undefined;
|
|
932
|
+
readonly confidence?: number | undefined;
|
|
933
|
+
}[] | undefined;
|
|
934
|
+
}) => Cases[keyof Cases] extends (value: any) => infer R ? import("effect/Unify").Unify<R> : never;
|
|
935
|
+
};
|
|
936
|
+
readonly matchOrElse: {
|
|
937
|
+
<Cases extends {
|
|
938
|
+
"generation-queued"?: ((value: {
|
|
939
|
+
readonly id: string;
|
|
940
|
+
readonly type: "generation-queued";
|
|
941
|
+
readonly position?: number | undefined;
|
|
942
|
+
}) => any) | undefined;
|
|
943
|
+
"generation-progress"?: ((value: {
|
|
944
|
+
readonly id: string;
|
|
945
|
+
readonly type: "generation-progress";
|
|
946
|
+
readonly progress?: number | undefined;
|
|
947
|
+
}) => any) | undefined;
|
|
948
|
+
"text-delta"?: ((value: {
|
|
949
|
+
readonly type: "text-delta";
|
|
950
|
+
readonly delta: string;
|
|
951
|
+
}) => any) | undefined;
|
|
952
|
+
segment?: ((value: {
|
|
953
|
+
readonly type: "segment";
|
|
954
|
+
readonly segment: {
|
|
955
|
+
readonly text: string;
|
|
956
|
+
readonly startSeconds: number;
|
|
957
|
+
readonly endSeconds: number;
|
|
958
|
+
readonly speaker?: string | undefined;
|
|
959
|
+
};
|
|
960
|
+
}) => any) | undefined;
|
|
961
|
+
finish?: ((value: {
|
|
962
|
+
readonly type: "finish";
|
|
963
|
+
readonly text: string;
|
|
964
|
+
readonly durationSeconds?: number | undefined;
|
|
965
|
+
readonly providerMetadata?: {
|
|
966
|
+
readonly [x: string]: {
|
|
967
|
+
readonly [x: string]: unknown;
|
|
968
|
+
};
|
|
969
|
+
} | undefined;
|
|
970
|
+
readonly usage?: {
|
|
971
|
+
readonly type: "tokens";
|
|
972
|
+
readonly input?: number | undefined;
|
|
973
|
+
readonly output?: number | undefined;
|
|
974
|
+
readonly total?: number | undefined;
|
|
975
|
+
readonly details?: {
|
|
976
|
+
readonly [x: string]: unknown;
|
|
977
|
+
} | undefined;
|
|
978
|
+
} | {
|
|
979
|
+
readonly type: "seconds";
|
|
980
|
+
readonly seconds: number;
|
|
981
|
+
} | {
|
|
982
|
+
readonly type: "characters";
|
|
983
|
+
readonly characters: number;
|
|
984
|
+
} | {
|
|
985
|
+
readonly type: "credits";
|
|
986
|
+
readonly credits: number;
|
|
987
|
+
} | {
|
|
988
|
+
readonly type: "compute";
|
|
989
|
+
readonly seconds: number;
|
|
990
|
+
} | undefined;
|
|
991
|
+
readonly notices?: readonly {
|
|
992
|
+
readonly type: "other" | "moderated" | "filtered";
|
|
993
|
+
readonly message: string;
|
|
994
|
+
readonly providerMetadata?: {
|
|
995
|
+
readonly [x: string]: {
|
|
996
|
+
readonly [x: string]: unknown;
|
|
997
|
+
};
|
|
998
|
+
} | undefined;
|
|
999
|
+
}[] | undefined;
|
|
1000
|
+
readonly language?: string | undefined;
|
|
1001
|
+
readonly segments?: readonly {
|
|
1002
|
+
readonly text: string;
|
|
1003
|
+
readonly startSeconds: number;
|
|
1004
|
+
readonly endSeconds: number;
|
|
1005
|
+
readonly speaker?: string | undefined;
|
|
1006
|
+
}[] | undefined;
|
|
1007
|
+
readonly words?: readonly {
|
|
1008
|
+
readonly text: string;
|
|
1009
|
+
readonly startSeconds: number;
|
|
1010
|
+
readonly endSeconds: number;
|
|
1011
|
+
readonly speaker?: string | undefined;
|
|
1012
|
+
readonly confidence?: number | undefined;
|
|
1013
|
+
}[] | undefined;
|
|
1014
|
+
}) => any) | undefined;
|
|
1015
|
+
} & { [K in Exclude<keyof Cases, "finish" | "text-delta" | "generation-queued" | "generation-progress" | "segment">]: never; }, OrElse extends (value: Exclude<{
|
|
1016
|
+
readonly id: string;
|
|
1017
|
+
readonly type: "generation-queued";
|
|
1018
|
+
readonly position?: number | undefined;
|
|
1019
|
+
}, {
|
|
1020
|
+
readonly type: keyof Cases;
|
|
1021
|
+
}> | Exclude<{
|
|
1022
|
+
readonly id: string;
|
|
1023
|
+
readonly type: "generation-progress";
|
|
1024
|
+
readonly progress?: number | undefined;
|
|
1025
|
+
}, {
|
|
1026
|
+
readonly type: keyof Cases;
|
|
1027
|
+
}> | Exclude<{
|
|
1028
|
+
readonly type: "text-delta";
|
|
1029
|
+
readonly delta: string;
|
|
1030
|
+
}, {
|
|
1031
|
+
readonly type: keyof Cases;
|
|
1032
|
+
}> | Exclude<{
|
|
1033
|
+
readonly type: "segment";
|
|
1034
|
+
readonly segment: {
|
|
1035
|
+
readonly text: string;
|
|
1036
|
+
readonly startSeconds: number;
|
|
1037
|
+
readonly endSeconds: number;
|
|
1038
|
+
readonly speaker?: string | undefined;
|
|
1039
|
+
};
|
|
1040
|
+
}, {
|
|
1041
|
+
readonly type: keyof Cases;
|
|
1042
|
+
}> | Exclude<{
|
|
1043
|
+
readonly type: "finish";
|
|
1044
|
+
readonly text: string;
|
|
1045
|
+
readonly durationSeconds?: number | undefined;
|
|
1046
|
+
readonly providerMetadata?: {
|
|
1047
|
+
readonly [x: string]: {
|
|
1048
|
+
readonly [x: string]: unknown;
|
|
1049
|
+
};
|
|
1050
|
+
} | undefined;
|
|
1051
|
+
readonly usage?: {
|
|
1052
|
+
readonly type: "tokens";
|
|
1053
|
+
readonly input?: number | undefined;
|
|
1054
|
+
readonly output?: number | undefined;
|
|
1055
|
+
readonly total?: number | undefined;
|
|
1056
|
+
readonly details?: {
|
|
1057
|
+
readonly [x: string]: unknown;
|
|
1058
|
+
} | undefined;
|
|
1059
|
+
} | {
|
|
1060
|
+
readonly type: "seconds";
|
|
1061
|
+
readonly seconds: number;
|
|
1062
|
+
} | {
|
|
1063
|
+
readonly type: "characters";
|
|
1064
|
+
readonly characters: number;
|
|
1065
|
+
} | {
|
|
1066
|
+
readonly type: "credits";
|
|
1067
|
+
readonly credits: number;
|
|
1068
|
+
} | {
|
|
1069
|
+
readonly type: "compute";
|
|
1070
|
+
readonly seconds: number;
|
|
1071
|
+
} | undefined;
|
|
1072
|
+
readonly notices?: readonly {
|
|
1073
|
+
readonly type: "other" | "moderated" | "filtered";
|
|
1074
|
+
readonly message: string;
|
|
1075
|
+
readonly providerMetadata?: {
|
|
1076
|
+
readonly [x: string]: {
|
|
1077
|
+
readonly [x: string]: unknown;
|
|
1078
|
+
};
|
|
1079
|
+
} | undefined;
|
|
1080
|
+
}[] | undefined;
|
|
1081
|
+
readonly language?: string | undefined;
|
|
1082
|
+
readonly segments?: readonly {
|
|
1083
|
+
readonly text: string;
|
|
1084
|
+
readonly startSeconds: number;
|
|
1085
|
+
readonly endSeconds: number;
|
|
1086
|
+
readonly speaker?: string | undefined;
|
|
1087
|
+
}[] | undefined;
|
|
1088
|
+
readonly words?: readonly {
|
|
1089
|
+
readonly text: string;
|
|
1090
|
+
readonly startSeconds: number;
|
|
1091
|
+
readonly endSeconds: number;
|
|
1092
|
+
readonly speaker?: string | undefined;
|
|
1093
|
+
readonly confidence?: number | undefined;
|
|
1094
|
+
}[] | undefined;
|
|
1095
|
+
}, {
|
|
1096
|
+
readonly type: keyof Cases;
|
|
1097
|
+
}>) => any>(value: {
|
|
1098
|
+
readonly id: string;
|
|
1099
|
+
readonly type: "generation-queued";
|
|
1100
|
+
readonly position?: number | undefined;
|
|
1101
|
+
} | {
|
|
1102
|
+
readonly id: string;
|
|
1103
|
+
readonly type: "generation-progress";
|
|
1104
|
+
readonly progress?: number | undefined;
|
|
1105
|
+
} | {
|
|
1106
|
+
readonly type: "text-delta";
|
|
1107
|
+
readonly delta: string;
|
|
1108
|
+
} | {
|
|
1109
|
+
readonly type: "segment";
|
|
1110
|
+
readonly segment: {
|
|
1111
|
+
readonly text: string;
|
|
1112
|
+
readonly startSeconds: number;
|
|
1113
|
+
readonly endSeconds: number;
|
|
1114
|
+
readonly speaker?: string | undefined;
|
|
1115
|
+
};
|
|
1116
|
+
} | {
|
|
1117
|
+
readonly type: "finish";
|
|
1118
|
+
readonly text: string;
|
|
1119
|
+
readonly durationSeconds?: number | undefined;
|
|
1120
|
+
readonly providerMetadata?: {
|
|
1121
|
+
readonly [x: string]: {
|
|
1122
|
+
readonly [x: string]: unknown;
|
|
1123
|
+
};
|
|
1124
|
+
} | undefined;
|
|
1125
|
+
readonly usage?: {
|
|
1126
|
+
readonly type: "tokens";
|
|
1127
|
+
readonly input?: number | undefined;
|
|
1128
|
+
readonly output?: number | undefined;
|
|
1129
|
+
readonly total?: number | undefined;
|
|
1130
|
+
readonly details?: {
|
|
1131
|
+
readonly [x: string]: unknown;
|
|
1132
|
+
} | undefined;
|
|
1133
|
+
} | {
|
|
1134
|
+
readonly type: "seconds";
|
|
1135
|
+
readonly seconds: number;
|
|
1136
|
+
} | {
|
|
1137
|
+
readonly type: "characters";
|
|
1138
|
+
readonly characters: number;
|
|
1139
|
+
} | {
|
|
1140
|
+
readonly type: "credits";
|
|
1141
|
+
readonly credits: number;
|
|
1142
|
+
} | {
|
|
1143
|
+
readonly type: "compute";
|
|
1144
|
+
readonly seconds: number;
|
|
1145
|
+
} | undefined;
|
|
1146
|
+
readonly notices?: readonly {
|
|
1147
|
+
readonly type: "other" | "moderated" | "filtered";
|
|
1148
|
+
readonly message: string;
|
|
1149
|
+
readonly providerMetadata?: {
|
|
1150
|
+
readonly [x: string]: {
|
|
1151
|
+
readonly [x: string]: unknown;
|
|
1152
|
+
};
|
|
1153
|
+
} | undefined;
|
|
1154
|
+
}[] | undefined;
|
|
1155
|
+
readonly language?: string | undefined;
|
|
1156
|
+
readonly segments?: readonly {
|
|
1157
|
+
readonly text: string;
|
|
1158
|
+
readonly startSeconds: number;
|
|
1159
|
+
readonly endSeconds: number;
|
|
1160
|
+
readonly speaker?: string | undefined;
|
|
1161
|
+
}[] | undefined;
|
|
1162
|
+
readonly words?: readonly {
|
|
1163
|
+
readonly text: string;
|
|
1164
|
+
readonly startSeconds: number;
|
|
1165
|
+
readonly endSeconds: number;
|
|
1166
|
+
readonly speaker?: string | undefined;
|
|
1167
|
+
readonly confidence?: number | undefined;
|
|
1168
|
+
}[] | undefined;
|
|
1169
|
+
}, cases: Cases, orElse: OrElse): import("effect/Unify").Unify<{ [K_1 in keyof Cases]-?: NonNullable<Cases[K_1]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Cases] | ReturnType<OrElse>>;
|
|
1170
|
+
<Cases extends {
|
|
1171
|
+
"generation-queued"?: ((value: {
|
|
1172
|
+
readonly id: string;
|
|
1173
|
+
readonly type: "generation-queued";
|
|
1174
|
+
readonly position?: number | undefined;
|
|
1175
|
+
}) => any) | undefined;
|
|
1176
|
+
"generation-progress"?: ((value: {
|
|
1177
|
+
readonly id: string;
|
|
1178
|
+
readonly type: "generation-progress";
|
|
1179
|
+
readonly progress?: number | undefined;
|
|
1180
|
+
}) => any) | undefined;
|
|
1181
|
+
"text-delta"?: ((value: {
|
|
1182
|
+
readonly type: "text-delta";
|
|
1183
|
+
readonly delta: string;
|
|
1184
|
+
}) => any) | undefined;
|
|
1185
|
+
segment?: ((value: {
|
|
1186
|
+
readonly type: "segment";
|
|
1187
|
+
readonly segment: {
|
|
1188
|
+
readonly text: string;
|
|
1189
|
+
readonly startSeconds: number;
|
|
1190
|
+
readonly endSeconds: number;
|
|
1191
|
+
readonly speaker?: string | undefined;
|
|
1192
|
+
};
|
|
1193
|
+
}) => any) | undefined;
|
|
1194
|
+
finish?: ((value: {
|
|
1195
|
+
readonly type: "finish";
|
|
1196
|
+
readonly text: string;
|
|
1197
|
+
readonly durationSeconds?: number | undefined;
|
|
1198
|
+
readonly providerMetadata?: {
|
|
1199
|
+
readonly [x: string]: {
|
|
1200
|
+
readonly [x: string]: unknown;
|
|
1201
|
+
};
|
|
1202
|
+
} | undefined;
|
|
1203
|
+
readonly usage?: {
|
|
1204
|
+
readonly type: "tokens";
|
|
1205
|
+
readonly input?: number | undefined;
|
|
1206
|
+
readonly output?: number | undefined;
|
|
1207
|
+
readonly total?: number | undefined;
|
|
1208
|
+
readonly details?: {
|
|
1209
|
+
readonly [x: string]: unknown;
|
|
1210
|
+
} | undefined;
|
|
1211
|
+
} | {
|
|
1212
|
+
readonly type: "seconds";
|
|
1213
|
+
readonly seconds: number;
|
|
1214
|
+
} | {
|
|
1215
|
+
readonly type: "characters";
|
|
1216
|
+
readonly characters: number;
|
|
1217
|
+
} | {
|
|
1218
|
+
readonly type: "credits";
|
|
1219
|
+
readonly credits: number;
|
|
1220
|
+
} | {
|
|
1221
|
+
readonly type: "compute";
|
|
1222
|
+
readonly seconds: number;
|
|
1223
|
+
} | undefined;
|
|
1224
|
+
readonly notices?: readonly {
|
|
1225
|
+
readonly type: "other" | "moderated" | "filtered";
|
|
1226
|
+
readonly message: string;
|
|
1227
|
+
readonly providerMetadata?: {
|
|
1228
|
+
readonly [x: string]: {
|
|
1229
|
+
readonly [x: string]: unknown;
|
|
1230
|
+
};
|
|
1231
|
+
} | undefined;
|
|
1232
|
+
}[] | undefined;
|
|
1233
|
+
readonly language?: string | undefined;
|
|
1234
|
+
readonly segments?: readonly {
|
|
1235
|
+
readonly text: string;
|
|
1236
|
+
readonly startSeconds: number;
|
|
1237
|
+
readonly endSeconds: number;
|
|
1238
|
+
readonly speaker?: string | undefined;
|
|
1239
|
+
}[] | undefined;
|
|
1240
|
+
readonly words?: readonly {
|
|
1241
|
+
readonly text: string;
|
|
1242
|
+
readonly startSeconds: number;
|
|
1243
|
+
readonly endSeconds: number;
|
|
1244
|
+
readonly speaker?: string | undefined;
|
|
1245
|
+
readonly confidence?: number | undefined;
|
|
1246
|
+
}[] | undefined;
|
|
1247
|
+
}) => any) | undefined;
|
|
1248
|
+
} & { [K in Exclude<keyof Cases, "finish" | "text-delta" | "generation-queued" | "generation-progress" | "segment">]: never; }, OrElse extends (value: Exclude<{
|
|
1249
|
+
readonly id: string;
|
|
1250
|
+
readonly type: "generation-queued";
|
|
1251
|
+
readonly position?: number | undefined;
|
|
1252
|
+
}, {
|
|
1253
|
+
readonly type: keyof Cases;
|
|
1254
|
+
}> | Exclude<{
|
|
1255
|
+
readonly id: string;
|
|
1256
|
+
readonly type: "generation-progress";
|
|
1257
|
+
readonly progress?: number | undefined;
|
|
1258
|
+
}, {
|
|
1259
|
+
readonly type: keyof Cases;
|
|
1260
|
+
}> | Exclude<{
|
|
1261
|
+
readonly type: "text-delta";
|
|
1262
|
+
readonly delta: string;
|
|
1263
|
+
}, {
|
|
1264
|
+
readonly type: keyof Cases;
|
|
1265
|
+
}> | Exclude<{
|
|
1266
|
+
readonly type: "segment";
|
|
1267
|
+
readonly segment: {
|
|
1268
|
+
readonly text: string;
|
|
1269
|
+
readonly startSeconds: number;
|
|
1270
|
+
readonly endSeconds: number;
|
|
1271
|
+
readonly speaker?: string | undefined;
|
|
1272
|
+
};
|
|
1273
|
+
}, {
|
|
1274
|
+
readonly type: keyof Cases;
|
|
1275
|
+
}> | Exclude<{
|
|
1276
|
+
readonly type: "finish";
|
|
1277
|
+
readonly text: string;
|
|
1278
|
+
readonly durationSeconds?: number | undefined;
|
|
1279
|
+
readonly providerMetadata?: {
|
|
1280
|
+
readonly [x: string]: {
|
|
1281
|
+
readonly [x: string]: unknown;
|
|
1282
|
+
};
|
|
1283
|
+
} | undefined;
|
|
1284
|
+
readonly usage?: {
|
|
1285
|
+
readonly type: "tokens";
|
|
1286
|
+
readonly input?: number | undefined;
|
|
1287
|
+
readonly output?: number | undefined;
|
|
1288
|
+
readonly total?: number | undefined;
|
|
1289
|
+
readonly details?: {
|
|
1290
|
+
readonly [x: string]: unknown;
|
|
1291
|
+
} | undefined;
|
|
1292
|
+
} | {
|
|
1293
|
+
readonly type: "seconds";
|
|
1294
|
+
readonly seconds: number;
|
|
1295
|
+
} | {
|
|
1296
|
+
readonly type: "characters";
|
|
1297
|
+
readonly characters: number;
|
|
1298
|
+
} | {
|
|
1299
|
+
readonly type: "credits";
|
|
1300
|
+
readonly credits: number;
|
|
1301
|
+
} | {
|
|
1302
|
+
readonly type: "compute";
|
|
1303
|
+
readonly seconds: number;
|
|
1304
|
+
} | undefined;
|
|
1305
|
+
readonly notices?: readonly {
|
|
1306
|
+
readonly type: "other" | "moderated" | "filtered";
|
|
1307
|
+
readonly message: string;
|
|
1308
|
+
readonly providerMetadata?: {
|
|
1309
|
+
readonly [x: string]: {
|
|
1310
|
+
readonly [x: string]: unknown;
|
|
1311
|
+
};
|
|
1312
|
+
} | undefined;
|
|
1313
|
+
}[] | undefined;
|
|
1314
|
+
readonly language?: string | undefined;
|
|
1315
|
+
readonly segments?: readonly {
|
|
1316
|
+
readonly text: string;
|
|
1317
|
+
readonly startSeconds: number;
|
|
1318
|
+
readonly endSeconds: number;
|
|
1319
|
+
readonly speaker?: string | undefined;
|
|
1320
|
+
}[] | undefined;
|
|
1321
|
+
readonly words?: readonly {
|
|
1322
|
+
readonly text: string;
|
|
1323
|
+
readonly startSeconds: number;
|
|
1324
|
+
readonly endSeconds: number;
|
|
1325
|
+
readonly speaker?: string | undefined;
|
|
1326
|
+
readonly confidence?: number | undefined;
|
|
1327
|
+
}[] | undefined;
|
|
1328
|
+
}, {
|
|
1329
|
+
readonly type: keyof Cases;
|
|
1330
|
+
}>) => any>(cases: Cases, orElse: OrElse): (value: {
|
|
1331
|
+
readonly id: string;
|
|
1332
|
+
readonly type: "generation-queued";
|
|
1333
|
+
readonly position?: number | undefined;
|
|
1334
|
+
} | {
|
|
1335
|
+
readonly id: string;
|
|
1336
|
+
readonly type: "generation-progress";
|
|
1337
|
+
readonly progress?: number | undefined;
|
|
1338
|
+
} | {
|
|
1339
|
+
readonly type: "text-delta";
|
|
1340
|
+
readonly delta: string;
|
|
1341
|
+
} | {
|
|
1342
|
+
readonly type: "segment";
|
|
1343
|
+
readonly segment: {
|
|
1344
|
+
readonly text: string;
|
|
1345
|
+
readonly startSeconds: number;
|
|
1346
|
+
readonly endSeconds: number;
|
|
1347
|
+
readonly speaker?: string | undefined;
|
|
1348
|
+
};
|
|
1349
|
+
} | {
|
|
1350
|
+
readonly type: "finish";
|
|
1351
|
+
readonly text: string;
|
|
1352
|
+
readonly durationSeconds?: number | undefined;
|
|
1353
|
+
readonly providerMetadata?: {
|
|
1354
|
+
readonly [x: string]: {
|
|
1355
|
+
readonly [x: string]: unknown;
|
|
1356
|
+
};
|
|
1357
|
+
} | undefined;
|
|
1358
|
+
readonly usage?: {
|
|
1359
|
+
readonly type: "tokens";
|
|
1360
|
+
readonly input?: number | undefined;
|
|
1361
|
+
readonly output?: number | undefined;
|
|
1362
|
+
readonly total?: number | undefined;
|
|
1363
|
+
readonly details?: {
|
|
1364
|
+
readonly [x: string]: unknown;
|
|
1365
|
+
} | undefined;
|
|
1366
|
+
} | {
|
|
1367
|
+
readonly type: "seconds";
|
|
1368
|
+
readonly seconds: number;
|
|
1369
|
+
} | {
|
|
1370
|
+
readonly type: "characters";
|
|
1371
|
+
readonly characters: number;
|
|
1372
|
+
} | {
|
|
1373
|
+
readonly type: "credits";
|
|
1374
|
+
readonly credits: number;
|
|
1375
|
+
} | {
|
|
1376
|
+
readonly type: "compute";
|
|
1377
|
+
readonly seconds: number;
|
|
1378
|
+
} | undefined;
|
|
1379
|
+
readonly notices?: readonly {
|
|
1380
|
+
readonly type: "other" | "moderated" | "filtered";
|
|
1381
|
+
readonly message: string;
|
|
1382
|
+
readonly providerMetadata?: {
|
|
1383
|
+
readonly [x: string]: {
|
|
1384
|
+
readonly [x: string]: unknown;
|
|
1385
|
+
};
|
|
1386
|
+
} | undefined;
|
|
1387
|
+
}[] | undefined;
|
|
1388
|
+
readonly language?: string | undefined;
|
|
1389
|
+
readonly segments?: readonly {
|
|
1390
|
+
readonly text: string;
|
|
1391
|
+
readonly startSeconds: number;
|
|
1392
|
+
readonly endSeconds: number;
|
|
1393
|
+
readonly speaker?: string | undefined;
|
|
1394
|
+
}[] | undefined;
|
|
1395
|
+
readonly words?: readonly {
|
|
1396
|
+
readonly text: string;
|
|
1397
|
+
readonly startSeconds: number;
|
|
1398
|
+
readonly endSeconds: number;
|
|
1399
|
+
readonly speaker?: string | undefined;
|
|
1400
|
+
readonly confidence?: number | undefined;
|
|
1401
|
+
}[] | undefined;
|
|
1402
|
+
}) => import("effect/Unify").Unify<{ [K_1 in keyof Cases]-?: NonNullable<Cases[K_1]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Cases] | ReturnType<OrElse>>;
|
|
1403
|
+
};
|
|
1404
|
+
} & {
|
|
1405
|
+
is: {
|
|
1406
|
+
generationQueued: (u: unknown) => u is {
|
|
1407
|
+
readonly id: string;
|
|
1408
|
+
readonly type: "generation-queued";
|
|
1409
|
+
readonly position?: number | undefined;
|
|
1410
|
+
};
|
|
1411
|
+
generationProgress: (u: unknown) => u is {
|
|
1412
|
+
readonly id: string;
|
|
1413
|
+
readonly type: "generation-progress";
|
|
1414
|
+
readonly progress?: number | undefined;
|
|
1415
|
+
};
|
|
1416
|
+
textDelta: (u: unknown) => u is {
|
|
1417
|
+
readonly type: "text-delta";
|
|
1418
|
+
readonly delta: string;
|
|
1419
|
+
};
|
|
1420
|
+
segment: (u: unknown) => u is {
|
|
1421
|
+
readonly type: "segment";
|
|
1422
|
+
readonly segment: {
|
|
1423
|
+
readonly text: string;
|
|
1424
|
+
readonly startSeconds: number;
|
|
1425
|
+
readonly endSeconds: number;
|
|
1426
|
+
readonly speaker?: string | undefined;
|
|
1427
|
+
};
|
|
1428
|
+
};
|
|
1429
|
+
finish: (u: unknown) => u is {
|
|
1430
|
+
readonly type: "finish";
|
|
1431
|
+
readonly text: string;
|
|
1432
|
+
readonly durationSeconds?: number | undefined;
|
|
1433
|
+
readonly providerMetadata?: {
|
|
1434
|
+
readonly [x: string]: {
|
|
1435
|
+
readonly [x: string]: unknown;
|
|
1436
|
+
};
|
|
1437
|
+
} | undefined;
|
|
1438
|
+
readonly usage?: {
|
|
1439
|
+
readonly type: "tokens";
|
|
1440
|
+
readonly input?: number | undefined;
|
|
1441
|
+
readonly output?: number | undefined;
|
|
1442
|
+
readonly total?: number | undefined;
|
|
1443
|
+
readonly details?: {
|
|
1444
|
+
readonly [x: string]: unknown;
|
|
1445
|
+
} | undefined;
|
|
1446
|
+
} | {
|
|
1447
|
+
readonly type: "seconds";
|
|
1448
|
+
readonly seconds: number;
|
|
1449
|
+
} | {
|
|
1450
|
+
readonly type: "characters";
|
|
1451
|
+
readonly characters: number;
|
|
1452
|
+
} | {
|
|
1453
|
+
readonly type: "credits";
|
|
1454
|
+
readonly credits: number;
|
|
1455
|
+
} | {
|
|
1456
|
+
readonly type: "compute";
|
|
1457
|
+
readonly seconds: number;
|
|
1458
|
+
} | undefined;
|
|
1459
|
+
readonly notices?: readonly {
|
|
1460
|
+
readonly type: "other" | "moderated" | "filtered";
|
|
1461
|
+
readonly message: string;
|
|
1462
|
+
readonly providerMetadata?: {
|
|
1463
|
+
readonly [x: string]: {
|
|
1464
|
+
readonly [x: string]: unknown;
|
|
1465
|
+
};
|
|
1466
|
+
} | undefined;
|
|
1467
|
+
}[] | undefined;
|
|
1468
|
+
readonly language?: string | undefined;
|
|
1469
|
+
readonly segments?: readonly {
|
|
1470
|
+
readonly text: string;
|
|
1471
|
+
readonly startSeconds: number;
|
|
1472
|
+
readonly endSeconds: number;
|
|
1473
|
+
readonly speaker?: string | undefined;
|
|
1474
|
+
}[] | undefined;
|
|
1475
|
+
readonly words?: readonly {
|
|
1476
|
+
readonly text: string;
|
|
1477
|
+
readonly startSeconds: number;
|
|
1478
|
+
readonly endSeconds: number;
|
|
1479
|
+
readonly speaker?: string | undefined;
|
|
1480
|
+
readonly confidence?: number | undefined;
|
|
1481
|
+
}[] | undefined;
|
|
1482
|
+
};
|
|
1483
|
+
};
|
|
1484
|
+
};
|
|
1485
|
+
export type TranscriptionEvent = Schema.Schema.Type<typeof transcriptionEventTagged>;
|
|
1486
|
+
export declare const responseEvents: (response: TranscriptionResponse) => ReadonlyArray<TranscriptionEvent>;
|
|
1487
|
+
export declare function request<const Model extends TranscriptionModel>(input: TranscriptionRequestInput<Model>): TranscriptionRequestFor<TranscriptionModelOptions<Model>>;
|
|
1488
|
+
export declare function request(input: TranscriptionRequest): TranscriptionRequest;
|
|
1489
|
+
export declare function generate<const Model extends TranscriptionModel>(input: TranscriptionRequestInput<Model>, options?: AwaitOptions): Effect.Effect<TranscriptionResponse, AIError, Service>;
|
|
1490
|
+
export declare function generate(input: TranscriptionRequest, options?: AwaitOptions): Effect.Effect<TranscriptionResponse, AIError, Service>;
|
|
1491
|
+
export declare function stream<const Model extends TranscriptionModel>(input: TranscriptionRequestInput<Model>, options?: AwaitOptions): Stream.Stream<TranscriptionEvent, AIError, Service>;
|
|
1492
|
+
export declare function stream(input: TranscriptionRequest, options?: AwaitOptions): Stream.Stream<TranscriptionEvent, AIError, Service>;
|
|
1493
|
+
/** Inline and streaming routes fail with `UnsupportedOperation`. */
|
|
1494
|
+
export declare function start<const Model extends TranscriptionModel>(input: TranscriptionRequestInput<Model>): Effect.Effect<Generation<TranscriptionResponse>, AIError, Service>;
|
|
1495
|
+
export declare function start(input: TranscriptionRequest): Effect.Effect<Generation<TranscriptionResponse>, AIError, Service>;
|
|
1496
|
+
export declare const resume: <Options extends TranscriptionOptions>(model: TranscriptionModel<Options>, token: unknown) => Effect.Effect<Generation<TranscriptionResponse>, AIError, Service>;
|
|
1497
|
+
export declare const Transcription: {
|
|
1498
|
+
readonly request: typeof request;
|
|
1499
|
+
readonly generate: typeof generate;
|
|
1500
|
+
readonly stream: typeof stream;
|
|
1501
|
+
readonly start: typeof start;
|
|
1502
|
+
readonly resume: <Options extends TranscriptionOptions>(model: TranscriptionModel<Options>, token: unknown) => Effect.Effect<Generation<TranscriptionResponse>, AIError, Service>;
|
|
1503
|
+
};
|
|
1504
|
+
export {};
|