@opencode/ai 2.2.5 → 2.2.6
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 +133 -69
- package/dist/cache-policy.d.ts +1 -1
- package/dist/cache-policy.js +16 -4
- package/dist/decision-client.d.ts +3 -3
- package/dist/decision.d.ts +20 -125
- package/dist/decision.js +25 -15
- package/dist/effect.d.ts +4 -15
- package/dist/effect.js +2 -6
- package/dist/effort-updates.d.ts +3 -3
- package/dist/effort-updates.js +2 -2
- package/dist/experimental/cloudflare-run-extraction.d.ts +7 -3
- package/dist/experimental/cloudflare-run-extraction.js +4 -1
- package/dist/experimental/extraction.d.ts +10 -40
- package/dist/experimental/extraction.js +14 -13
- package/dist/experimental.d.ts +8 -8
- package/dist/experimental.js +4 -4
- package/dist/generation.d.ts +0 -2
- package/dist/generation.js +2 -2
- package/dist/image-client.d.ts +13 -7
- package/dist/image-client.js +1 -1
- package/dist/image.d.ts +357 -464
- package/dist/image.js +17 -15
- package/dist/index.d.ts +28 -465
- package/dist/index.js +18 -17
- package/dist/llm.d.ts +65 -266
- package/dist/llm.js +101 -92
- package/dist/loop.d.ts +38 -0
- package/dist/loop.js +136 -0
- package/dist/media-model.d.ts +1 -1
- package/dist/media-model.js +8 -6
- package/dist/media.d.ts +9 -0
- package/dist/media.js +37 -2
- package/dist/protocols/alibaba-chat.d.ts +5 -1
- package/dist/protocols/alibaba-chat.js +3 -3
- package/dist/protocols/alibaba-images.d.ts +2 -2
- package/dist/protocols/alibaba-messages.js +3 -3
- package/dist/protocols/alibaba-responses.js +8 -20
- package/dist/protocols/anthropic-messages.d.ts +1 -1
- package/dist/protocols/anthropic-messages.js +54 -173
- package/dist/protocols/assemblyai-transcription.d.ts +2 -2
- package/dist/protocols/bedrock-converse.js +10 -16
- package/dist/protocols/cartesia-speech.d.ts +2 -2
- package/dist/protocols/cloudflare-workers-ai-images.d.ts +2 -2
- package/dist/protocols/cohere-chat.js +9 -12
- package/dist/protocols/deepgram-speech.d.ts +2 -2
- package/dist/protocols/deepgram-transcription.d.ts +2 -2
- package/dist/protocols/elevenlabs-speech.d.ts +2 -2
- package/dist/protocols/elevenlabs-transcription.d.ts +2 -2
- package/dist/protocols/gemini.d.ts +3 -0
- package/dist/protocols/gemini.js +54 -72
- package/dist/protocols/google-images.d.ts +2 -2
- package/dist/protocols/google-interactions.d.ts +3 -4
- package/dist/protocols/google-interactions.js +44 -30
- package/dist/protocols/google-speech.d.ts +2 -2
- package/dist/protocols/google-transcription.d.ts +2 -2
- package/dist/protocols/google-video.d.ts +2 -2
- package/dist/protocols/meta-images.d.ts +2 -2
- package/dist/protocols/meta-responses.js +26 -23
- package/dist/protocols/minimax-images.d.ts +2 -2
- package/dist/protocols/mistral-chat.js +7 -10
- package/dist/protocols/open-responses-channel.js +6 -19
- package/dist/protocols/open-responses-continuation.d.ts +1 -5
- package/dist/protocols/open-responses-continuation.js +1 -3
- package/dist/protocols/open-responses.d.ts +1 -21
- package/dist/protocols/open-responses.js +10 -15
- package/dist/protocols/openai-chat.d.ts +3 -23
- package/dist/protocols/openai-chat.js +26 -47
- package/dist/protocols/openai-compatible-chat.d.ts +1 -1
- package/dist/protocols/openai-compatible-responses.d.ts +2 -2
- package/dist/protocols/openai-compatible-responses.js +1 -1
- package/dist/protocols/openai-decisions.js +1 -1
- package/dist/protocols/openai-images.d.ts +2 -2
- package/dist/protocols/openai-responses.js +10 -29
- package/dist/protocols/openai-speech.d.ts +2 -2
- package/dist/protocols/openai-transcription.d.ts +2 -2
- package/dist/protocols/runway-video.d.ts +2 -2
- package/dist/protocols/shared.d.ts +1 -4
- package/dist/protocols/shared.js +13 -11
- package/dist/protocols/system-one.d.ts +4 -4
- package/dist/protocols/utils/bedrock-cache.js +2 -5
- package/dist/protocols/utils/bedrock-media.d.ts +0 -3
- package/dist/protocols/utils/cache.d.ts +3 -0
- package/dist/protocols/utils/cache.js +15 -2
- package/dist/protocols/utils/image-sizing.d.ts +1 -1
- package/dist/protocols/utils/responses-checkpoint.js +1 -1
- package/dist/protocols/utils/responses-compaction.d.ts +1 -1
- package/dist/protocols/utils/responses-compaction.js +6 -5
- package/dist/protocols/utils/responses-hosted-tools.d.ts +97 -1
- package/dist/protocols/utils/responses-hosted-tools.js +31 -0
- package/dist/protocols/utils/tool-stream.d.ts +5 -271
- package/dist/protocols/utils/tool-stream.js +3 -13
- package/dist/protocols/venice-chat.d.ts +3 -1
- package/dist/protocols/venice-chat.js +4 -4
- package/dist/protocols/xai-images.d.ts +2 -2
- package/dist/protocols/xai-responses.js +5 -25
- package/dist/protocols/xai-video.d.ts +2 -2
- package/dist/protocols/zai-chat.d.ts +5 -1
- package/dist/protocols/zai-chat.js +1 -1
- package/dist/protocols/zai-images.d.ts +2 -2
- package/dist/protocols/zai-messages.js +3 -3
- package/dist/provider-error.d.ts +0 -1
- package/dist/provider-error.js +7 -80
- package/dist/providers/alibaba.d.ts +67 -4
- package/dist/providers/alibaba.js +6 -1
- package/dist/providers/amazon-bedrock-mantle.d.ts +6 -3
- package/dist/providers/amazon-bedrock-mantle.js +6 -3
- package/dist/providers/amazon-bedrock.d.ts +6 -7
- package/dist/providers/amazon-bedrock.js +1 -1
- package/dist/providers/anthropic-compatible.d.ts +7 -8
- package/dist/providers/anthropic-compatible.js +2 -5
- package/dist/providers/anthropic.d.ts +8 -9
- package/dist/providers/anthropic.js +2 -7
- package/dist/providers/assemblyai.d.ts +2 -2
- package/dist/providers/assemblyai.js +2 -7
- package/dist/providers/azure/messages.d.ts +2 -0
- package/dist/providers/azure/messages.js +1 -0
- package/dist/providers/azure.d.ts +322 -7
- package/dist/providers/azure.js +25 -9
- package/dist/providers/baseten.d.ts +5 -5
- package/dist/providers/baseten.js +7 -21
- package/dist/providers/cartesia.d.ts +1 -1
- package/dist/providers/cerebras.d.ts +5 -5
- package/dist/providers/cerebras.js +4 -15
- package/dist/providers/cloudflare-ai-gateway.d.ts +21 -13
- package/dist/providers/cloudflare-ai-gateway.js +28 -40
- package/dist/providers/cloudflare-shared.d.ts +9 -0
- package/dist/providers/cloudflare-shared.js +25 -0
- package/dist/providers/cloudflare-workers-ai.d.ts +4 -4
- package/dist/providers/cloudflare-workers-ai.js +4 -20
- package/dist/providers/cohere/chat.js +2 -7
- package/dist/providers/cohere.d.ts +6 -5
- package/dist/providers/cohere.js +7 -13
- package/dist/providers/deepgram.d.ts +2 -2
- package/dist/providers/deepgram.js +2 -7
- package/dist/providers/deepinfra.d.ts +5 -5
- package/dist/providers/deepinfra.js +5 -13
- package/dist/providers/deepseek.d.ts +5 -5
- package/dist/providers/deepseek.js +3 -14
- package/dist/providers/digitalocean.d.ts +8 -5
- package/dist/providers/digitalocean.js +13 -14
- package/dist/providers/elevenlabs.d.ts +2 -2
- package/dist/providers/elevenlabs.js +2 -7
- package/dist/providers/fireworks.d.ts +5 -5
- package/dist/providers/fireworks.js +4 -15
- package/dist/providers/google/interactions.d.ts +1 -1
- package/dist/providers/google/interactions.js +2 -7
- package/dist/providers/google-vertex-chat.d.ts +3 -3
- package/dist/providers/google-vertex-chat.js +3 -29
- package/dist/providers/google-vertex-interactions.d.ts +3 -3
- package/dist/providers/google-vertex-messages.d.ts +3 -3
- package/dist/providers/google-vertex-messages.js +3 -29
- package/dist/providers/google-vertex-mistral.d.ts +3 -3
- package/dist/providers/google-vertex-mistral.js +3 -29
- package/dist/providers/google-vertex-responses.d.ts +3 -3
- package/dist/providers/google-vertex-responses.js +4 -30
- package/dist/providers/google-vertex-shared.d.ts +31 -0
- package/dist/providers/google-vertex-shared.js +25 -0
- package/dist/providers/google-vertex.d.ts +3 -3
- package/dist/providers/google.d.ts +15 -13
- package/dist/providers/google.js +9 -19
- package/dist/providers/groq.d.ts +5 -5
- package/dist/providers/groq.js +4 -15
- package/dist/providers/meta.d.ts +5 -5
- package/dist/providers/meta.js +10 -23
- package/dist/providers/minimax/chat.js +2 -7
- package/dist/providers/minimax/responses.js +2 -7
- package/dist/providers/minimax.d.ts +5 -5
- package/dist/providers/minimax.js +7 -22
- package/dist/providers/mistral.d.ts +10 -11
- package/dist/providers/mistral.js +3 -14
- package/dist/providers/moonshot/messages.js +2 -7
- package/dist/providers/moonshot/responses.js +2 -7
- package/dist/providers/moonshot.d.ts +5 -5
- package/dist/providers/moonshot.js +4 -16
- package/dist/providers/openai-compatible-responses.d.ts +6 -7
- package/dist/providers/openai-compatible-responses.js +2 -8
- package/dist/providers/openai-compatible.d.ts +6 -7
- package/dist/providers/openai-compatible.js +4 -10
- package/dist/providers/openai.d.ts +4 -4
- package/dist/providers/openai.js +3 -3
- package/dist/providers/opencode.d.ts +4 -4
- package/dist/providers/opencode.js +6 -2
- package/dist/providers/openrouter.d.ts +8 -5
- package/dist/providers/openrouter.js +16 -24
- package/dist/providers/runway.d.ts +1 -1
- package/dist/providers/settings.d.ts +40 -0
- package/dist/providers/settings.js +19 -0
- package/dist/providers/togetherai.d.ts +5 -5
- package/dist/providers/togetherai.js +5 -15
- package/dist/providers/typesafe-ai.d.ts +4 -4
- package/dist/providers/typesafe-ai.js +6 -2
- package/dist/providers/venice.d.ts +4 -4
- package/dist/providers/venice.js +6 -2
- package/dist/providers/vercel-ai-gateway.d.ts +5 -5
- package/dist/providers/vercel-ai-gateway.js +15 -28
- package/dist/providers/xai.d.ts +4 -4
- package/dist/providers/xai.js +4 -12
- package/dist/providers/zai-coding-plan/messages.js +2 -7
- package/dist/providers/zai-coding-plan/responses.js +2 -7
- package/dist/providers/zai-coding-plan.d.ts +5 -5
- package/dist/providers/zai-coding-plan.js +8 -15
- package/dist/providers/zai.d.ts +5 -5
- package/dist/providers/zai.js +10 -22
- package/dist/public.d.ts +12 -0
- package/dist/public.js +5 -0
- package/dist/route/auth-options.d.ts +9 -5
- package/dist/route/auth-options.js +10 -7
- package/dist/route/client.d.ts +50 -37
- package/dist/route/client.js +42 -53
- package/dist/route/decision.d.ts +8 -8
- package/dist/route/decision.js +3 -3
- package/dist/route/executor.d.ts +5 -0
- package/dist/route/executor.js +10 -0
- package/dist/route/index.d.ts +5 -7
- package/dist/route/index.js +1 -1
- package/dist/route/media.d.ts +7 -11
- package/dist/route/media.js +22 -26
- package/dist/route/transport/http.js +6 -5
- package/dist/route/transport/websocket.js +7 -1
- package/dist/schema/errors.d.ts +16 -17
- package/dist/schema/errors.js +63 -12
- package/dist/schema/events.d.ts +2563 -2954
- package/dist/schema/events.js +54 -109
- package/dist/schema/messages.d.ts +194 -137
- package/dist/schema/messages.js +66 -83
- package/dist/schema/options.d.ts +112 -65
- package/dist/schema/options.js +52 -101
- package/dist/speech-client.d.ts +7 -7
- package/dist/speech.d.ts +306 -316
- package/dist/speech.js +16 -14
- package/dist/testing.d.ts +31 -175
- package/dist/testing.js +60 -5
- package/dist/tool-history.d.ts +1 -1
- package/dist/tool-history.js +3 -10
- package/dist/tool-runtime.d.ts +9 -2
- package/dist/tool-runtime.js +17 -31
- package/dist/tool.d.ts +39 -43
- package/dist/tool.js +16 -26
- package/dist/transcription-client.d.ts +7 -7
- package/dist/transcription.d.ts +314 -265
- package/dist/transcription.js +16 -14
- package/dist/utils/provider-codes.d.ts +3 -0
- package/dist/utils/provider-codes.js +41 -0
- package/dist/video-client.d.ts +7 -7
- package/dist/video-client.js +1 -1
- package/dist/video.d.ts +269 -287
- package/dist/video.js +16 -14
- package/package.json +9 -9
- package/dist/experimental/testing.d.ts +0 -3
- package/dist/experimental/testing.js +0 -3
- package/dist/testing/decision.d.ts +0 -16
- package/dist/testing/decision.js +0 -20
- package/dist/testing/image.d.ts +0 -14
- package/dist/testing/image.js +0 -12
- package/dist/testing/media.d.ts +0 -18
- package/dist/testing/media.js +0 -36
- package/dist/testing/script.d.ts +0 -28
- package/dist/testing/script.js +0 -60
- package/dist/testing/speech.d.ts +0 -14
- package/dist/testing/speech.js +0 -12
- package/dist/testing/transcription.d.ts +0 -14
- package/dist/testing/transcription.js +0 -12
- package/dist/testing/video.d.ts +0 -14
- package/dist/testing/video.js +0 -12
package/dist/transcription.d.ts
CHANGED
|
@@ -3,16 +3,16 @@ import { Generation, type AwaitOptions } from "./generation.js";
|
|
|
3
3
|
import { Media } from "./media.js";
|
|
4
4
|
import { MediaModel } from "./media-model.js";
|
|
5
5
|
import { MediaRoute } from "./route/media.js";
|
|
6
|
-
import { AIError,
|
|
6
|
+
import { AIError, type BaseRequest } from "./schema/index.js";
|
|
7
7
|
import { Service } from "./transcription-client.js";
|
|
8
8
|
export type TranscriptionOptions = MediaModel.Options;
|
|
9
|
-
export type TranscriptionRoute = MediaRoute.AnyRoute<
|
|
9
|
+
export type TranscriptionRoute = MediaRoute.AnyRoute<TranscriptionRequest, TranscriptionEvent, TranscriptionResponse>;
|
|
10
10
|
export declare class TranscriptionModel<Options extends TranscriptionOptions = TranscriptionOptions> extends MediaModel<TranscriptionRoute, Options> {
|
|
11
11
|
protected readonly _TranscriptionModel: void;
|
|
12
12
|
/** The number of type arguments selects the kind: `<Options>`, `<Options, Frame, State>`, or `<Options, Token>`. */
|
|
13
|
-
static fromRoute<Options extends TranscriptionOptions>(route: MediaModel.InlineRouteInput<
|
|
14
|
-
static fromRoute<Options extends TranscriptionOptions, Frame, State>(route: MediaModel.StreamRouteInput<
|
|
15
|
-
static fromRoute<Options extends TranscriptionOptions, Token>(route: MediaModel.QueuedRouteInput<
|
|
13
|
+
static fromRoute<Options extends TranscriptionOptions>(route: MediaModel.InlineRouteInput<TranscriptionRequest<TranscriptionModel<Options>>, TranscriptionResponse>, input: MediaRoute.ModelInput): TranscriptionModel<Options>;
|
|
14
|
+
static fromRoute<Options extends TranscriptionOptions, Frame, State>(route: MediaModel.StreamRouteInput<TranscriptionRequest<TranscriptionModel<Options>>, TranscriptionEvent, Frame, State>, input: MediaRoute.ModelInput): TranscriptionModel<Options>;
|
|
15
|
+
static fromRoute<Options extends TranscriptionOptions, Token>(route: MediaModel.QueuedRouteInput<TranscriptionRequest<TranscriptionModel<Options>>, TranscriptionResponse, Token>, input: MediaRoute.ModelInput): TranscriptionModel<Options>;
|
|
16
16
|
}
|
|
17
17
|
export declare const TranscriptionModelSchema: Schema.declare<TranscriptionModel<{
|
|
18
18
|
readonly [x: string]: unknown;
|
|
@@ -21,7 +21,7 @@ export declare const TranscriptionModelSchema: Schema.declare<TranscriptionModel
|
|
|
21
21
|
}>>;
|
|
22
22
|
export declare const TranscriptionTimestamps: Schema.Literals<readonly ["none", "segment", "word"]>;
|
|
23
23
|
export type TranscriptionTimestamps = Schema.Schema.Type<typeof TranscriptionTimestamps>;
|
|
24
|
-
declare const
|
|
24
|
+
declare const TranscriptionRequestSchema: Schema.Struct<{
|
|
25
25
|
readonly model: Schema.declare<TranscriptionModel<{
|
|
26
26
|
readonly [x: string]: unknown;
|
|
27
27
|
}>, TranscriptionModel<{
|
|
@@ -65,20 +65,13 @@ declare const TranscriptionRequest_base: Schema.Class<TranscriptionRequest, Sche
|
|
|
65
65
|
readonly diarize: Schema.optional<Schema.Boolean>;
|
|
66
66
|
readonly speakers: Schema.optional<Schema.Int>;
|
|
67
67
|
readonly providerOptions: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
export
|
|
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
|
-
};
|
|
68
|
+
}>;
|
|
69
|
+
/** A normalized transcription request, the plain object `Transcription.request(...)` returns. */
|
|
70
|
+
export type TranscriptionRequest<Model extends TranscriptionModel = TranscriptionModel> = Omit<typeof TranscriptionRequestSchema.Type, "model" | "providerOptions"> & BaseRequest<Model, TranscriptionModelOptions<Model>>;
|
|
77
71
|
export type TranscriptionModelOptions<Model> = Model extends TranscriptionModel<infer Options> ? Options : never;
|
|
78
|
-
|
|
79
|
-
|
|
72
|
+
/** Input accepted by `Transcription.request` and the calls; a `TranscriptionRequest` is also a valid input. */
|
|
73
|
+
export type TranscriptionRequestInput<Model extends TranscriptionModel = TranscriptionModel> = Omit<TranscriptionRequest<Model>, "providerOptions"> & {
|
|
80
74
|
readonly providerOptions?: NoInfer<TranscriptionModelOptions<Model>>;
|
|
81
|
-
readonly http?: HttpOptions.Input;
|
|
82
75
|
};
|
|
83
76
|
/** Speaker labels are provider-native (`A`, `0`, `spk:0`, `speaker_0`, or a known speaker name). */
|
|
84
77
|
export declare const TranscriptionSegment: Schema.Struct<{
|
|
@@ -579,64 +572,70 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
579
572
|
};
|
|
580
573
|
};
|
|
581
574
|
readonly match: {
|
|
582
|
-
<
|
|
583
|
-
readonly
|
|
584
|
-
readonly id: Schema.String;
|
|
585
|
-
readonly position: Schema.optional<Schema.Number>;
|
|
586
|
-
}> | Schema.Struct<{
|
|
587
|
-
readonly type: Schema.tag<"generation-progress">;
|
|
588
|
-
readonly id: Schema.String;
|
|
589
|
-
readonly progress: Schema.optional<Schema.Number>;
|
|
590
|
-
}> | Schema.Struct<{
|
|
591
|
-
readonly type: Schema.tag<"text-delta">;
|
|
592
|
-
readonly delta: Schema.String;
|
|
593
|
-
}> | Schema.Struct<{
|
|
594
|
-
readonly type: Schema.tag<"segment">;
|
|
595
|
-
readonly segment: Schema.Struct<{
|
|
575
|
+
<Handlers extends { [K in "finish" | "generation-progress" | "generation-queued" | "segment" | "text-delta"]: (value: {
|
|
576
|
+
readonly finish: Schema.Struct<{
|
|
596
577
|
readonly text: Schema.String;
|
|
597
|
-
readonly
|
|
598
|
-
|
|
599
|
-
|
|
578
|
+
readonly segments: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
579
|
+
readonly text: Schema.String;
|
|
580
|
+
readonly startSeconds: Schema.Number;
|
|
581
|
+
readonly endSeconds: Schema.Number;
|
|
582
|
+
readonly speaker: Schema.optional<Schema.String>;
|
|
583
|
+
}>>>;
|
|
584
|
+
readonly words: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
585
|
+
readonly text: Schema.String;
|
|
586
|
+
readonly startSeconds: Schema.Number;
|
|
587
|
+
readonly endSeconds: Schema.Number;
|
|
588
|
+
readonly speaker: Schema.optional<Schema.String>;
|
|
589
|
+
readonly confidence: Schema.optional<Schema.Number>;
|
|
590
|
+
}>>>;
|
|
591
|
+
readonly language: Schema.optional<Schema.String>;
|
|
592
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
593
|
+
readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
594
|
+
readonly type: Schema.Literal<"tokens">;
|
|
595
|
+
readonly input: Schema.optional<Schema.Number>;
|
|
596
|
+
readonly output: Schema.optional<Schema.Number>;
|
|
597
|
+
readonly total: Schema.optional<Schema.Number>;
|
|
598
|
+
readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
599
|
+
}>, Schema.Struct<{
|
|
600
|
+
readonly type: Schema.Literal<"seconds">;
|
|
601
|
+
readonly seconds: Schema.Number;
|
|
602
|
+
}>, Schema.Struct<{
|
|
603
|
+
readonly type: Schema.Literal<"characters">;
|
|
604
|
+
readonly characters: Schema.Number;
|
|
605
|
+
}>, Schema.Struct<{
|
|
606
|
+
readonly type: Schema.Literal<"credits">;
|
|
607
|
+
readonly credits: Schema.Number;
|
|
608
|
+
}>, Schema.Struct<{
|
|
609
|
+
readonly type: Schema.Literal<"compute">;
|
|
610
|
+
readonly seconds: Schema.Number;
|
|
611
|
+
}>]>>;
|
|
612
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
613
|
+
readonly type: Schema.tag<"finish">;
|
|
600
614
|
}>;
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
readonly
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
readonly
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
readonly
|
|
613
|
-
readonly
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
readonly
|
|
622
|
-
readonly
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
readonly type: Schema.Literal<"seconds">;
|
|
626
|
-
readonly seconds: Schema.Number;
|
|
627
|
-
}>, Schema.Struct<{
|
|
628
|
-
readonly type: Schema.Literal<"characters">;
|
|
629
|
-
readonly characters: Schema.Number;
|
|
630
|
-
}>, Schema.Struct<{
|
|
631
|
-
readonly type: Schema.Literal<"credits">;
|
|
632
|
-
readonly credits: Schema.Number;
|
|
633
|
-
}>, Schema.Struct<{
|
|
634
|
-
readonly type: Schema.Literal<"compute">;
|
|
635
|
-
readonly seconds: Schema.Number;
|
|
636
|
-
}>]>>;
|
|
637
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
638
|
-
readonly type: Schema.tag<"finish">;
|
|
639
|
-
}> as M["Type"]["type"]]: (value: M["Type"]) => any; }>(value: {
|
|
615
|
+
readonly "generation-progress": Schema.Struct<{
|
|
616
|
+
readonly type: Schema.tag<"generation-progress">;
|
|
617
|
+
readonly id: Schema.String;
|
|
618
|
+
readonly progress: Schema.optional<Schema.Number>;
|
|
619
|
+
}>;
|
|
620
|
+
readonly "generation-queued": Schema.Struct<{
|
|
621
|
+
readonly type: Schema.tag<"generation-queued">;
|
|
622
|
+
readonly id: Schema.String;
|
|
623
|
+
readonly position: Schema.optional<Schema.Number>;
|
|
624
|
+
}>;
|
|
625
|
+
readonly segment: Schema.Struct<{
|
|
626
|
+
readonly type: Schema.tag<"segment">;
|
|
627
|
+
readonly segment: Schema.Struct<{
|
|
628
|
+
readonly text: Schema.String;
|
|
629
|
+
readonly startSeconds: Schema.Number;
|
|
630
|
+
readonly endSeconds: Schema.Number;
|
|
631
|
+
readonly speaker: Schema.optional<Schema.String>;
|
|
632
|
+
}>;
|
|
633
|
+
}>;
|
|
634
|
+
readonly "text-delta": Schema.Struct<{
|
|
635
|
+
readonly type: Schema.tag<"text-delta">;
|
|
636
|
+
readonly delta: Schema.String;
|
|
637
|
+
}>;
|
|
638
|
+
}[K]["Type"]) => any; }>(value: {
|
|
640
639
|
readonly type: "text-delta";
|
|
641
640
|
readonly delta: string;
|
|
642
641
|
} | {
|
|
@@ -699,65 +698,71 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
699
698
|
};
|
|
700
699
|
} | undefined;
|
|
701
700
|
readonly type: "finish";
|
|
702
|
-
}, cases:
|
|
703
|
-
<
|
|
704
|
-
readonly
|
|
705
|
-
readonly id: Schema.String;
|
|
706
|
-
readonly position: Schema.optional<Schema.Number>;
|
|
707
|
-
}> | Schema.Struct<{
|
|
708
|
-
readonly type: Schema.tag<"generation-progress">;
|
|
709
|
-
readonly id: Schema.String;
|
|
710
|
-
readonly progress: Schema.optional<Schema.Number>;
|
|
711
|
-
}> | Schema.Struct<{
|
|
712
|
-
readonly type: Schema.tag<"text-delta">;
|
|
713
|
-
readonly delta: Schema.String;
|
|
714
|
-
}> | Schema.Struct<{
|
|
715
|
-
readonly type: Schema.tag<"segment">;
|
|
716
|
-
readonly segment: Schema.Struct<{
|
|
701
|
+
}, cases: Handlers): import("effect/Unify").Unify<ReturnType<Handlers["finish" | "generation-progress" | "generation-queued" | "segment" | "text-delta"]>>;
|
|
702
|
+
<Handlers extends { [K in "finish" | "generation-progress" | "generation-queued" | "segment" | "text-delta"]: (value: {
|
|
703
|
+
readonly finish: Schema.Struct<{
|
|
717
704
|
readonly text: Schema.String;
|
|
718
|
-
readonly
|
|
719
|
-
|
|
720
|
-
|
|
705
|
+
readonly segments: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
706
|
+
readonly text: Schema.String;
|
|
707
|
+
readonly startSeconds: Schema.Number;
|
|
708
|
+
readonly endSeconds: Schema.Number;
|
|
709
|
+
readonly speaker: Schema.optional<Schema.String>;
|
|
710
|
+
}>>>;
|
|
711
|
+
readonly words: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
712
|
+
readonly text: Schema.String;
|
|
713
|
+
readonly startSeconds: Schema.Number;
|
|
714
|
+
readonly endSeconds: Schema.Number;
|
|
715
|
+
readonly speaker: Schema.optional<Schema.String>;
|
|
716
|
+
readonly confidence: Schema.optional<Schema.Number>;
|
|
717
|
+
}>>>;
|
|
718
|
+
readonly language: Schema.optional<Schema.String>;
|
|
719
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
720
|
+
readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
721
|
+
readonly type: Schema.Literal<"tokens">;
|
|
722
|
+
readonly input: Schema.optional<Schema.Number>;
|
|
723
|
+
readonly output: Schema.optional<Schema.Number>;
|
|
724
|
+
readonly total: Schema.optional<Schema.Number>;
|
|
725
|
+
readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
726
|
+
}>, Schema.Struct<{
|
|
727
|
+
readonly type: Schema.Literal<"seconds">;
|
|
728
|
+
readonly seconds: Schema.Number;
|
|
729
|
+
}>, Schema.Struct<{
|
|
730
|
+
readonly type: Schema.Literal<"characters">;
|
|
731
|
+
readonly characters: Schema.Number;
|
|
732
|
+
}>, Schema.Struct<{
|
|
733
|
+
readonly type: Schema.Literal<"credits">;
|
|
734
|
+
readonly credits: Schema.Number;
|
|
735
|
+
}>, Schema.Struct<{
|
|
736
|
+
readonly type: Schema.Literal<"compute">;
|
|
737
|
+
readonly seconds: Schema.Number;
|
|
738
|
+
}>]>>;
|
|
739
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
740
|
+
readonly type: Schema.tag<"finish">;
|
|
721
741
|
}>;
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
readonly
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
readonly
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
readonly
|
|
734
|
-
readonly
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
readonly
|
|
743
|
-
readonly
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
readonly type: Schema.Literal<"seconds">;
|
|
747
|
-
readonly seconds: Schema.Number;
|
|
748
|
-
}>, Schema.Struct<{
|
|
749
|
-
readonly type: Schema.Literal<"characters">;
|
|
750
|
-
readonly characters: Schema.Number;
|
|
751
|
-
}>, Schema.Struct<{
|
|
752
|
-
readonly type: Schema.Literal<"credits">;
|
|
753
|
-
readonly credits: Schema.Number;
|
|
754
|
-
}>, Schema.Struct<{
|
|
755
|
-
readonly type: Schema.Literal<"compute">;
|
|
756
|
-
readonly seconds: Schema.Number;
|
|
757
|
-
}>]>>;
|
|
758
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
759
|
-
readonly type: Schema.tag<"finish">;
|
|
760
|
-
}> as M["Type"]["type"]]: (value: M["Type"]) => any; }>(cases: Cases): (value: {
|
|
742
|
+
readonly "generation-progress": Schema.Struct<{
|
|
743
|
+
readonly type: Schema.tag<"generation-progress">;
|
|
744
|
+
readonly id: Schema.String;
|
|
745
|
+
readonly progress: Schema.optional<Schema.Number>;
|
|
746
|
+
}>;
|
|
747
|
+
readonly "generation-queued": Schema.Struct<{
|
|
748
|
+
readonly type: Schema.tag<"generation-queued">;
|
|
749
|
+
readonly id: Schema.String;
|
|
750
|
+
readonly position: Schema.optional<Schema.Number>;
|
|
751
|
+
}>;
|
|
752
|
+
readonly segment: Schema.Struct<{
|
|
753
|
+
readonly type: Schema.tag<"segment">;
|
|
754
|
+
readonly segment: Schema.Struct<{
|
|
755
|
+
readonly text: Schema.String;
|
|
756
|
+
readonly startSeconds: Schema.Number;
|
|
757
|
+
readonly endSeconds: Schema.Number;
|
|
758
|
+
readonly speaker: Schema.optional<Schema.String>;
|
|
759
|
+
}>;
|
|
760
|
+
}>;
|
|
761
|
+
readonly "text-delta": Schema.Struct<{
|
|
762
|
+
readonly type: Schema.tag<"text-delta">;
|
|
763
|
+
readonly delta: Schema.String;
|
|
764
|
+
}>;
|
|
765
|
+
}[K]["Type"]) => any; }>(cases: Handlers): (value: {
|
|
761
766
|
readonly type: "text-delta";
|
|
762
767
|
readonly delta: string;
|
|
763
768
|
} | {
|
|
@@ -820,67 +825,10 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
820
825
|
};
|
|
821
826
|
} | undefined;
|
|
822
827
|
readonly type: "finish";
|
|
823
|
-
}) =>
|
|
828
|
+
}) => import("effect/Unify").Unify<ReturnType<Handlers["finish" | "generation-progress" | "generation-queued" | "segment" | "text-delta"]>>;
|
|
824
829
|
};
|
|
825
830
|
readonly matchOrElse: {
|
|
826
|
-
<
|
|
827
|
-
readonly type: Schema.tag<"generation-queued">;
|
|
828
|
-
readonly id: Schema.String;
|
|
829
|
-
readonly position: Schema.optional<Schema.Number>;
|
|
830
|
-
}> | Schema.Struct<{
|
|
831
|
-
readonly type: Schema.tag<"generation-progress">;
|
|
832
|
-
readonly id: Schema.String;
|
|
833
|
-
readonly progress: Schema.optional<Schema.Number>;
|
|
834
|
-
}> | Schema.Struct<{
|
|
835
|
-
readonly type: Schema.tag<"text-delta">;
|
|
836
|
-
readonly delta: Schema.String;
|
|
837
|
-
}> | Schema.Struct<{
|
|
838
|
-
readonly type: Schema.tag<"segment">;
|
|
839
|
-
readonly segment: Schema.Struct<{
|
|
840
|
-
readonly text: Schema.String;
|
|
841
|
-
readonly startSeconds: Schema.Number;
|
|
842
|
-
readonly endSeconds: Schema.Number;
|
|
843
|
-
readonly speaker: Schema.optional<Schema.String>;
|
|
844
|
-
}>;
|
|
845
|
-
}> | Schema.Struct<{
|
|
846
|
-
readonly text: Schema.String;
|
|
847
|
-
readonly segments: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
848
|
-
readonly text: Schema.String;
|
|
849
|
-
readonly startSeconds: Schema.Number;
|
|
850
|
-
readonly endSeconds: Schema.Number;
|
|
851
|
-
readonly speaker: Schema.optional<Schema.String>;
|
|
852
|
-
}>>>;
|
|
853
|
-
readonly words: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
854
|
-
readonly text: Schema.String;
|
|
855
|
-
readonly startSeconds: Schema.Number;
|
|
856
|
-
readonly endSeconds: Schema.Number;
|
|
857
|
-
readonly speaker: Schema.optional<Schema.String>;
|
|
858
|
-
readonly confidence: Schema.optional<Schema.Number>;
|
|
859
|
-
}>>>;
|
|
860
|
-
readonly language: Schema.optional<Schema.String>;
|
|
861
|
-
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
862
|
-
readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
863
|
-
readonly type: Schema.Literal<"tokens">;
|
|
864
|
-
readonly input: Schema.optional<Schema.Number>;
|
|
865
|
-
readonly output: Schema.optional<Schema.Number>;
|
|
866
|
-
readonly total: Schema.optional<Schema.Number>;
|
|
867
|
-
readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
868
|
-
}>, Schema.Struct<{
|
|
869
|
-
readonly type: Schema.Literal<"seconds">;
|
|
870
|
-
readonly seconds: Schema.Number;
|
|
871
|
-
}>, Schema.Struct<{
|
|
872
|
-
readonly type: Schema.Literal<"characters">;
|
|
873
|
-
readonly characters: Schema.Number;
|
|
874
|
-
}>, Schema.Struct<{
|
|
875
|
-
readonly type: Schema.Literal<"credits">;
|
|
876
|
-
readonly credits: Schema.Number;
|
|
877
|
-
}>, Schema.Struct<{
|
|
878
|
-
readonly type: Schema.Literal<"compute">;
|
|
879
|
-
readonly seconds: Schema.Number;
|
|
880
|
-
}>]>>;
|
|
881
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
882
|
-
readonly type: Schema.tag<"finish">;
|
|
883
|
-
}> as M["Type"]["type"]]+?: (value: M["Type"]) => any; } & { [K in Exclude<keyof Cases, "finish" | "generation-progress" | "generation-queued" | "segment" | "text-delta">]: never; }, OrElse extends (value: Exclude<{
|
|
831
|
+
<Handlers, OrElse>(value: {
|
|
884
832
|
readonly type: "text-delta";
|
|
885
833
|
readonly delta: string;
|
|
886
834
|
} | {
|
|
@@ -943,10 +891,81 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
943
891
|
};
|
|
944
892
|
} | undefined;
|
|
945
893
|
readonly type: "finish";
|
|
946
|
-
},
|
|
894
|
+
}, cases: Handlers & {
|
|
895
|
+
readonly finish?: ((value: {
|
|
896
|
+
readonly text: string;
|
|
897
|
+
readonly segments?: readonly {
|
|
898
|
+
readonly text: string;
|
|
899
|
+
readonly startSeconds: number;
|
|
900
|
+
readonly endSeconds: number;
|
|
901
|
+
readonly speaker?: string | undefined;
|
|
902
|
+
}[] | undefined;
|
|
903
|
+
readonly words?: readonly {
|
|
904
|
+
readonly text: string;
|
|
905
|
+
readonly startSeconds: number;
|
|
906
|
+
readonly endSeconds: number;
|
|
907
|
+
readonly speaker?: string | undefined;
|
|
908
|
+
readonly confidence?: number | undefined;
|
|
909
|
+
}[] | undefined;
|
|
910
|
+
readonly language?: string | undefined;
|
|
911
|
+
readonly durationSeconds?: number | undefined;
|
|
912
|
+
readonly usage?: {
|
|
913
|
+
readonly type: "seconds";
|
|
914
|
+
readonly seconds: number;
|
|
915
|
+
} | {
|
|
916
|
+
readonly type: "characters";
|
|
917
|
+
readonly characters: number;
|
|
918
|
+
} | {
|
|
919
|
+
readonly type: "credits";
|
|
920
|
+
readonly credits: number;
|
|
921
|
+
} | {
|
|
922
|
+
readonly type: "compute";
|
|
923
|
+
readonly seconds: number;
|
|
924
|
+
} | {
|
|
925
|
+
readonly type: "tokens";
|
|
926
|
+
readonly input?: number | undefined;
|
|
927
|
+
readonly output?: number | undefined;
|
|
928
|
+
readonly total?: number | undefined;
|
|
929
|
+
readonly details?: {
|
|
930
|
+
readonly [x: string]: unknown;
|
|
931
|
+
} | undefined;
|
|
932
|
+
} | undefined;
|
|
933
|
+
readonly providerMetadata?: {
|
|
934
|
+
readonly [x: string]: {
|
|
935
|
+
readonly [x: string]: unknown;
|
|
936
|
+
};
|
|
937
|
+
} | undefined;
|
|
938
|
+
readonly type: "finish";
|
|
939
|
+
}) => any) | undefined;
|
|
940
|
+
readonly "generation-progress"?: ((value: {
|
|
941
|
+
readonly type: "generation-progress";
|
|
942
|
+
readonly id: string;
|
|
943
|
+
readonly progress?: number | undefined;
|
|
944
|
+
}) => any) | undefined;
|
|
945
|
+
readonly "generation-queued"?: ((value: {
|
|
946
|
+
readonly type: "generation-queued";
|
|
947
|
+
readonly id: string;
|
|
948
|
+
readonly position?: number | undefined;
|
|
949
|
+
}) => any) | undefined;
|
|
950
|
+
readonly segment?: ((value: {
|
|
951
|
+
readonly type: "segment";
|
|
952
|
+
readonly segment: {
|
|
953
|
+
readonly text: string;
|
|
954
|
+
readonly startSeconds: number;
|
|
955
|
+
readonly endSeconds: number;
|
|
956
|
+
readonly speaker?: string | undefined;
|
|
957
|
+
};
|
|
958
|
+
}) => any) | undefined;
|
|
959
|
+
readonly "text-delta"?: ((value: {
|
|
960
|
+
readonly type: "text-delta";
|
|
961
|
+
readonly delta: string;
|
|
962
|
+
}) => any) | undefined;
|
|
963
|
+
} & (Exclude<keyof Handlers, "finish" | "generation-progress" | "generation-queued" | "segment" | "text-delta"> extends never ? unknown : never), orElse: OrElse & ((value: Exclude<{
|
|
947
964
|
readonly type: "text-delta";
|
|
948
965
|
readonly delta: string;
|
|
949
|
-
}
|
|
966
|
+
}, {
|
|
967
|
+
readonly type: keyof Handlers;
|
|
968
|
+
}> | Exclude<{
|
|
950
969
|
readonly type: "segment";
|
|
951
970
|
readonly segment: {
|
|
952
971
|
readonly text: string;
|
|
@@ -954,15 +973,21 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
954
973
|
readonly endSeconds: number;
|
|
955
974
|
readonly speaker?: string | undefined;
|
|
956
975
|
};
|
|
957
|
-
}
|
|
976
|
+
}, {
|
|
977
|
+
readonly type: keyof Handlers;
|
|
978
|
+
}> | Exclude<{
|
|
958
979
|
readonly type: "generation-queued";
|
|
959
980
|
readonly id: string;
|
|
960
981
|
readonly position?: number | undefined;
|
|
961
|
-
}
|
|
982
|
+
}, {
|
|
983
|
+
readonly type: keyof Handlers;
|
|
984
|
+
}> | Exclude<{
|
|
962
985
|
readonly type: "generation-progress";
|
|
963
986
|
readonly id: string;
|
|
964
987
|
readonly progress?: number | undefined;
|
|
965
|
-
}
|
|
988
|
+
}, {
|
|
989
|
+
readonly type: keyof Handlers;
|
|
990
|
+
}> | Exclude<{
|
|
966
991
|
readonly text: string;
|
|
967
992
|
readonly segments?: readonly {
|
|
968
993
|
readonly text: string;
|
|
@@ -1006,68 +1031,84 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1006
1031
|
};
|
|
1007
1032
|
} | undefined;
|
|
1008
1033
|
readonly type: "finish";
|
|
1009
|
-
},
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
readonly
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
readonly
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
readonly type:
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
readonly type:
|
|
1060
|
-
readonly
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1034
|
+
}, {
|
|
1035
|
+
readonly type: keyof Handlers;
|
|
1036
|
+
}>) => any)): import("effect/Unify").Unify<{ [K in keyof Handlers]-?: NonNullable<Handlers[K]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Handlers] | (OrElse extends (...args: Array<any>) => infer R ? R : never)>;
|
|
1037
|
+
<Handlers, OrElse>(cases: Handlers & {
|
|
1038
|
+
readonly finish?: ((value: {
|
|
1039
|
+
readonly text: string;
|
|
1040
|
+
readonly segments?: readonly {
|
|
1041
|
+
readonly text: string;
|
|
1042
|
+
readonly startSeconds: number;
|
|
1043
|
+
readonly endSeconds: number;
|
|
1044
|
+
readonly speaker?: string | undefined;
|
|
1045
|
+
}[] | undefined;
|
|
1046
|
+
readonly words?: readonly {
|
|
1047
|
+
readonly text: string;
|
|
1048
|
+
readonly startSeconds: number;
|
|
1049
|
+
readonly endSeconds: number;
|
|
1050
|
+
readonly speaker?: string | undefined;
|
|
1051
|
+
readonly confidence?: number | undefined;
|
|
1052
|
+
}[] | undefined;
|
|
1053
|
+
readonly language?: string | undefined;
|
|
1054
|
+
readonly durationSeconds?: number | undefined;
|
|
1055
|
+
readonly usage?: {
|
|
1056
|
+
readonly type: "seconds";
|
|
1057
|
+
readonly seconds: number;
|
|
1058
|
+
} | {
|
|
1059
|
+
readonly type: "characters";
|
|
1060
|
+
readonly characters: number;
|
|
1061
|
+
} | {
|
|
1062
|
+
readonly type: "credits";
|
|
1063
|
+
readonly credits: number;
|
|
1064
|
+
} | {
|
|
1065
|
+
readonly type: "compute";
|
|
1066
|
+
readonly seconds: number;
|
|
1067
|
+
} | {
|
|
1068
|
+
readonly type: "tokens";
|
|
1069
|
+
readonly input?: number | undefined;
|
|
1070
|
+
readonly output?: number | undefined;
|
|
1071
|
+
readonly total?: number | undefined;
|
|
1072
|
+
readonly details?: {
|
|
1073
|
+
readonly [x: string]: unknown;
|
|
1074
|
+
} | undefined;
|
|
1075
|
+
} | undefined;
|
|
1076
|
+
readonly providerMetadata?: {
|
|
1077
|
+
readonly [x: string]: {
|
|
1078
|
+
readonly [x: string]: unknown;
|
|
1079
|
+
};
|
|
1080
|
+
} | undefined;
|
|
1081
|
+
readonly type: "finish";
|
|
1082
|
+
}) => any) | undefined;
|
|
1083
|
+
readonly "generation-progress"?: ((value: {
|
|
1084
|
+
readonly type: "generation-progress";
|
|
1085
|
+
readonly id: string;
|
|
1086
|
+
readonly progress?: number | undefined;
|
|
1087
|
+
}) => any) | undefined;
|
|
1088
|
+
readonly "generation-queued"?: ((value: {
|
|
1089
|
+
readonly type: "generation-queued";
|
|
1090
|
+
readonly id: string;
|
|
1091
|
+
readonly position?: number | undefined;
|
|
1092
|
+
}) => any) | undefined;
|
|
1093
|
+
readonly segment?: ((value: {
|
|
1094
|
+
readonly type: "segment";
|
|
1095
|
+
readonly segment: {
|
|
1096
|
+
readonly text: string;
|
|
1097
|
+
readonly startSeconds: number;
|
|
1098
|
+
readonly endSeconds: number;
|
|
1099
|
+
readonly speaker?: string | undefined;
|
|
1100
|
+
};
|
|
1101
|
+
}) => any) | undefined;
|
|
1102
|
+
readonly "text-delta"?: ((value: {
|
|
1103
|
+
readonly type: "text-delta";
|
|
1104
|
+
readonly delta: string;
|
|
1105
|
+
}) => any) | undefined;
|
|
1106
|
+
} & (Exclude<keyof Handlers, "finish" | "generation-progress" | "generation-queued" | "segment" | "text-delta"> extends never ? unknown : never), orElse: OrElse & ((value: Exclude<{
|
|
1068
1107
|
readonly type: "text-delta";
|
|
1069
1108
|
readonly delta: string;
|
|
1070
|
-
}
|
|
1109
|
+
}, {
|
|
1110
|
+
readonly type: keyof Handlers;
|
|
1111
|
+
}> | Exclude<{
|
|
1071
1112
|
readonly type: "segment";
|
|
1072
1113
|
readonly segment: {
|
|
1073
1114
|
readonly text: string;
|
|
@@ -1075,15 +1116,21 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1075
1116
|
readonly endSeconds: number;
|
|
1076
1117
|
readonly speaker?: string | undefined;
|
|
1077
1118
|
};
|
|
1078
|
-
}
|
|
1119
|
+
}, {
|
|
1120
|
+
readonly type: keyof Handlers;
|
|
1121
|
+
}> | Exclude<{
|
|
1079
1122
|
readonly type: "generation-queued";
|
|
1080
1123
|
readonly id: string;
|
|
1081
1124
|
readonly position?: number | undefined;
|
|
1082
|
-
}
|
|
1125
|
+
}, {
|
|
1126
|
+
readonly type: keyof Handlers;
|
|
1127
|
+
}> | Exclude<{
|
|
1083
1128
|
readonly type: "generation-progress";
|
|
1084
1129
|
readonly id: string;
|
|
1085
1130
|
readonly progress?: number | undefined;
|
|
1086
|
-
}
|
|
1131
|
+
}, {
|
|
1132
|
+
readonly type: keyof Handlers;
|
|
1133
|
+
}> | Exclude<{
|
|
1087
1134
|
readonly text: string;
|
|
1088
1135
|
readonly segments?: readonly {
|
|
1089
1136
|
readonly text: string;
|
|
@@ -1127,7 +1174,9 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1127
1174
|
};
|
|
1128
1175
|
} | undefined;
|
|
1129
1176
|
readonly type: "finish";
|
|
1130
|
-
}, {
|
|
1177
|
+
}, {
|
|
1178
|
+
readonly type: keyof Handlers;
|
|
1179
|
+
}>) => any)): (value: {
|
|
1131
1180
|
readonly type: "text-delta";
|
|
1132
1181
|
readonly delta: string;
|
|
1133
1182
|
} | {
|
|
@@ -1190,7 +1239,7 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1190
1239
|
};
|
|
1191
1240
|
} | undefined;
|
|
1192
1241
|
readonly type: "finish";
|
|
1193
|
-
}) => import("effect/Unify").Unify<{ [K in keyof
|
|
1242
|
+
}) => import("effect/Unify").Unify<{ [K in keyof Handlers]-?: NonNullable<Handlers[K]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Handlers] | (OrElse extends (...args: Array<any>) => infer R ? R : never)>;
|
|
1194
1243
|
};
|
|
1195
1244
|
} & {
|
|
1196
1245
|
is: {
|
|
@@ -1265,12 +1314,12 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1265
1314
|
};
|
|
1266
1315
|
};
|
|
1267
1316
|
export type TranscriptionEvent = Schema.Schema.Type<typeof transcriptionEventTagged>;
|
|
1268
|
-
|
|
1269
|
-
export declare
|
|
1270
|
-
export declare function generate<const Model extends TranscriptionModel>(input:
|
|
1271
|
-
export declare function stream<const Model extends TranscriptionModel>(input:
|
|
1317
|
+
/** Normalize transcription request input into a plain `TranscriptionRequest`. */
|
|
1318
|
+
export declare const request: <const Model extends TranscriptionModel>(input: TranscriptionRequestInput<Model>) => TranscriptionRequest<Model>;
|
|
1319
|
+
export declare function generate<const Model extends TranscriptionModel>(input: TranscriptionRequestInput<Model>, options?: AwaitOptions): Effect.Effect<TranscriptionResponse, AIError, Service>;
|
|
1320
|
+
export declare function stream<const Model extends TranscriptionModel>(input: TranscriptionRequestInput<Model>, options?: AwaitOptions): Stream.Stream<TranscriptionEvent, AIError, Service>;
|
|
1272
1321
|
/** Inline and streaming routes fail with `UnsupportedOperation`. */
|
|
1273
|
-
export declare function start<const Model extends TranscriptionModel>(input:
|
|
1322
|
+
export declare function start<const Model extends TranscriptionModel>(input: TranscriptionRequestInput<Model>): Effect.Effect<Generation<TranscriptionResponse>, AIError, Service>;
|
|
1274
1323
|
export declare const resume: (model: TranscriptionModel, token: unknown) => Effect.Effect<Generation<TranscriptionResponse>, AIError, Service>;
|
|
1275
1324
|
export declare const Transcription: {
|
|
1276
1325
|
readonly request: typeof request;
|