@opencode/ai 2.1.3 → 2.1.4

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.
Files changed (106) hide show
  1. package/dist/experimental/evaluation.js +3 -10
  2. package/dist/image-client.d.ts +8 -8
  3. package/dist/image.d.ts +148 -148
  4. package/dist/promise.d.ts +120 -120
  5. package/dist/protocols/alibaba-chat.d.ts +12 -12
  6. package/dist/protocols/alibaba-messages.d.ts +11 -11
  7. package/dist/protocols/alibaba-responses.d.ts +35 -35
  8. package/dist/protocols/anthropic-messages.d.ts +40 -44
  9. package/dist/protocols/anthropic-messages.js +3 -3
  10. package/dist/protocols/bedrock-converse.d.ts +30 -32
  11. package/dist/protocols/bedrock-converse.js +2 -3
  12. package/dist/protocols/cartesia-speech.d.ts +32 -32
  13. package/dist/protocols/cohere-chat.d.ts +7 -8
  14. package/dist/protocols/deepgram-speech.d.ts +32 -32
  15. package/dist/protocols/elevenlabs-speech.d.ts +32 -32
  16. package/dist/protocols/gemini.d.ts +34 -34
  17. package/dist/protocols/gemini.js +2 -2
  18. package/dist/protocols/google-interactions.d.ts +14 -14
  19. package/dist/protocols/google-interactions.js +2 -2
  20. package/dist/protocols/google-speech.d.ts +32 -32
  21. package/dist/protocols/google-transcription.d.ts +32 -32
  22. package/dist/protocols/meta-messages.d.ts +23 -23
  23. package/dist/protocols/meta-responses.d.ts +78 -78
  24. package/dist/protocols/mistral-chat.d.ts +81 -78
  25. package/dist/protocols/mistral-chat.js +2 -1
  26. package/dist/protocols/open-responses-channel.js +47 -46
  27. package/dist/protocols/open-responses-continuation.d.ts +8 -2
  28. package/dist/protocols/open-responses-continuation.js +3 -1
  29. package/dist/protocols/open-responses.d.ts +398 -398
  30. package/dist/protocols/open-responses.js +8 -7
  31. package/dist/protocols/openai-chat.d.ts +60 -60
  32. package/dist/protocols/openai-chat.js +3 -3
  33. package/dist/protocols/openai-compatible-chat.d.ts +13 -14
  34. package/dist/protocols/openai-compatible-responses.d.ts +36 -37
  35. package/dist/protocols/openai-images.d.ts +32 -32
  36. package/dist/protocols/openai-responses.d.ts +235 -235
  37. package/dist/protocols/openai-responses.js +1 -1
  38. package/dist/protocols/openai-speech.d.ts +32 -32
  39. package/dist/protocols/openai-transcription.d.ts +32 -32
  40. package/dist/protocols/openai-transcription.js +12 -7
  41. package/dist/protocols/utils/partial-json-options.d.ts +0 -1
  42. package/dist/protocols/utils/partial-json-options.js +0 -1
  43. package/dist/protocols/utils/tool-stream.d.ts +1 -1
  44. package/dist/protocols/venice-chat.d.ts +52 -53
  45. package/dist/protocols/venice-chat.js +6 -5
  46. package/dist/protocols/xai-responses.d.ts +78 -78
  47. package/dist/protocols/zai-chat.d.ts +33 -30
  48. package/dist/protocols/zai-chat.js +8 -3
  49. package/dist/protocols/zai-messages.d.ts +21 -19
  50. package/dist/protocols/zai-messages.js +3 -2
  51. package/dist/provider-error.js +5 -3
  52. package/dist/providers/alibaba.d.ts +69 -69
  53. package/dist/providers/amazon-bedrock-mantle.d.ts +202 -202
  54. package/dist/providers/amazon-bedrock.d.ts +15 -15
  55. package/dist/providers/anthropic-compatible.d.ts +13 -13
  56. package/dist/providers/anthropic.d.ts +13 -13
  57. package/dist/providers/azure.d.ts +106 -106
  58. package/dist/providers/baseten.d.ts +24 -24
  59. package/dist/providers/cerebras.d.ts +24 -24
  60. package/dist/providers/cloudflare-ai-gateway.d.ts +230 -227
  61. package/dist/providers/cloudflare-ai-gateway.js +1 -2
  62. package/dist/providers/cloudflare-workers-ai.d.ts +24 -24
  63. package/dist/providers/cohere.d.ts +75 -75
  64. package/dist/providers/deepinfra.d.ts +24 -24
  65. package/dist/providers/deepseek.d.ts +24 -24
  66. package/dist/providers/digitalocean.d.ts +36 -36
  67. package/dist/providers/fireworks.d.ts +24 -24
  68. package/dist/providers/google-vertex-chat.d.ts +12 -12
  69. package/dist/providers/google-vertex-messages.d.ts +13 -13
  70. package/dist/providers/google-vertex-mistral.d.ts +17 -17
  71. package/dist/providers/google-vertex-responses.d.ts +35 -35
  72. package/dist/providers/google-vertex.d.ts +17 -17
  73. package/dist/providers/google-vertex.js +2 -2
  74. package/dist/providers/google.d.ts +17 -17
  75. package/dist/providers/groq.d.ts +24 -24
  76. package/dist/providers/meta.d.ts +179 -179
  77. package/dist/providers/minimax.d.ts +71 -71
  78. package/dist/providers/mistral.d.ts +28 -28
  79. package/dist/providers/moonshot.d.ts +202 -202
  80. package/dist/providers/open-responses-options.d.ts +0 -1
  81. package/dist/providers/open-responses-options.js +1 -1
  82. package/dist/providers/openai-compatible-responses.d.ts +35 -35
  83. package/dist/providers/openai-compatible.d.ts +12 -12
  84. package/dist/providers/openai-compatible.js +1 -1
  85. package/dist/providers/openai-options.d.ts +0 -1
  86. package/dist/providers/openai-options.js +0 -1
  87. package/dist/providers/openai.d.ts +100 -100
  88. package/dist/providers/openrouter.d.ts +36 -36
  89. package/dist/providers/togetherai.d.ts +24 -24
  90. package/dist/providers/venice.d.ts +195 -20
  91. package/dist/providers/xai.d.ts +12 -12
  92. package/dist/providers/zai-coding-plan.d.ts +149 -69
  93. package/dist/providers/zai.d.ts +84 -19
  94. package/dist/route/auth-options.d.ts +0 -3
  95. package/dist/route/auth.d.ts +0 -2
  96. package/dist/route/auth.js +0 -2
  97. package/dist/route/client.d.ts +0 -2
  98. package/dist/route/client.js +3 -4
  99. package/dist/route/executor-service.js +1 -1
  100. package/dist/speech-client.d.ts +8 -8
  101. package/dist/speech.d.ts +148 -148
  102. package/dist/transcription-client.d.ts +8 -8
  103. package/dist/transcription.d.ts +148 -148
  104. package/dist/video-client.d.ts +8 -8
  105. package/dist/video.d.ts +114 -114
  106. package/package.json +6 -5
package/dist/speech.d.ts CHANGED
@@ -440,14 +440,6 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
440
440
  }>;
441
441
  };
442
442
  readonly isAnyOf: <const Keys>(keys: readonly Keys[]) => (value: {
443
- readonly type: "generation-queued";
444
- readonly id: string;
445
- readonly position?: number | undefined;
446
- } | {
447
- readonly type: "generation-progress";
448
- readonly id: string;
449
- readonly progress?: number | undefined;
450
- } | {
451
443
  readonly type: "audio-delta";
452
444
  readonly chunk: Uint8Array<ArrayBufferLike>;
453
445
  } | {
@@ -457,18 +449,18 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
457
449
  readonly startSeconds: number;
458
450
  readonly endSeconds: number;
459
451
  }[];
452
+ } | {
453
+ readonly type: "generation-queued";
454
+ readonly id: string;
455
+ readonly position?: number | undefined;
456
+ } | {
457
+ readonly type: "generation-progress";
458
+ readonly id: string;
459
+ readonly progress?: number | undefined;
460
460
  } | {
461
461
  readonly type: "finish";
462
462
  readonly audio: Media.Asset;
463
463
  readonly usage?: {
464
- readonly type: "tokens";
465
- readonly input?: number | undefined;
466
- readonly output?: number | undefined;
467
- readonly total?: number | undefined;
468
- readonly details?: {
469
- readonly [x: string]: unknown;
470
- } | undefined;
471
- } | {
472
464
  readonly type: "seconds";
473
465
  readonly seconds: number;
474
466
  } | {
@@ -480,6 +472,14 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
480
472
  } | {
481
473
  readonly type: "compute";
482
474
  readonly seconds: number;
475
+ } | {
476
+ readonly type: "tokens";
477
+ readonly input?: number | undefined;
478
+ readonly output?: number | undefined;
479
+ readonly total?: number | undefined;
480
+ readonly details?: {
481
+ readonly [x: string]: unknown;
482
+ } | undefined;
483
483
  } | undefined;
484
484
  readonly notices?: readonly {
485
485
  readonly type: "filtered" | "moderated" | "other";
@@ -496,18 +496,6 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
496
496
  };
497
497
  } | undefined;
498
498
  }) => value is Extract<{
499
- readonly type: "generation-queued";
500
- readonly id: string;
501
- readonly position?: number | undefined;
502
- }, {
503
- readonly type: Keys;
504
- }> | Extract<{
505
- readonly type: "generation-progress";
506
- readonly id: string;
507
- readonly progress?: number | undefined;
508
- }, {
509
- readonly type: Keys;
510
- }> | Extract<{
511
499
  readonly type: "audio-delta";
512
500
  readonly chunk: Uint8Array<ArrayBufferLike>;
513
501
  }, {
@@ -521,18 +509,22 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
521
509
  }[];
522
510
  }, {
523
511
  readonly type: Keys;
512
+ }> | Extract<{
513
+ readonly type: "generation-queued";
514
+ readonly id: string;
515
+ readonly position?: number | undefined;
516
+ }, {
517
+ readonly type: Keys;
518
+ }> | Extract<{
519
+ readonly type: "generation-progress";
520
+ readonly id: string;
521
+ readonly progress?: number | undefined;
522
+ }, {
523
+ readonly type: Keys;
524
524
  }> | Extract<{
525
525
  readonly type: "finish";
526
526
  readonly audio: Media.Asset;
527
527
  readonly usage?: {
528
- readonly type: "tokens";
529
- readonly input?: number | undefined;
530
- readonly output?: number | undefined;
531
- readonly total?: number | undefined;
532
- readonly details?: {
533
- readonly [x: string]: unknown;
534
- } | undefined;
535
- } | {
536
528
  readonly type: "seconds";
537
529
  readonly seconds: number;
538
530
  } | {
@@ -544,6 +536,14 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
544
536
  } | {
545
537
  readonly type: "compute";
546
538
  readonly seconds: number;
539
+ } | {
540
+ readonly type: "tokens";
541
+ readonly input?: number | undefined;
542
+ readonly output?: number | undefined;
543
+ readonly total?: number | undefined;
544
+ readonly details?: {
545
+ readonly [x: string]: unknown;
546
+ } | undefined;
547
547
  } | undefined;
548
548
  readonly notices?: readonly {
549
549
  readonly type: "filtered" | "moderated" | "other";
@@ -571,14 +571,6 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
571
571
  readonly type: "finish";
572
572
  readonly audio: Media.Asset;
573
573
  readonly usage?: {
574
- readonly type: "tokens";
575
- readonly input?: number | undefined;
576
- readonly output?: number | undefined;
577
- readonly total?: number | undefined;
578
- readonly details?: {
579
- readonly [x: string]: unknown;
580
- } | undefined;
581
- } | {
582
574
  readonly type: "seconds";
583
575
  readonly seconds: number;
584
576
  } | {
@@ -590,6 +582,14 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
590
582
  } | {
591
583
  readonly type: "compute";
592
584
  readonly seconds: number;
585
+ } | {
586
+ readonly type: "tokens";
587
+ readonly input?: number | undefined;
588
+ readonly output?: number | undefined;
589
+ readonly total?: number | undefined;
590
+ readonly details?: {
591
+ readonly [x: string]: unknown;
592
+ } | undefined;
593
593
  } | undefined;
594
594
  readonly notices?: readonly {
595
595
  readonly type: "filtered" | "moderated" | "other";
@@ -703,14 +703,6 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
703
703
  }>>>;
704
704
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
705
705
  }> as M["Type"]["type"]]: (value: M["Type"]) => any; }>(value: {
706
- readonly type: "generation-queued";
707
- readonly id: string;
708
- readonly position?: number | undefined;
709
- } | {
710
- readonly type: "generation-progress";
711
- readonly id: string;
712
- readonly progress?: number | undefined;
713
- } | {
714
706
  readonly type: "audio-delta";
715
707
  readonly chunk: Uint8Array<ArrayBufferLike>;
716
708
  } | {
@@ -720,18 +712,18 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
720
712
  readonly startSeconds: number;
721
713
  readonly endSeconds: number;
722
714
  }[];
715
+ } | {
716
+ readonly type: "generation-queued";
717
+ readonly id: string;
718
+ readonly position?: number | undefined;
719
+ } | {
720
+ readonly type: "generation-progress";
721
+ readonly id: string;
722
+ readonly progress?: number | undefined;
723
723
  } | {
724
724
  readonly type: "finish";
725
725
  readonly audio: Media.Asset;
726
726
  readonly usage?: {
727
- readonly type: "tokens";
728
- readonly input?: number | undefined;
729
- readonly output?: number | undefined;
730
- readonly total?: number | undefined;
731
- readonly details?: {
732
- readonly [x: string]: unknown;
733
- } | undefined;
734
- } | {
735
727
  readonly type: "seconds";
736
728
  readonly seconds: number;
737
729
  } | {
@@ -743,6 +735,14 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
743
735
  } | {
744
736
  readonly type: "compute";
745
737
  readonly seconds: number;
738
+ } | {
739
+ readonly type: "tokens";
740
+ readonly input?: number | undefined;
741
+ readonly output?: number | undefined;
742
+ readonly total?: number | undefined;
743
+ readonly details?: {
744
+ readonly [x: string]: unknown;
745
+ } | undefined;
746
746
  } | undefined;
747
747
  readonly notices?: readonly {
748
748
  readonly type: "filtered" | "moderated" | "other";
@@ -836,14 +836,6 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
836
836
  }>>>;
837
837
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
838
838
  }> as M["Type"]["type"]]: (value: M["Type"]) => any; }>(cases: Cases): (value: {
839
- readonly type: "generation-queued";
840
- readonly id: string;
841
- readonly position?: number | undefined;
842
- } | {
843
- readonly type: "generation-progress";
844
- readonly id: string;
845
- readonly progress?: number | undefined;
846
- } | {
847
839
  readonly type: "audio-delta";
848
840
  readonly chunk: Uint8Array<ArrayBufferLike>;
849
841
  } | {
@@ -853,18 +845,18 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
853
845
  readonly startSeconds: number;
854
846
  readonly endSeconds: number;
855
847
  }[];
848
+ } | {
849
+ readonly type: "generation-queued";
850
+ readonly id: string;
851
+ readonly position?: number | undefined;
852
+ } | {
853
+ readonly type: "generation-progress";
854
+ readonly id: string;
855
+ readonly progress?: number | undefined;
856
856
  } | {
857
857
  readonly type: "finish";
858
858
  readonly audio: Media.Asset;
859
859
  readonly usage?: {
860
- readonly type: "tokens";
861
- readonly input?: number | undefined;
862
- readonly output?: number | undefined;
863
- readonly total?: number | undefined;
864
- readonly details?: {
865
- readonly [x: string]: unknown;
866
- } | undefined;
867
- } | {
868
860
  readonly type: "seconds";
869
861
  readonly seconds: number;
870
862
  } | {
@@ -876,6 +868,14 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
876
868
  } | {
877
869
  readonly type: "compute";
878
870
  readonly seconds: number;
871
+ } | {
872
+ readonly type: "tokens";
873
+ readonly input?: number | undefined;
874
+ readonly output?: number | undefined;
875
+ readonly total?: number | undefined;
876
+ readonly details?: {
877
+ readonly [x: string]: unknown;
878
+ } | undefined;
879
879
  } | undefined;
880
880
  readonly notices?: readonly {
881
881
  readonly type: "filtered" | "moderated" | "other";
@@ -971,14 +971,6 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
971
971
  }>>>;
972
972
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
973
973
  }> 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<{
974
- readonly type: "generation-queued";
975
- readonly id: string;
976
- readonly position?: number | undefined;
977
- } | {
978
- readonly type: "generation-progress";
979
- readonly id: string;
980
- readonly progress?: number | undefined;
981
- } | {
982
974
  readonly type: "audio-delta";
983
975
  readonly chunk: Uint8Array<ArrayBufferLike>;
984
976
  } | {
@@ -988,18 +980,18 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
988
980
  readonly startSeconds: number;
989
981
  readonly endSeconds: number;
990
982
  }[];
983
+ } | {
984
+ readonly type: "generation-queued";
985
+ readonly id: string;
986
+ readonly position?: number | undefined;
987
+ } | {
988
+ readonly type: "generation-progress";
989
+ readonly id: string;
990
+ readonly progress?: number | undefined;
991
991
  } | {
992
992
  readonly type: "finish";
993
993
  readonly audio: Media.Asset;
994
994
  readonly usage?: {
995
- readonly type: "tokens";
996
- readonly input?: number | undefined;
997
- readonly output?: number | undefined;
998
- readonly total?: number | undefined;
999
- readonly details?: {
1000
- readonly [x: string]: unknown;
1001
- } | undefined;
1002
- } | {
1003
995
  readonly type: "seconds";
1004
996
  readonly seconds: number;
1005
997
  } | {
@@ -1011,6 +1003,14 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
1011
1003
  } | {
1012
1004
  readonly type: "compute";
1013
1005
  readonly seconds: number;
1006
+ } | {
1007
+ readonly type: "tokens";
1008
+ readonly input?: number | undefined;
1009
+ readonly output?: number | undefined;
1010
+ readonly total?: number | undefined;
1011
+ readonly details?: {
1012
+ readonly [x: string]: unknown;
1013
+ } | undefined;
1014
1014
  } | undefined;
1015
1015
  readonly notices?: readonly {
1016
1016
  readonly type: "filtered" | "moderated" | "other";
@@ -1027,14 +1027,6 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
1027
1027
  };
1028
1028
  } | undefined;
1029
1029
  }, { readonly [K in "type"]: keyof Cases; }>) => any>(value: {
1030
- readonly type: "generation-queued";
1031
- readonly id: string;
1032
- readonly position?: number | undefined;
1033
- } | {
1034
- readonly type: "generation-progress";
1035
- readonly id: string;
1036
- readonly progress?: number | undefined;
1037
- } | {
1038
1030
  readonly type: "audio-delta";
1039
1031
  readonly chunk: Uint8Array<ArrayBufferLike>;
1040
1032
  } | {
@@ -1044,18 +1036,18 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
1044
1036
  readonly startSeconds: number;
1045
1037
  readonly endSeconds: number;
1046
1038
  }[];
1039
+ } | {
1040
+ readonly type: "generation-queued";
1041
+ readonly id: string;
1042
+ readonly position?: number | undefined;
1043
+ } | {
1044
+ readonly type: "generation-progress";
1045
+ readonly id: string;
1046
+ readonly progress?: number | undefined;
1047
1047
  } | {
1048
1048
  readonly type: "finish";
1049
1049
  readonly audio: Media.Asset;
1050
1050
  readonly usage?: {
1051
- readonly type: "tokens";
1052
- readonly input?: number | undefined;
1053
- readonly output?: number | undefined;
1054
- readonly total?: number | undefined;
1055
- readonly details?: {
1056
- readonly [x: string]: unknown;
1057
- } | undefined;
1058
- } | {
1059
1051
  readonly type: "seconds";
1060
1052
  readonly seconds: number;
1061
1053
  } | {
@@ -1067,6 +1059,14 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
1067
1059
  } | {
1068
1060
  readonly type: "compute";
1069
1061
  readonly seconds: number;
1062
+ } | {
1063
+ readonly type: "tokens";
1064
+ readonly input?: number | undefined;
1065
+ readonly output?: number | undefined;
1066
+ readonly total?: number | undefined;
1067
+ readonly details?: {
1068
+ readonly [x: string]: unknown;
1069
+ } | undefined;
1070
1070
  } | undefined;
1071
1071
  readonly notices?: readonly {
1072
1072
  readonly type: "filtered" | "moderated" | "other";
@@ -1160,14 +1160,6 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
1160
1160
  }>>>;
1161
1161
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
1162
1162
  }> 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<{
1163
- readonly type: "generation-queued";
1164
- readonly id: string;
1165
- readonly position?: number | undefined;
1166
- } | {
1167
- readonly type: "generation-progress";
1168
- readonly id: string;
1169
- readonly progress?: number | undefined;
1170
- } | {
1171
1163
  readonly type: "audio-delta";
1172
1164
  readonly chunk: Uint8Array<ArrayBufferLike>;
1173
1165
  } | {
@@ -1177,18 +1169,18 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
1177
1169
  readonly startSeconds: number;
1178
1170
  readonly endSeconds: number;
1179
1171
  }[];
1172
+ } | {
1173
+ readonly type: "generation-queued";
1174
+ readonly id: string;
1175
+ readonly position?: number | undefined;
1176
+ } | {
1177
+ readonly type: "generation-progress";
1178
+ readonly id: string;
1179
+ readonly progress?: number | undefined;
1180
1180
  } | {
1181
1181
  readonly type: "finish";
1182
1182
  readonly audio: Media.Asset;
1183
1183
  readonly usage?: {
1184
- readonly type: "tokens";
1185
- readonly input?: number | undefined;
1186
- readonly output?: number | undefined;
1187
- readonly total?: number | undefined;
1188
- readonly details?: {
1189
- readonly [x: string]: unknown;
1190
- } | undefined;
1191
- } | {
1192
1184
  readonly type: "seconds";
1193
1185
  readonly seconds: number;
1194
1186
  } | {
@@ -1200,6 +1192,14 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
1200
1192
  } | {
1201
1193
  readonly type: "compute";
1202
1194
  readonly seconds: number;
1195
+ } | {
1196
+ readonly type: "tokens";
1197
+ readonly input?: number | undefined;
1198
+ readonly output?: number | undefined;
1199
+ readonly total?: number | undefined;
1200
+ readonly details?: {
1201
+ readonly [x: string]: unknown;
1202
+ } | undefined;
1203
1203
  } | undefined;
1204
1204
  readonly notices?: readonly {
1205
1205
  readonly type: "filtered" | "moderated" | "other";
@@ -1216,14 +1216,6 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
1216
1216
  };
1217
1217
  } | undefined;
1218
1218
  }, { readonly [K in "type"]: keyof Cases; }>) => any>(cases: Cases, orElse: OrElse): (value: {
1219
- readonly type: "generation-queued";
1220
- readonly id: string;
1221
- readonly position?: number | undefined;
1222
- } | {
1223
- readonly type: "generation-progress";
1224
- readonly id: string;
1225
- readonly progress?: number | undefined;
1226
- } | {
1227
1219
  readonly type: "audio-delta";
1228
1220
  readonly chunk: Uint8Array<ArrayBufferLike>;
1229
1221
  } | {
@@ -1233,18 +1225,18 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
1233
1225
  readonly startSeconds: number;
1234
1226
  readonly endSeconds: number;
1235
1227
  }[];
1228
+ } | {
1229
+ readonly type: "generation-queued";
1230
+ readonly id: string;
1231
+ readonly position?: number | undefined;
1232
+ } | {
1233
+ readonly type: "generation-progress";
1234
+ readonly id: string;
1235
+ readonly progress?: number | undefined;
1236
1236
  } | {
1237
1237
  readonly type: "finish";
1238
1238
  readonly audio: Media.Asset;
1239
1239
  readonly usage?: {
1240
- readonly type: "tokens";
1241
- readonly input?: number | undefined;
1242
- readonly output?: number | undefined;
1243
- readonly total?: number | undefined;
1244
- readonly details?: {
1245
- readonly [x: string]: unknown;
1246
- } | undefined;
1247
- } | {
1248
1240
  readonly type: "seconds";
1249
1241
  readonly seconds: number;
1250
1242
  } | {
@@ -1256,6 +1248,14 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
1256
1248
  } | {
1257
1249
  readonly type: "compute";
1258
1250
  readonly seconds: number;
1251
+ } | {
1252
+ readonly type: "tokens";
1253
+ readonly input?: number | undefined;
1254
+ readonly output?: number | undefined;
1255
+ readonly total?: number | undefined;
1256
+ readonly details?: {
1257
+ readonly [x: string]: unknown;
1258
+ } | undefined;
1259
1259
  } | undefined;
1260
1260
  readonly notices?: readonly {
1261
1261
  readonly type: "filtered" | "moderated" | "other";
@@ -1301,14 +1301,6 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
1301
1301
  readonly type: "finish";
1302
1302
  readonly audio: Media.Asset;
1303
1303
  readonly usage?: {
1304
- readonly type: "tokens";
1305
- readonly input?: number | undefined;
1306
- readonly output?: number | undefined;
1307
- readonly total?: number | undefined;
1308
- readonly details?: {
1309
- readonly [x: string]: unknown;
1310
- } | undefined;
1311
- } | {
1312
1304
  readonly type: "seconds";
1313
1305
  readonly seconds: number;
1314
1306
  } | {
@@ -1320,6 +1312,14 @@ export declare const SpeechEvent: Schema.Union<readonly [Schema.Struct<{
1320
1312
  } | {
1321
1313
  readonly type: "compute";
1322
1314
  readonly seconds: number;
1315
+ } | {
1316
+ readonly type: "tokens";
1317
+ readonly input?: number | undefined;
1318
+ readonly output?: number | undefined;
1319
+ readonly total?: number | undefined;
1320
+ readonly details?: {
1321
+ readonly [x: string]: unknown;
1322
+ } | undefined;
1323
1323
  } | undefined;
1324
1324
  readonly notices?: readonly {
1325
1325
  readonly type: "filtered" | "moderated" | "other";
@@ -39,14 +39,6 @@ export declare const TranscriptionClient: {
39
39
  readonly language?: string | undefined;
40
40
  readonly durationSeconds?: number | undefined;
41
41
  readonly usage?: {
42
- readonly type: "tokens";
43
- readonly input?: number | undefined;
44
- readonly output?: number | undefined;
45
- readonly total?: number | undefined;
46
- readonly details?: {
47
- readonly [x: string]: unknown;
48
- } | undefined;
49
- } | {
50
42
  readonly type: "seconds";
51
43
  readonly seconds: number;
52
44
  } | {
@@ -58,6 +50,14 @@ export declare const TranscriptionClient: {
58
50
  } | {
59
51
  readonly type: "compute";
60
52
  readonly seconds: number;
53
+ } | {
54
+ readonly type: "tokens";
55
+ readonly input?: number | undefined;
56
+ readonly output?: number | undefined;
57
+ readonly total?: number | undefined;
58
+ readonly details?: {
59
+ readonly [x: string]: unknown;
60
+ } | undefined;
61
61
  } | undefined;
62
62
  readonly notices?: readonly {
63
63
  readonly type: "filtered" | "moderated" | "other";