@opencode/ai 2.0.32 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-client.d.ts +2 -2
- package/dist/experimental/evaluation-client.d.ts +1 -1
- package/dist/experimental/evaluation.d.ts +20 -20
- package/dist/experimental/realtime.d.ts +6 -14
- package/dist/experimental/realtime.js +28 -3
- package/dist/experimental/system-one.d.ts +1 -1
- package/dist/image-client.d.ts +8 -8
- package/dist/image.d.ts +593 -437
- package/dist/llm.d.ts +51 -51
- package/dist/media-client.d.ts +1 -1
- package/dist/media.d.ts +4 -4
- package/dist/promise.d.ts +199 -198
- package/dist/protocols/alibaba-chat.d.ts +81 -82
- package/dist/protocols/alibaba-chat.js +0 -1
- package/dist/protocols/alibaba-messages.d.ts +99 -99
- package/dist/protocols/alibaba-responses.d.ts +120 -120
- package/dist/protocols/anthropic-messages.d.ts +187 -187
- package/dist/protocols/anthropic-messages.js +3 -2
- package/dist/protocols/assemblyai-transcription.d.ts +1 -1
- package/dist/protocols/bedrock-converse.d.ts +75 -79
- package/dist/protocols/bfl-images.d.ts +1 -1
- package/dist/protocols/cartesia-speech.d.ts +17 -17
- package/dist/protocols/cohere-chat.d.ts +26 -23
- package/dist/protocols/cohere-chat.js +22 -1
- package/dist/protocols/deepgram-speech.d.ts +17 -17
- package/dist/protocols/deepgram-transcription.d.ts +1 -1
- package/dist/protocols/elevenlabs-speech.d.ts +17 -17
- package/dist/protocols/elevenlabs-transcription.d.ts +1 -1
- package/dist/protocols/fal-images.d.ts +1 -1
- package/dist/protocols/fal-video.d.ts +1 -1
- package/dist/protocols/gemini.d.ts +55 -55
- package/dist/protocols/google-images.d.ts +1 -1
- package/dist/protocols/google-interactions.d.ts +64 -62
- package/dist/protocols/google-interactions.js +19 -1
- package/dist/protocols/google-speech.d.ts +17 -17
- package/dist/protocols/google-transcription.d.ts +47 -47
- package/dist/protocols/google-video.d.ts +1 -1
- package/dist/protocols/meta-messages.d.ts +121 -121
- package/dist/protocols/meta-responses.d.ts +201 -201
- package/dist/protocols/mistral-chat.d.ts +45 -45
- package/dist/protocols/open-responses-channel.d.ts +1 -1
- package/dist/protocols/open-responses.d.ts +584 -450
- package/dist/protocols/open-responses.js +27 -35
- package/dist/protocols/openai-chat.d.ts +248 -248
- package/dist/protocols/openai-chat.js +11 -42
- package/dist/protocols/openai-compatible-chat.d.ts +32 -32
- package/dist/protocols/openai-compatible-responses.d.ts +88 -88
- package/dist/protocols/openai-images.d.ts +17 -17
- package/dist/protocols/openai-responses.d.ts +567 -567
- package/dist/protocols/openai-responses.js +1 -1
- package/dist/protocols/openai-speech.d.ts +17 -17
- package/dist/protocols/openai-transcription.d.ts +47 -47
- package/dist/protocols/replicate-images.d.ts +1 -1
- package/dist/protocols/runway-video.d.ts +1 -1
- package/dist/protocols/shared.d.ts +12 -1
- package/dist/protocols/shared.js +17 -1
- package/dist/protocols/stability-images.d.ts +2 -2
- package/dist/protocols/utils/bedrock-cache.d.ts +2 -2
- package/dist/protocols/utils/bedrock-media.d.ts +4 -4
- package/dist/protocols/utils/openai-options.d.ts +1 -1
- package/dist/protocols/utils/speech-stream.d.ts +1 -1
- package/dist/protocols/utils/tool-schema.d.ts +10 -5
- package/dist/protocols/utils/tool-stream.d.ts +152 -152
- package/dist/protocols/venice-chat.d.ts +109 -110
- package/dist/protocols/venice-chat.js +0 -1
- package/dist/protocols/xai-images.d.ts +1 -1
- package/dist/protocols/xai-responses.d.ts +79 -79
- package/dist/protocols/xai-video.d.ts +1 -1
- package/dist/protocols/zai-chat.d.ts +77 -78
- package/dist/protocols/zai-chat.js +0 -1
- package/dist/protocols/zai-images.d.ts +1 -1
- package/dist/protocols/zai-messages.d.ts +97 -97
- package/dist/providers/alibaba.d.ts +222 -283
- package/dist/providers/amazon-bedrock-mantle.d.ts +291 -298
- package/dist/providers/amazon-bedrock.d.ts +22 -28
- package/dist/providers/anthropic-compatible.d.ts +86 -90
- package/dist/providers/anthropic.d.ts +86 -90
- package/dist/providers/assemblyai.d.ts +2 -6
- package/dist/providers/azure.d.ts +228 -238
- package/dist/providers/baseten.d.ts +66 -70
- package/dist/providers/black-forest-labs.d.ts +2 -6
- package/dist/providers/cartesia.d.ts +2 -6
- package/dist/providers/cerebras.d.ts +66 -70
- package/dist/providers/cerebras.js +0 -1
- package/dist/providers/cloudflare-ai-gateway.d.ts +352 -356
- package/dist/providers/cloudflare-workers-ai.d.ts +66 -70
- package/dist/providers/cohere.d.ts +122 -132
- package/dist/providers/cohere.js +0 -2
- package/dist/providers/deepgram.d.ts +2 -7
- package/dist/providers/deepinfra.d.ts +66 -70
- package/dist/providers/deepinfra.js +0 -1
- package/dist/providers/deepseek.d.ts +66 -70
- package/dist/providers/deepseek.js +1 -1
- package/dist/providers/digitalocean.d.ts +137 -141
- package/dist/providers/elevenlabs.d.ts +2 -7
- package/dist/providers/fal.d.ts +2 -7
- package/dist/providers/fireworks.d.ts +66 -70
- package/dist/providers/google-vertex-chat.d.ts +34 -38
- package/dist/providers/google-vertex-interactions.d.ts +31 -41
- package/dist/providers/google-vertex-messages.d.ts +81 -85
- package/dist/providers/google-vertex-mistral.d.ts +23 -27
- package/dist/providers/google-vertex-responses.d.ts +90 -94
- package/dist/providers/google-vertex.d.ts +26 -30
- package/dist/providers/google.d.ts +94 -109
- package/dist/providers/groq.d.ts +111 -115
- package/dist/providers/groq.js +0 -1
- package/dist/providers/meta.d.ts +309 -317
- package/dist/providers/meta.js +1 -1
- package/dist/providers/minimax.d.ts +296 -303
- package/dist/providers/minimax.js +1 -1
- package/dist/providers/mistral.d.ts +22 -26
- package/dist/providers/moonshot.d.ts +296 -303
- package/dist/providers/moonshot.js +0 -1
- package/dist/providers/openai-compatible-responses.d.ts +90 -94
- package/dist/providers/openai-compatible.d.ts +34 -38
- package/dist/providers/openai.d.ts +93 -108
- package/dist/providers/opencode.d.ts +2 -8
- package/dist/providers/openrouter.d.ts +137 -144
- package/dist/providers/replicate.d.ts +2 -6
- package/dist/providers/runway.d.ts +2 -6
- package/dist/providers/stability.d.ts +2 -7
- package/dist/providers/togetherai.d.ts +66 -70
- package/dist/providers/togetherai.js +1 -1
- package/dist/providers/typesafe-ai.d.ts +2 -8
- package/dist/providers/venice.d.ts +58 -63
- package/dist/providers/vercel-ai-gateway.d.ts +2 -12
- package/dist/providers/xai.d.ts +38 -50
- package/dist/providers/zai-coding-plan.d.ts +206 -213
- package/dist/providers/zai.d.ts +40 -46
- package/dist/route/client.d.ts +51 -51
- package/dist/route/media-protocol.d.ts +1 -1
- package/dist/route/transport/http.d.ts +1 -1
- package/dist/route/transport/websocket.d.ts +8 -8
- package/dist/schema/errors.d.ts +19 -19
- package/dist/schema/events.d.ts +3090 -3288
- package/dist/schema/messages.d.ts +8 -7
- package/dist/schema/options.d.ts +2 -1
- package/dist/schema/options.js +2 -1
- package/dist/speech-client.d.ts +8 -8
- package/dist/speech.d.ts +434 -398
- package/dist/testing.d.ts +338 -338
- package/dist/tool-runtime.d.ts +1 -1
- package/dist/transcription-client.d.ts +23 -23
- package/dist/transcription.d.ts +562 -646
- package/dist/utils/sanitize.d.ts +4 -0
- package/dist/utils/sanitize.js +23 -6
- package/dist/video-client.d.ts +8 -8
- package/dist/video.d.ts +416 -372
- package/package.json +6 -6
package/dist/speech.d.ts
CHANGED
|
@@ -349,28 +349,10 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
349
349
|
}>]> & {
|
|
350
350
|
readonly discriminants: readonly ["generation-queued", "generation-progress", "audio-delta", "timestamps", "finish"];
|
|
351
351
|
readonly cases: {
|
|
352
|
-
"generation-queued": Schema.Struct<{
|
|
353
|
-
readonly type: Schema.tag<"generation-queued">;
|
|
354
|
-
readonly id: Schema.String;
|
|
355
|
-
readonly position: Schema.optional<Schema.Number>;
|
|
356
|
-
}>;
|
|
357
|
-
"generation-progress": Schema.Struct<{
|
|
358
|
-
readonly type: Schema.tag<"generation-progress">;
|
|
359
|
-
readonly id: Schema.String;
|
|
360
|
-
readonly progress: Schema.optional<Schema.Number>;
|
|
361
|
-
}>;
|
|
362
352
|
"audio-delta": Schema.Struct<{
|
|
363
353
|
readonly type: Schema.tag<"audio-delta">;
|
|
364
354
|
readonly chunk: Schema.Uint8Array;
|
|
365
355
|
}>;
|
|
366
|
-
timestamps: Schema.Struct<{
|
|
367
|
-
readonly type: Schema.tag<"timestamps">;
|
|
368
|
-
readonly items: Schema.$Array<Schema.Struct<{
|
|
369
|
-
readonly text: Schema.String;
|
|
370
|
-
readonly startSeconds: Schema.Number;
|
|
371
|
-
readonly endSeconds: Schema.Number;
|
|
372
|
-
}>>;
|
|
373
|
-
}>;
|
|
374
356
|
finish: Schema.Struct<{
|
|
375
357
|
readonly type: Schema.tag<"finish">;
|
|
376
358
|
readonly audio: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
@@ -430,14 +412,32 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
430
412
|
}>>>;
|
|
431
413
|
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
432
414
|
}>;
|
|
415
|
+
"generation-progress": Schema.Struct<{
|
|
416
|
+
readonly type: Schema.tag<"generation-progress">;
|
|
417
|
+
readonly id: Schema.String;
|
|
418
|
+
readonly progress: Schema.optional<Schema.Number>;
|
|
419
|
+
}>;
|
|
420
|
+
"generation-queued": Schema.Struct<{
|
|
421
|
+
readonly type: Schema.tag<"generation-queued">;
|
|
422
|
+
readonly id: Schema.String;
|
|
423
|
+
readonly position: Schema.optional<Schema.Number>;
|
|
424
|
+
}>;
|
|
425
|
+
timestamps: Schema.Struct<{
|
|
426
|
+
readonly type: Schema.tag<"timestamps">;
|
|
427
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
428
|
+
readonly text: Schema.String;
|
|
429
|
+
readonly startSeconds: Schema.Number;
|
|
430
|
+
readonly endSeconds: Schema.Number;
|
|
431
|
+
}>>;
|
|
432
|
+
}>;
|
|
433
433
|
};
|
|
434
434
|
readonly isAnyOf: <const Keys>(keys: readonly Keys[]) => (value: {
|
|
435
|
-
readonly id: string;
|
|
436
435
|
readonly type: "generation-queued";
|
|
436
|
+
readonly id: string;
|
|
437
437
|
readonly position?: number | undefined;
|
|
438
438
|
} | {
|
|
439
|
-
readonly id: string;
|
|
440
439
|
readonly type: "generation-progress";
|
|
440
|
+
readonly id: string;
|
|
441
441
|
readonly progress?: number | undefined;
|
|
442
442
|
} | {
|
|
443
443
|
readonly type: "audio-delta";
|
|
@@ -452,11 +452,6 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
452
452
|
} | {
|
|
453
453
|
readonly type: "finish";
|
|
454
454
|
readonly audio: Media.Asset;
|
|
455
|
-
readonly providerMetadata?: {
|
|
456
|
-
readonly [x: string]: {
|
|
457
|
-
readonly [x: string]: unknown;
|
|
458
|
-
};
|
|
459
|
-
} | undefined;
|
|
460
455
|
readonly usage?: {
|
|
461
456
|
readonly type: "tokens";
|
|
462
457
|
readonly input?: number | undefined;
|
|
@@ -479,7 +474,7 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
479
474
|
readonly seconds: number;
|
|
480
475
|
} | undefined;
|
|
481
476
|
readonly notices?: readonly {
|
|
482
|
-
readonly type: "
|
|
477
|
+
readonly type: "filtered" | "moderated" | "other";
|
|
483
478
|
readonly message: string;
|
|
484
479
|
readonly providerMetadata?: {
|
|
485
480
|
readonly [x: string]: {
|
|
@@ -487,15 +482,20 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
487
482
|
};
|
|
488
483
|
} | undefined;
|
|
489
484
|
}[] | undefined;
|
|
485
|
+
readonly providerMetadata?: {
|
|
486
|
+
readonly [x: string]: {
|
|
487
|
+
readonly [x: string]: unknown;
|
|
488
|
+
};
|
|
489
|
+
} | undefined;
|
|
490
490
|
}) => value is Extract<{
|
|
491
|
-
readonly id: string;
|
|
492
491
|
readonly type: "generation-queued";
|
|
492
|
+
readonly id: string;
|
|
493
493
|
readonly position?: number | undefined;
|
|
494
494
|
}, {
|
|
495
495
|
readonly type: Keys;
|
|
496
496
|
}> | Extract<{
|
|
497
|
-
readonly id: string;
|
|
498
497
|
readonly type: "generation-progress";
|
|
498
|
+
readonly id: string;
|
|
499
499
|
readonly progress?: number | undefined;
|
|
500
500
|
}, {
|
|
501
501
|
readonly type: Keys;
|
|
@@ -516,11 +516,6 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
516
516
|
}> | Extract<{
|
|
517
517
|
readonly type: "finish";
|
|
518
518
|
readonly audio: Media.Asset;
|
|
519
|
-
readonly providerMetadata?: {
|
|
520
|
-
readonly [x: string]: {
|
|
521
|
-
readonly [x: string]: unknown;
|
|
522
|
-
};
|
|
523
|
-
} | undefined;
|
|
524
519
|
readonly usage?: {
|
|
525
520
|
readonly type: "tokens";
|
|
526
521
|
readonly input?: number | undefined;
|
|
@@ -543,7 +538,7 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
543
538
|
readonly seconds: number;
|
|
544
539
|
} | undefined;
|
|
545
540
|
readonly notices?: readonly {
|
|
546
|
-
readonly type: "
|
|
541
|
+
readonly type: "filtered" | "moderated" | "other";
|
|
547
542
|
readonly message: string;
|
|
548
543
|
readonly providerMetadata?: {
|
|
549
544
|
readonly [x: string]: {
|
|
@@ -551,40 +546,22 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
551
546
|
};
|
|
552
547
|
} | undefined;
|
|
553
548
|
}[] | undefined;
|
|
549
|
+
readonly providerMetadata?: {
|
|
550
|
+
readonly [x: string]: {
|
|
551
|
+
readonly [x: string]: unknown;
|
|
552
|
+
};
|
|
553
|
+
} | undefined;
|
|
554
554
|
}, {
|
|
555
555
|
readonly type: Keys;
|
|
556
556
|
}>;
|
|
557
557
|
readonly guards: {
|
|
558
|
-
"generation-queued": (u: unknown) => u is {
|
|
559
|
-
readonly id: string;
|
|
560
|
-
readonly type: "generation-queued";
|
|
561
|
-
readonly position?: number | undefined;
|
|
562
|
-
};
|
|
563
|
-
"generation-progress": (u: unknown) => u is {
|
|
564
|
-
readonly id: string;
|
|
565
|
-
readonly type: "generation-progress";
|
|
566
|
-
readonly progress?: number | undefined;
|
|
567
|
-
};
|
|
568
558
|
"audio-delta": (u: unknown) => u is {
|
|
569
559
|
readonly type: "audio-delta";
|
|
570
560
|
readonly chunk: Uint8Array<ArrayBufferLike>;
|
|
571
561
|
};
|
|
572
|
-
timestamps: (u: unknown) => u is {
|
|
573
|
-
readonly type: "timestamps";
|
|
574
|
-
readonly items: readonly {
|
|
575
|
-
readonly text: string;
|
|
576
|
-
readonly startSeconds: number;
|
|
577
|
-
readonly endSeconds: number;
|
|
578
|
-
}[];
|
|
579
|
-
};
|
|
580
562
|
finish: (u: unknown) => u is {
|
|
581
563
|
readonly type: "finish";
|
|
582
564
|
readonly audio: Media.Asset;
|
|
583
|
-
readonly providerMetadata?: {
|
|
584
|
-
readonly [x: string]: {
|
|
585
|
-
readonly [x: string]: unknown;
|
|
586
|
-
};
|
|
587
|
-
} | undefined;
|
|
588
565
|
readonly usage?: {
|
|
589
566
|
readonly type: "tokens";
|
|
590
567
|
readonly input?: number | undefined;
|
|
@@ -607,7 +584,7 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
607
584
|
readonly seconds: number;
|
|
608
585
|
} | undefined;
|
|
609
586
|
readonly notices?: readonly {
|
|
610
|
-
readonly type: "
|
|
587
|
+
readonly type: "filtered" | "moderated" | "other";
|
|
611
588
|
readonly message: string;
|
|
612
589
|
readonly providerMetadata?: {
|
|
613
590
|
readonly [x: string]: {
|
|
@@ -615,78 +592,115 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
615
592
|
};
|
|
616
593
|
} | undefined;
|
|
617
594
|
}[] | undefined;
|
|
595
|
+
readonly providerMetadata?: {
|
|
596
|
+
readonly [x: string]: {
|
|
597
|
+
readonly [x: string]: unknown;
|
|
598
|
+
};
|
|
599
|
+
} | undefined;
|
|
600
|
+
};
|
|
601
|
+
"generation-progress": (u: unknown) => u is {
|
|
602
|
+
readonly type: "generation-progress";
|
|
603
|
+
readonly id: string;
|
|
604
|
+
readonly progress?: number | undefined;
|
|
605
|
+
};
|
|
606
|
+
"generation-queued": (u: unknown) => u is {
|
|
607
|
+
readonly type: "generation-queued";
|
|
608
|
+
readonly id: string;
|
|
609
|
+
readonly position?: number | undefined;
|
|
610
|
+
};
|
|
611
|
+
timestamps: (u: unknown) => u is {
|
|
612
|
+
readonly type: "timestamps";
|
|
613
|
+
readonly items: readonly {
|
|
614
|
+
readonly text: string;
|
|
615
|
+
readonly startSeconds: number;
|
|
616
|
+
readonly endSeconds: number;
|
|
617
|
+
}[];
|
|
618
618
|
};
|
|
619
619
|
};
|
|
620
620
|
readonly match: {
|
|
621
|
-
<Cases extends {
|
|
622
|
-
"generation-queued"
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
readonly
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
readonly
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
readonly
|
|
654
|
-
readonly
|
|
655
|
-
|
|
656
|
-
readonly
|
|
657
|
-
readonly
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
readonly
|
|
663
|
-
|
|
664
|
-
readonly
|
|
665
|
-
readonly
|
|
666
|
-
|
|
667
|
-
readonly
|
|
668
|
-
readonly
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
readonly
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
621
|
+
<Cases extends { [M in Schema.Struct<{
|
|
622
|
+
readonly type: Schema.tag<"generation-queued">;
|
|
623
|
+
readonly id: Schema.String;
|
|
624
|
+
readonly position: Schema.optional<Schema.Number>;
|
|
625
|
+
}> | Schema.Struct<{
|
|
626
|
+
readonly type: Schema.tag<"generation-progress">;
|
|
627
|
+
readonly id: Schema.String;
|
|
628
|
+
readonly progress: Schema.optional<Schema.Number>;
|
|
629
|
+
}> | Schema.Struct<{
|
|
630
|
+
readonly type: Schema.tag<"audio-delta">;
|
|
631
|
+
readonly chunk: Schema.Uint8Array;
|
|
632
|
+
}> | Schema.Struct<{
|
|
633
|
+
readonly type: Schema.tag<"timestamps">;
|
|
634
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
635
|
+
readonly text: Schema.String;
|
|
636
|
+
readonly startSeconds: Schema.Number;
|
|
637
|
+
readonly endSeconds: Schema.Number;
|
|
638
|
+
}>>;
|
|
639
|
+
}> | Schema.Struct<{
|
|
640
|
+
readonly type: Schema.tag<"finish">;
|
|
641
|
+
readonly audio: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
642
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
643
|
+
readonly type: Schema.Literal<"bytes">;
|
|
644
|
+
readonly data: Schema.Uint8Array;
|
|
645
|
+
readonly mediaType: Schema.String;
|
|
646
|
+
}>, Schema.Struct<{
|
|
647
|
+
readonly type: Schema.Literal<"base64">;
|
|
648
|
+
readonly data: Schema.String;
|
|
649
|
+
readonly mediaType: Schema.String;
|
|
650
|
+
}>, Schema.Struct<{
|
|
651
|
+
readonly type: Schema.Literal<"url">;
|
|
652
|
+
readonly url: Schema.String;
|
|
653
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
654
|
+
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
655
|
+
}>, Schema.Struct<{
|
|
656
|
+
readonly type: Schema.Literal<"ref">;
|
|
657
|
+
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
658
|
+
readonly id: Schema.String;
|
|
659
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
660
|
+
}>]>;
|
|
661
|
+
readonly info: Schema.optional<Schema.Struct<{
|
|
662
|
+
readonly width: Schema.optional<Schema.Number>;
|
|
663
|
+
readonly height: Schema.optional<Schema.Number>;
|
|
664
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
665
|
+
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
666
|
+
readonly channels: Schema.optional<Schema.Number>;
|
|
667
|
+
readonly encoding: Schema.optional<Schema.String>;
|
|
668
|
+
readonly format: Schema.optional<Schema.String>;
|
|
669
|
+
}>>;
|
|
670
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
671
|
+
}>, never, never>;
|
|
672
|
+
readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
673
|
+
readonly type: Schema.Literal<"tokens">;
|
|
674
|
+
readonly input: Schema.optional<Schema.Number>;
|
|
675
|
+
readonly output: Schema.optional<Schema.Number>;
|
|
676
|
+
readonly total: Schema.optional<Schema.Number>;
|
|
677
|
+
readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
678
|
+
}>, Schema.Struct<{
|
|
679
|
+
readonly type: Schema.Literal<"seconds">;
|
|
680
|
+
readonly seconds: Schema.Number;
|
|
681
|
+
}>, Schema.Struct<{
|
|
682
|
+
readonly type: Schema.Literal<"characters">;
|
|
683
|
+
readonly characters: Schema.Number;
|
|
684
|
+
}>, Schema.Struct<{
|
|
685
|
+
readonly type: Schema.Literal<"credits">;
|
|
686
|
+
readonly credits: Schema.Number;
|
|
687
|
+
}>, Schema.Struct<{
|
|
688
|
+
readonly type: Schema.Literal<"compute">;
|
|
689
|
+
readonly seconds: Schema.Number;
|
|
690
|
+
}>]>>;
|
|
691
|
+
readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
692
|
+
readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
|
|
693
|
+
readonly message: Schema.String;
|
|
694
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
695
|
+
}>>>;
|
|
696
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
697
|
+
}> as M["Type"]["type"]]: (value: M["Type"]) => any; }>(value: {
|
|
685
698
|
readonly type: "generation-queued";
|
|
699
|
+
readonly id: string;
|
|
686
700
|
readonly position?: number | undefined;
|
|
687
701
|
} | {
|
|
688
|
-
readonly id: string;
|
|
689
702
|
readonly type: "generation-progress";
|
|
703
|
+
readonly id: string;
|
|
690
704
|
readonly progress?: number | undefined;
|
|
691
705
|
} | {
|
|
692
706
|
readonly type: "audio-delta";
|
|
@@ -701,11 +715,6 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
701
715
|
} | {
|
|
702
716
|
readonly type: "finish";
|
|
703
717
|
readonly audio: Media.Asset;
|
|
704
|
-
readonly providerMetadata?: {
|
|
705
|
-
readonly [x: string]: {
|
|
706
|
-
readonly [x: string]: unknown;
|
|
707
|
-
};
|
|
708
|
-
} | undefined;
|
|
709
718
|
readonly usage?: {
|
|
710
719
|
readonly type: "tokens";
|
|
711
720
|
readonly input?: number | undefined;
|
|
@@ -728,7 +737,7 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
728
737
|
readonly seconds: number;
|
|
729
738
|
} | undefined;
|
|
730
739
|
readonly notices?: readonly {
|
|
731
|
-
readonly type: "
|
|
740
|
+
readonly type: "filtered" | "moderated" | "other";
|
|
732
741
|
readonly message: string;
|
|
733
742
|
readonly providerMetadata?: {
|
|
734
743
|
readonly [x: string]: {
|
|
@@ -736,76 +745,95 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
736
745
|
};
|
|
737
746
|
} | undefined;
|
|
738
747
|
}[] | undefined;
|
|
748
|
+
readonly providerMetadata?: {
|
|
749
|
+
readonly [x: string]: {
|
|
750
|
+
readonly [x: string]: unknown;
|
|
751
|
+
};
|
|
752
|
+
} | undefined;
|
|
739
753
|
}, cases: Cases): Cases[keyof Cases] extends (value: any) => infer R ? import("effect/Unify").Unify<R> : never;
|
|
740
|
-
<Cases extends {
|
|
741
|
-
"generation-queued"
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
readonly
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
readonly
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
readonly
|
|
773
|
-
readonly
|
|
774
|
-
|
|
775
|
-
readonly
|
|
776
|
-
readonly
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
}
|
|
780
|
-
|
|
781
|
-
readonly
|
|
782
|
-
|
|
783
|
-
readonly
|
|
784
|
-
readonly
|
|
785
|
-
|
|
786
|
-
readonly
|
|
787
|
-
readonly
|
|
788
|
-
}
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
readonly
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
754
|
+
<Cases extends { [M in Schema.Struct<{
|
|
755
|
+
readonly type: Schema.tag<"generation-queued">;
|
|
756
|
+
readonly id: Schema.String;
|
|
757
|
+
readonly position: Schema.optional<Schema.Number>;
|
|
758
|
+
}> | Schema.Struct<{
|
|
759
|
+
readonly type: Schema.tag<"generation-progress">;
|
|
760
|
+
readonly id: Schema.String;
|
|
761
|
+
readonly progress: Schema.optional<Schema.Number>;
|
|
762
|
+
}> | Schema.Struct<{
|
|
763
|
+
readonly type: Schema.tag<"audio-delta">;
|
|
764
|
+
readonly chunk: Schema.Uint8Array;
|
|
765
|
+
}> | Schema.Struct<{
|
|
766
|
+
readonly type: Schema.tag<"timestamps">;
|
|
767
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
768
|
+
readonly text: Schema.String;
|
|
769
|
+
readonly startSeconds: Schema.Number;
|
|
770
|
+
readonly endSeconds: Schema.Number;
|
|
771
|
+
}>>;
|
|
772
|
+
}> | Schema.Struct<{
|
|
773
|
+
readonly type: Schema.tag<"finish">;
|
|
774
|
+
readonly audio: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
775
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
776
|
+
readonly type: Schema.Literal<"bytes">;
|
|
777
|
+
readonly data: Schema.Uint8Array;
|
|
778
|
+
readonly mediaType: Schema.String;
|
|
779
|
+
}>, Schema.Struct<{
|
|
780
|
+
readonly type: Schema.Literal<"base64">;
|
|
781
|
+
readonly data: Schema.String;
|
|
782
|
+
readonly mediaType: Schema.String;
|
|
783
|
+
}>, Schema.Struct<{
|
|
784
|
+
readonly type: Schema.Literal<"url">;
|
|
785
|
+
readonly url: Schema.String;
|
|
786
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
787
|
+
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
788
|
+
}>, Schema.Struct<{
|
|
789
|
+
readonly type: Schema.Literal<"ref">;
|
|
790
|
+
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
791
|
+
readonly id: Schema.String;
|
|
792
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
793
|
+
}>]>;
|
|
794
|
+
readonly info: Schema.optional<Schema.Struct<{
|
|
795
|
+
readonly width: Schema.optional<Schema.Number>;
|
|
796
|
+
readonly height: Schema.optional<Schema.Number>;
|
|
797
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
798
|
+
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
799
|
+
readonly channels: Schema.optional<Schema.Number>;
|
|
800
|
+
readonly encoding: Schema.optional<Schema.String>;
|
|
801
|
+
readonly format: Schema.optional<Schema.String>;
|
|
802
|
+
}>>;
|
|
803
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
804
|
+
}>, never, never>;
|
|
805
|
+
readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
806
|
+
readonly type: Schema.Literal<"tokens">;
|
|
807
|
+
readonly input: Schema.optional<Schema.Number>;
|
|
808
|
+
readonly output: Schema.optional<Schema.Number>;
|
|
809
|
+
readonly total: Schema.optional<Schema.Number>;
|
|
810
|
+
readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
811
|
+
}>, Schema.Struct<{
|
|
812
|
+
readonly type: Schema.Literal<"seconds">;
|
|
813
|
+
readonly seconds: Schema.Number;
|
|
814
|
+
}>, Schema.Struct<{
|
|
815
|
+
readonly type: Schema.Literal<"characters">;
|
|
816
|
+
readonly characters: Schema.Number;
|
|
817
|
+
}>, Schema.Struct<{
|
|
818
|
+
readonly type: Schema.Literal<"credits">;
|
|
819
|
+
readonly credits: Schema.Number;
|
|
820
|
+
}>, Schema.Struct<{
|
|
821
|
+
readonly type: Schema.Literal<"compute">;
|
|
822
|
+
readonly seconds: Schema.Number;
|
|
823
|
+
}>]>>;
|
|
824
|
+
readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
825
|
+
readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
|
|
826
|
+
readonly message: Schema.String;
|
|
827
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
828
|
+
}>>>;
|
|
829
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
830
|
+
}> as M["Type"]["type"]]: (value: M["Type"]) => any; }>(cases: Cases): (value: {
|
|
804
831
|
readonly type: "generation-queued";
|
|
832
|
+
readonly id: string;
|
|
805
833
|
readonly position?: number | undefined;
|
|
806
834
|
} | {
|
|
807
|
-
readonly id: string;
|
|
808
835
|
readonly type: "generation-progress";
|
|
836
|
+
readonly id: string;
|
|
809
837
|
readonly progress?: number | undefined;
|
|
810
838
|
} | {
|
|
811
839
|
readonly type: "audio-delta";
|
|
@@ -820,11 +848,6 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
820
848
|
} | {
|
|
821
849
|
readonly type: "finish";
|
|
822
850
|
readonly audio: Media.Asset;
|
|
823
|
-
readonly providerMetadata?: {
|
|
824
|
-
readonly [x: string]: {
|
|
825
|
-
readonly [x: string]: unknown;
|
|
826
|
-
};
|
|
827
|
-
} | undefined;
|
|
828
851
|
readonly usage?: {
|
|
829
852
|
readonly type: "tokens";
|
|
830
853
|
readonly input?: number | undefined;
|
|
@@ -847,7 +870,7 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
847
870
|
readonly seconds: number;
|
|
848
871
|
} | undefined;
|
|
849
872
|
readonly notices?: readonly {
|
|
850
|
-
readonly type: "
|
|
873
|
+
readonly type: "filtered" | "moderated" | "other";
|
|
851
874
|
readonly message: string;
|
|
852
875
|
readonly providerMetadata?: {
|
|
853
876
|
readonly [x: string]: {
|
|
@@ -855,105 +878,111 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
855
878
|
};
|
|
856
879
|
} | undefined;
|
|
857
880
|
}[] | undefined;
|
|
881
|
+
readonly providerMetadata?: {
|
|
882
|
+
readonly [x: string]: {
|
|
883
|
+
readonly [x: string]: unknown;
|
|
884
|
+
};
|
|
885
|
+
} | undefined;
|
|
858
886
|
}) => Cases[keyof Cases] extends (value: any) => infer R ? import("effect/Unify").Unify<R> : never;
|
|
859
887
|
};
|
|
860
888
|
readonly matchOrElse: {
|
|
861
|
-
<Cases extends {
|
|
862
|
-
"generation-queued"
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
readonly
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
readonly
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
readonly
|
|
894
|
-
readonly
|
|
895
|
-
|
|
896
|
-
readonly
|
|
897
|
-
readonly
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
}
|
|
901
|
-
|
|
902
|
-
readonly
|
|
903
|
-
|
|
904
|
-
readonly
|
|
905
|
-
readonly
|
|
906
|
-
|
|
907
|
-
readonly
|
|
908
|
-
readonly
|
|
909
|
-
}
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
readonly
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
889
|
+
<Cases extends { [M in Schema.Struct<{
|
|
890
|
+
readonly type: Schema.tag<"generation-queued">;
|
|
891
|
+
readonly id: Schema.String;
|
|
892
|
+
readonly position: Schema.optional<Schema.Number>;
|
|
893
|
+
}> | Schema.Struct<{
|
|
894
|
+
readonly type: Schema.tag<"generation-progress">;
|
|
895
|
+
readonly id: Schema.String;
|
|
896
|
+
readonly progress: Schema.optional<Schema.Number>;
|
|
897
|
+
}> | Schema.Struct<{
|
|
898
|
+
readonly type: Schema.tag<"audio-delta">;
|
|
899
|
+
readonly chunk: Schema.Uint8Array;
|
|
900
|
+
}> | Schema.Struct<{
|
|
901
|
+
readonly type: Schema.tag<"timestamps">;
|
|
902
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
903
|
+
readonly text: Schema.String;
|
|
904
|
+
readonly startSeconds: Schema.Number;
|
|
905
|
+
readonly endSeconds: Schema.Number;
|
|
906
|
+
}>>;
|
|
907
|
+
}> | Schema.Struct<{
|
|
908
|
+
readonly type: Schema.tag<"finish">;
|
|
909
|
+
readonly audio: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
910
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
911
|
+
readonly type: Schema.Literal<"bytes">;
|
|
912
|
+
readonly data: Schema.Uint8Array;
|
|
913
|
+
readonly mediaType: Schema.String;
|
|
914
|
+
}>, Schema.Struct<{
|
|
915
|
+
readonly type: Schema.Literal<"base64">;
|
|
916
|
+
readonly data: Schema.String;
|
|
917
|
+
readonly mediaType: Schema.String;
|
|
918
|
+
}>, Schema.Struct<{
|
|
919
|
+
readonly type: Schema.Literal<"url">;
|
|
920
|
+
readonly url: Schema.String;
|
|
921
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
922
|
+
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
923
|
+
}>, Schema.Struct<{
|
|
924
|
+
readonly type: Schema.Literal<"ref">;
|
|
925
|
+
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
926
|
+
readonly id: Schema.String;
|
|
927
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
928
|
+
}>]>;
|
|
929
|
+
readonly info: Schema.optional<Schema.Struct<{
|
|
930
|
+
readonly width: Schema.optional<Schema.Number>;
|
|
931
|
+
readonly height: Schema.optional<Schema.Number>;
|
|
932
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
933
|
+
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
934
|
+
readonly channels: Schema.optional<Schema.Number>;
|
|
935
|
+
readonly encoding: Schema.optional<Schema.String>;
|
|
936
|
+
readonly format: Schema.optional<Schema.String>;
|
|
937
|
+
}>>;
|
|
938
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
939
|
+
}>, never, never>;
|
|
940
|
+
readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
941
|
+
readonly type: Schema.Literal<"tokens">;
|
|
942
|
+
readonly input: Schema.optional<Schema.Number>;
|
|
943
|
+
readonly output: Schema.optional<Schema.Number>;
|
|
944
|
+
readonly total: Schema.optional<Schema.Number>;
|
|
945
|
+
readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
946
|
+
}>, Schema.Struct<{
|
|
947
|
+
readonly type: Schema.Literal<"seconds">;
|
|
948
|
+
readonly seconds: Schema.Number;
|
|
949
|
+
}>, Schema.Struct<{
|
|
950
|
+
readonly type: Schema.Literal<"characters">;
|
|
951
|
+
readonly characters: Schema.Number;
|
|
952
|
+
}>, Schema.Struct<{
|
|
953
|
+
readonly type: Schema.Literal<"credits">;
|
|
954
|
+
readonly credits: Schema.Number;
|
|
955
|
+
}>, Schema.Struct<{
|
|
956
|
+
readonly type: Schema.Literal<"compute">;
|
|
957
|
+
readonly seconds: Schema.Number;
|
|
958
|
+
}>]>>;
|
|
959
|
+
readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
960
|
+
readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
|
|
961
|
+
readonly message: Schema.String;
|
|
962
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
963
|
+
}>>>;
|
|
964
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
965
|
+
}> as M["Type"]["type"]]+?: (value: M["Type"]) => any; } & { [K in Exclude<keyof Cases, "audio-delta" | "finish" | "generation-progress" | "generation-queued" | "timestamps">]: never; }, OrElse extends (value: Exclude<{
|
|
925
966
|
readonly type: "generation-queued";
|
|
926
|
-
readonly position?: number | undefined;
|
|
927
|
-
}, {
|
|
928
|
-
readonly type: keyof Cases;
|
|
929
|
-
}> | Exclude<{
|
|
930
967
|
readonly id: string;
|
|
968
|
+
readonly position?: number | undefined;
|
|
969
|
+
} | {
|
|
931
970
|
readonly type: "generation-progress";
|
|
971
|
+
readonly id: string;
|
|
932
972
|
readonly progress?: number | undefined;
|
|
933
|
-
}
|
|
934
|
-
readonly type: keyof Cases;
|
|
935
|
-
}> | Exclude<{
|
|
973
|
+
} | {
|
|
936
974
|
readonly type: "audio-delta";
|
|
937
975
|
readonly chunk: Uint8Array<ArrayBufferLike>;
|
|
938
|
-
}
|
|
939
|
-
readonly type: keyof Cases;
|
|
940
|
-
}> | Exclude<{
|
|
976
|
+
} | {
|
|
941
977
|
readonly type: "timestamps";
|
|
942
978
|
readonly items: readonly {
|
|
943
979
|
readonly text: string;
|
|
944
980
|
readonly startSeconds: number;
|
|
945
981
|
readonly endSeconds: number;
|
|
946
982
|
}[];
|
|
947
|
-
}
|
|
948
|
-
readonly type: keyof Cases;
|
|
949
|
-
}> | Exclude<{
|
|
983
|
+
} | {
|
|
950
984
|
readonly type: "finish";
|
|
951
985
|
readonly audio: Media.Asset;
|
|
952
|
-
readonly providerMetadata?: {
|
|
953
|
-
readonly [x: string]: {
|
|
954
|
-
readonly [x: string]: unknown;
|
|
955
|
-
};
|
|
956
|
-
} | undefined;
|
|
957
986
|
readonly usage?: {
|
|
958
987
|
readonly type: "tokens";
|
|
959
988
|
readonly input?: number | undefined;
|
|
@@ -976,7 +1005,7 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
976
1005
|
readonly seconds: number;
|
|
977
1006
|
} | undefined;
|
|
978
1007
|
readonly notices?: readonly {
|
|
979
|
-
readonly type: "
|
|
1008
|
+
readonly type: "filtered" | "moderated" | "other";
|
|
980
1009
|
readonly message: string;
|
|
981
1010
|
readonly providerMetadata?: {
|
|
982
1011
|
readonly [x: string]: {
|
|
@@ -984,15 +1013,18 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
984
1013
|
};
|
|
985
1014
|
} | undefined;
|
|
986
1015
|
}[] | undefined;
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
1016
|
+
readonly providerMetadata?: {
|
|
1017
|
+
readonly [x: string]: {
|
|
1018
|
+
readonly [x: string]: unknown;
|
|
1019
|
+
};
|
|
1020
|
+
} | undefined;
|
|
1021
|
+
}, { readonly [K in "type"]: keyof Cases; }>) => any>(value: {
|
|
991
1022
|
readonly type: "generation-queued";
|
|
1023
|
+
readonly id: string;
|
|
992
1024
|
readonly position?: number | undefined;
|
|
993
1025
|
} | {
|
|
994
|
-
readonly id: string;
|
|
995
1026
|
readonly type: "generation-progress";
|
|
1027
|
+
readonly id: string;
|
|
996
1028
|
readonly progress?: number | undefined;
|
|
997
1029
|
} | {
|
|
998
1030
|
readonly type: "audio-delta";
|
|
@@ -1007,11 +1039,6 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1007
1039
|
} | {
|
|
1008
1040
|
readonly type: "finish";
|
|
1009
1041
|
readonly audio: Media.Asset;
|
|
1010
|
-
readonly providerMetadata?: {
|
|
1011
|
-
readonly [x: string]: {
|
|
1012
|
-
readonly [x: string]: unknown;
|
|
1013
|
-
};
|
|
1014
|
-
} | undefined;
|
|
1015
1042
|
readonly usage?: {
|
|
1016
1043
|
readonly type: "tokens";
|
|
1017
1044
|
readonly input?: number | undefined;
|
|
@@ -1034,7 +1061,7 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1034
1061
|
readonly seconds: number;
|
|
1035
1062
|
} | undefined;
|
|
1036
1063
|
readonly notices?: readonly {
|
|
1037
|
-
readonly type: "
|
|
1064
|
+
readonly type: "filtered" | "moderated" | "other";
|
|
1038
1065
|
readonly message: string;
|
|
1039
1066
|
readonly providerMetadata?: {
|
|
1040
1067
|
readonly [x: string]: {
|
|
@@ -1042,103 +1069,109 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1042
1069
|
};
|
|
1043
1070
|
} | undefined;
|
|
1044
1071
|
}[] | undefined;
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
"generation-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
}
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
readonly
|
|
1073
|
-
readonly
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
}
|
|
1077
|
-
|
|
1078
|
-
readonly
|
|
1079
|
-
readonly
|
|
1080
|
-
|
|
1081
|
-
readonly
|
|
1082
|
-
readonly
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
}
|
|
1086
|
-
readonly type: "
|
|
1087
|
-
readonly
|
|
1088
|
-
|
|
1089
|
-
readonly
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
readonly
|
|
1093
|
-
readonly
|
|
1094
|
-
|
|
1095
|
-
readonly
|
|
1096
|
-
readonly
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1072
|
+
readonly providerMetadata?: {
|
|
1073
|
+
readonly [x: string]: {
|
|
1074
|
+
readonly [x: string]: unknown;
|
|
1075
|
+
};
|
|
1076
|
+
} | undefined;
|
|
1077
|
+
}, cases: Cases, orElse: OrElse): import("effect/Unify").Unify<{ [K in keyof Cases]-?: NonNullable<Cases[K]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Cases] | ReturnType<OrElse>>;
|
|
1078
|
+
<Cases extends { [M in Schema.Struct<{
|
|
1079
|
+
readonly type: Schema.tag<"generation-queued">;
|
|
1080
|
+
readonly id: Schema.String;
|
|
1081
|
+
readonly position: Schema.optional<Schema.Number>;
|
|
1082
|
+
}> | Schema.Struct<{
|
|
1083
|
+
readonly type: Schema.tag<"generation-progress">;
|
|
1084
|
+
readonly id: Schema.String;
|
|
1085
|
+
readonly progress: Schema.optional<Schema.Number>;
|
|
1086
|
+
}> | Schema.Struct<{
|
|
1087
|
+
readonly type: Schema.tag<"audio-delta">;
|
|
1088
|
+
readonly chunk: Schema.Uint8Array;
|
|
1089
|
+
}> | Schema.Struct<{
|
|
1090
|
+
readonly type: Schema.tag<"timestamps">;
|
|
1091
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
1092
|
+
readonly text: Schema.String;
|
|
1093
|
+
readonly startSeconds: Schema.Number;
|
|
1094
|
+
readonly endSeconds: Schema.Number;
|
|
1095
|
+
}>>;
|
|
1096
|
+
}> | Schema.Struct<{
|
|
1097
|
+
readonly type: Schema.tag<"finish">;
|
|
1098
|
+
readonly audio: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
1099
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
1100
|
+
readonly type: Schema.Literal<"bytes">;
|
|
1101
|
+
readonly data: Schema.Uint8Array;
|
|
1102
|
+
readonly mediaType: Schema.String;
|
|
1103
|
+
}>, Schema.Struct<{
|
|
1104
|
+
readonly type: Schema.Literal<"base64">;
|
|
1105
|
+
readonly data: Schema.String;
|
|
1106
|
+
readonly mediaType: Schema.String;
|
|
1107
|
+
}>, Schema.Struct<{
|
|
1108
|
+
readonly type: Schema.Literal<"url">;
|
|
1109
|
+
readonly url: Schema.String;
|
|
1110
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
1111
|
+
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
1112
|
+
}>, Schema.Struct<{
|
|
1113
|
+
readonly type: Schema.Literal<"ref">;
|
|
1114
|
+
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
1115
|
+
readonly id: Schema.String;
|
|
1116
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
1117
|
+
}>]>;
|
|
1118
|
+
readonly info: Schema.optional<Schema.Struct<{
|
|
1119
|
+
readonly width: Schema.optional<Schema.Number>;
|
|
1120
|
+
readonly height: Schema.optional<Schema.Number>;
|
|
1121
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
1122
|
+
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
1123
|
+
readonly channels: Schema.optional<Schema.Number>;
|
|
1124
|
+
readonly encoding: Schema.optional<Schema.String>;
|
|
1125
|
+
readonly format: Schema.optional<Schema.String>;
|
|
1126
|
+
}>>;
|
|
1127
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
1128
|
+
}>, never, never>;
|
|
1129
|
+
readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
1130
|
+
readonly type: Schema.Literal<"tokens">;
|
|
1131
|
+
readonly input: Schema.optional<Schema.Number>;
|
|
1132
|
+
readonly output: Schema.optional<Schema.Number>;
|
|
1133
|
+
readonly total: Schema.optional<Schema.Number>;
|
|
1134
|
+
readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
1135
|
+
}>, Schema.Struct<{
|
|
1136
|
+
readonly type: Schema.Literal<"seconds">;
|
|
1137
|
+
readonly seconds: Schema.Number;
|
|
1138
|
+
}>, Schema.Struct<{
|
|
1139
|
+
readonly type: Schema.Literal<"characters">;
|
|
1140
|
+
readonly characters: Schema.Number;
|
|
1141
|
+
}>, Schema.Struct<{
|
|
1142
|
+
readonly type: Schema.Literal<"credits">;
|
|
1143
|
+
readonly credits: Schema.Number;
|
|
1144
|
+
}>, Schema.Struct<{
|
|
1145
|
+
readonly type: Schema.Literal<"compute">;
|
|
1146
|
+
readonly seconds: Schema.Number;
|
|
1147
|
+
}>]>>;
|
|
1148
|
+
readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
1149
|
+
readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
|
|
1150
|
+
readonly message: Schema.String;
|
|
1151
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
1152
|
+
}>>>;
|
|
1153
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
1154
|
+
}> as M["Type"]["type"]]+?: (value: M["Type"]) => any; } & { [K in Exclude<keyof Cases, "audio-delta" | "finish" | "generation-progress" | "generation-queued" | "timestamps">]: never; }, OrElse extends (value: Exclude<{
|
|
1110
1155
|
readonly type: "generation-queued";
|
|
1111
|
-
readonly position?: number | undefined;
|
|
1112
|
-
}, {
|
|
1113
|
-
readonly type: keyof Cases;
|
|
1114
|
-
}> | Exclude<{
|
|
1115
1156
|
readonly id: string;
|
|
1157
|
+
readonly position?: number | undefined;
|
|
1158
|
+
} | {
|
|
1116
1159
|
readonly type: "generation-progress";
|
|
1160
|
+
readonly id: string;
|
|
1117
1161
|
readonly progress?: number | undefined;
|
|
1118
|
-
}
|
|
1119
|
-
readonly type: keyof Cases;
|
|
1120
|
-
}> | Exclude<{
|
|
1162
|
+
} | {
|
|
1121
1163
|
readonly type: "audio-delta";
|
|
1122
1164
|
readonly chunk: Uint8Array<ArrayBufferLike>;
|
|
1123
|
-
}
|
|
1124
|
-
readonly type: keyof Cases;
|
|
1125
|
-
}> | Exclude<{
|
|
1165
|
+
} | {
|
|
1126
1166
|
readonly type: "timestamps";
|
|
1127
1167
|
readonly items: readonly {
|
|
1128
1168
|
readonly text: string;
|
|
1129
1169
|
readonly startSeconds: number;
|
|
1130
1170
|
readonly endSeconds: number;
|
|
1131
1171
|
}[];
|
|
1132
|
-
}
|
|
1133
|
-
readonly type: keyof Cases;
|
|
1134
|
-
}> | Exclude<{
|
|
1172
|
+
} | {
|
|
1135
1173
|
readonly type: "finish";
|
|
1136
1174
|
readonly audio: Media.Asset;
|
|
1137
|
-
readonly providerMetadata?: {
|
|
1138
|
-
readonly [x: string]: {
|
|
1139
|
-
readonly [x: string]: unknown;
|
|
1140
|
-
};
|
|
1141
|
-
} | undefined;
|
|
1142
1175
|
readonly usage?: {
|
|
1143
1176
|
readonly type: "tokens";
|
|
1144
1177
|
readonly input?: number | undefined;
|
|
@@ -1161,7 +1194,7 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1161
1194
|
readonly seconds: number;
|
|
1162
1195
|
} | undefined;
|
|
1163
1196
|
readonly notices?: readonly {
|
|
1164
|
-
readonly type: "
|
|
1197
|
+
readonly type: "filtered" | "moderated" | "other";
|
|
1165
1198
|
readonly message: string;
|
|
1166
1199
|
readonly providerMetadata?: {
|
|
1167
1200
|
readonly [x: string]: {
|
|
@@ -1169,15 +1202,18 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1169
1202
|
};
|
|
1170
1203
|
} | undefined;
|
|
1171
1204
|
}[] | undefined;
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1205
|
+
readonly providerMetadata?: {
|
|
1206
|
+
readonly [x: string]: {
|
|
1207
|
+
readonly [x: string]: unknown;
|
|
1208
|
+
};
|
|
1209
|
+
} | undefined;
|
|
1210
|
+
}, { readonly [K in "type"]: keyof Cases; }>) => any>(cases: Cases, orElse: OrElse): (value: {
|
|
1176
1211
|
readonly type: "generation-queued";
|
|
1212
|
+
readonly id: string;
|
|
1177
1213
|
readonly position?: number | undefined;
|
|
1178
1214
|
} | {
|
|
1179
|
-
readonly id: string;
|
|
1180
1215
|
readonly type: "generation-progress";
|
|
1216
|
+
readonly id: string;
|
|
1181
1217
|
readonly progress?: number | undefined;
|
|
1182
1218
|
} | {
|
|
1183
1219
|
readonly type: "audio-delta";
|
|
@@ -1192,11 +1228,6 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1192
1228
|
} | {
|
|
1193
1229
|
readonly type: "finish";
|
|
1194
1230
|
readonly audio: Media.Asset;
|
|
1195
|
-
readonly providerMetadata?: {
|
|
1196
|
-
readonly [x: string]: {
|
|
1197
|
-
readonly [x: string]: unknown;
|
|
1198
|
-
};
|
|
1199
|
-
} | undefined;
|
|
1200
1231
|
readonly usage?: {
|
|
1201
1232
|
readonly type: "tokens";
|
|
1202
1233
|
readonly input?: number | undefined;
|
|
@@ -1219,7 +1250,7 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1219
1250
|
readonly seconds: number;
|
|
1220
1251
|
} | undefined;
|
|
1221
1252
|
readonly notices?: readonly {
|
|
1222
|
-
readonly type: "
|
|
1253
|
+
readonly type: "filtered" | "moderated" | "other";
|
|
1223
1254
|
readonly message: string;
|
|
1224
1255
|
readonly providerMetadata?: {
|
|
1225
1256
|
readonly [x: string]: {
|
|
@@ -1227,18 +1258,23 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1227
1258
|
};
|
|
1228
1259
|
} | undefined;
|
|
1229
1260
|
}[] | undefined;
|
|
1230
|
-
|
|
1261
|
+
readonly providerMetadata?: {
|
|
1262
|
+
readonly [x: string]: {
|
|
1263
|
+
readonly [x: string]: unknown;
|
|
1264
|
+
};
|
|
1265
|
+
} | undefined;
|
|
1266
|
+
}) => import("effect/Unify").Unify<{ [K in keyof Cases]-?: NonNullable<Cases[K]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Cases] | ReturnType<OrElse>>;
|
|
1231
1267
|
};
|
|
1232
1268
|
} & {
|
|
1233
1269
|
is: {
|
|
1234
1270
|
generationQueued: (u: unknown) => u is {
|
|
1235
|
-
readonly id: string;
|
|
1236
1271
|
readonly type: "generation-queued";
|
|
1272
|
+
readonly id: string;
|
|
1237
1273
|
readonly position?: number | undefined;
|
|
1238
1274
|
};
|
|
1239
1275
|
generationProgress: (u: unknown) => u is {
|
|
1240
|
-
readonly id: string;
|
|
1241
1276
|
readonly type: "generation-progress";
|
|
1277
|
+
readonly id: string;
|
|
1242
1278
|
readonly progress?: number | undefined;
|
|
1243
1279
|
};
|
|
1244
1280
|
audioDelta: (u: unknown) => u is {
|
|
@@ -1256,11 +1292,6 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1256
1292
|
finish: (u: unknown) => u is {
|
|
1257
1293
|
readonly type: "finish";
|
|
1258
1294
|
readonly audio: Media.Asset;
|
|
1259
|
-
readonly providerMetadata?: {
|
|
1260
|
-
readonly [x: string]: {
|
|
1261
|
-
readonly [x: string]: unknown;
|
|
1262
|
-
};
|
|
1263
|
-
} | undefined;
|
|
1264
1295
|
readonly usage?: {
|
|
1265
1296
|
readonly type: "tokens";
|
|
1266
1297
|
readonly input?: number | undefined;
|
|
@@ -1283,7 +1314,7 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1283
1314
|
readonly seconds: number;
|
|
1284
1315
|
} | undefined;
|
|
1285
1316
|
readonly notices?: readonly {
|
|
1286
|
-
readonly type: "
|
|
1317
|
+
readonly type: "filtered" | "moderated" | "other";
|
|
1287
1318
|
readonly message: string;
|
|
1288
1319
|
readonly providerMetadata?: {
|
|
1289
1320
|
readonly [x: string]: {
|
|
@@ -1291,6 +1322,11 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1291
1322
|
};
|
|
1292
1323
|
} | undefined;
|
|
1293
1324
|
}[] | undefined;
|
|
1325
|
+
readonly providerMetadata?: {
|
|
1326
|
+
readonly [x: string]: {
|
|
1327
|
+
readonly [x: string]: unknown;
|
|
1328
|
+
};
|
|
1329
|
+
} | undefined;
|
|
1294
1330
|
};
|
|
1295
1331
|
};
|
|
1296
1332
|
};
|