@opencode/ai 2.1.2 → 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 (140) hide show
  1. package/dist/cache-policy.js +6 -5
  2. package/dist/experimental/evaluation.d.ts +7 -6
  3. package/dist/experimental/evaluation.js +3 -11
  4. package/dist/experimental/realtime.d.ts +59 -0
  5. package/dist/experimental/realtime.js +21 -13
  6. package/dist/experimental.d.ts +1 -1
  7. package/dist/generation.js +1 -1
  8. package/dist/image-client.d.ts +11 -9
  9. package/dist/image.d.ts +158 -150
  10. package/dist/image.js +2 -2
  11. package/dist/llm.d.ts +2 -4
  12. package/dist/llm.js +2 -2
  13. package/dist/media-model.d.ts +2 -2
  14. package/dist/media-model.js +1 -1
  15. package/dist/promise.d.ts +121 -121
  16. package/dist/promise.js +3 -5
  17. package/dist/protocols/alibaba-chat.d.ts +18 -18
  18. package/dist/protocols/alibaba-chat.js +3 -3
  19. package/dist/protocols/alibaba-messages.d.ts +12 -12
  20. package/dist/protocols/alibaba-messages.js +1 -1
  21. package/dist/protocols/alibaba-responses.d.ts +38 -38
  22. package/dist/protocols/anthropic-messages.d.ts +40 -44
  23. package/dist/protocols/anthropic-messages.js +13 -15
  24. package/dist/protocols/bedrock-converse.d.ts +36 -85
  25. package/dist/protocols/bedrock-converse.js +6 -6
  26. package/dist/protocols/bedrock-event-stream.d.ts +6 -1
  27. package/dist/protocols/bedrock-event-stream.js +9 -8
  28. package/dist/protocols/cartesia-speech.d.ts +32 -32
  29. package/dist/protocols/cohere-chat.d.ts +13 -10
  30. package/dist/protocols/cohere-chat.js +2 -2
  31. package/dist/protocols/deepgram-speech.d.ts +32 -32
  32. package/dist/protocols/elevenlabs-speech.d.ts +32 -32
  33. package/dist/protocols/gemini.d.ts +46 -36
  34. package/dist/protocols/gemini.js +12 -15
  35. package/dist/protocols/google-interactions.d.ts +14 -13
  36. package/dist/protocols/google-interactions.js +16 -11
  37. package/dist/protocols/google-speech.d.ts +32 -32
  38. package/dist/protocols/google-transcription.d.ts +32 -32
  39. package/dist/protocols/meta-messages.d.ts +23 -23
  40. package/dist/protocols/meta-responses.d.ts +84 -84
  41. package/dist/protocols/mistral-chat.d.ts +81 -78
  42. package/dist/protocols/mistral-chat.js +3 -5
  43. package/dist/protocols/open-responses-channel.js +47 -46
  44. package/dist/protocols/open-responses-continuation.d.ts +8 -2
  45. package/dist/protocols/open-responses-continuation.js +3 -1
  46. package/dist/protocols/open-responses.d.ts +419 -419
  47. package/dist/protocols/open-responses.js +11 -10
  48. package/dist/protocols/openai-chat.d.ts +68 -67
  49. package/dist/protocols/openai-chat.js +7 -8
  50. package/dist/protocols/openai-compatible-chat.d.ts +13 -14
  51. package/dist/protocols/openai-compatible-responses.d.ts +39 -40
  52. package/dist/protocols/openai-images.d.ts +32 -32
  53. package/dist/protocols/openai-responses.d.ts +253 -253
  54. package/dist/protocols/openai-responses.js +1 -1
  55. package/dist/protocols/openai-speech.d.ts +32 -32
  56. package/dist/protocols/openai-transcription.d.ts +32 -32
  57. package/dist/protocols/openai-transcription.js +12 -7
  58. package/dist/protocols/utils/open-responses-options.d.ts +8 -8
  59. package/dist/protocols/utils/open-responses-options.js +4 -6
  60. package/dist/protocols/utils/partial-json-options.d.ts +0 -1
  61. package/dist/protocols/utils/partial-json-options.js +0 -1
  62. package/dist/protocols/utils/partial-json.js +5 -4
  63. package/dist/protocols/utils/tool-schema.d.ts +0 -3
  64. package/dist/protocols/utils/tool-schema.js +0 -4
  65. package/dist/protocols/utils/tool-stream.d.ts +1 -1
  66. package/dist/protocols/venice-chat.d.ts +52 -53
  67. package/dist/protocols/venice-chat.js +6 -5
  68. package/dist/protocols/xai-images.js +3 -4
  69. package/dist/protocols/xai-responses.d.ts +81 -81
  70. package/dist/protocols/zai-chat.d.ts +33 -30
  71. package/dist/protocols/zai-chat.js +8 -3
  72. package/dist/protocols/zai-messages.d.ts +21 -19
  73. package/dist/protocols/zai-messages.js +3 -2
  74. package/dist/provider-error.js +8 -7
  75. package/dist/providers/alibaba.d.ts +74 -74
  76. package/dist/providers/amazon-bedrock-mantle.d.ts +202 -202
  77. package/dist/providers/amazon-bedrock.d.ts +16 -13
  78. package/dist/providers/anthropic-compatible.d.ts +13 -13
  79. package/dist/providers/anthropic.d.ts +13 -13
  80. package/dist/providers/azure.d.ts +112 -112
  81. package/dist/providers/baseten.d.ts +24 -24
  82. package/dist/providers/cerebras.d.ts +24 -24
  83. package/dist/providers/cloudflare-ai-gateway.d.ts +237 -234
  84. package/dist/providers/cloudflare-ai-gateway.js +3 -6
  85. package/dist/providers/cloudflare-workers-ai.d.ts +24 -24
  86. package/dist/providers/cohere.d.ts +78 -74
  87. package/dist/providers/deepinfra.d.ts +24 -24
  88. package/dist/providers/deepseek.d.ts +24 -24
  89. package/dist/providers/digitalocean.d.ts +36 -36
  90. package/dist/providers/fireworks.d.ts +24 -24
  91. package/dist/providers/google-vertex-chat.d.ts +12 -12
  92. package/dist/providers/google-vertex-interactions.d.ts +3 -3
  93. package/dist/providers/google-vertex-messages.d.ts +20 -20
  94. package/dist/providers/google-vertex-mistral.d.ts +14 -14
  95. package/dist/providers/google-vertex-responses.d.ts +38 -38
  96. package/dist/providers/google-vertex.d.ts +17 -17
  97. package/dist/providers/google-vertex.js +2 -2
  98. package/dist/providers/google.d.ts +79 -79
  99. package/dist/providers/groq.d.ts +24 -24
  100. package/dist/providers/meta.d.ts +189 -189
  101. package/dist/providers/minimax.d.ts +202 -202
  102. package/dist/providers/mistral.d.ts +28 -28
  103. package/dist/providers/moonshot.d.ts +202 -202
  104. package/dist/providers/open-responses-options.d.ts +0 -1
  105. package/dist/providers/open-responses-options.js +1 -1
  106. package/dist/providers/openai-compatible-responses.d.ts +38 -38
  107. package/dist/providers/openai-compatible.d.ts +12 -12
  108. package/dist/providers/openai-compatible.js +1 -1
  109. package/dist/providers/openai-options.d.ts +3 -4
  110. package/dist/providers/openai-options.js +0 -1
  111. package/dist/providers/openai.d.ts +103 -103
  112. package/dist/providers/openrouter.d.ts +171 -112
  113. package/dist/providers/openrouter.js +40 -33
  114. package/dist/providers/togetherai.d.ts +24 -24
  115. package/dist/providers/venice.d.ts +195 -20
  116. package/dist/providers/xai.d.ts +12 -12
  117. package/dist/providers/zai-coding-plan.d.ts +152 -72
  118. package/dist/providers/zai.d.ts +84 -19
  119. package/dist/route/auth-options.d.ts +0 -3
  120. package/dist/route/auth.d.ts +0 -2
  121. package/dist/route/auth.js +0 -2
  122. package/dist/route/client.d.ts +0 -218
  123. package/dist/route/client.js +3 -7
  124. package/dist/route/executor-service.js +1 -1
  125. package/dist/route/transport/http.js +5 -8
  126. package/dist/schema/errors.d.ts +1 -1
  127. package/dist/schema/errors.js +1 -1
  128. package/dist/schema/messages.js +4 -7
  129. package/dist/speech-client.d.ts +11 -9
  130. package/dist/speech.d.ts +158 -150
  131. package/dist/speech.js +2 -2
  132. package/dist/transcription-client.d.ts +11 -9
  133. package/dist/transcription.d.ts +158 -150
  134. package/dist/transcription.js +2 -2
  135. package/dist/video-client.d.ts +11 -9
  136. package/dist/video.d.ts +124 -116
  137. package/dist/video.js +2 -2
  138. package/package.json +7 -6
  139. package/dist/protocols/utils/openai-options.d.ts +0 -16
  140. package/dist/protocols/utils/openai-options.js +0 -15
@@ -14,11 +14,19 @@ export declare class TranscriptionModel<Options extends TranscriptionOptions = T
14
14
  static fromRoute<Options extends TranscriptionOptions, Frame, State>(route: MediaModel.StreamRouteInput<TranscriptionRequestFor<Options>, TranscriptionEvent, Frame, State>, input: MediaRoute.ModelInput): TranscriptionModel<Options>;
15
15
  static fromRoute<Options extends TranscriptionOptions, Token>(route: MediaModel.QueuedRouteInput<TranscriptionRequestFor<Options>, TranscriptionResponse, Token>, input: MediaRoute.ModelInput): TranscriptionModel<Options>;
16
16
  }
17
- export declare const TranscriptionModelSchema: Schema.declare<TranscriptionModel<MediaModel.Options>, TranscriptionModel<MediaModel.Options>>;
17
+ export declare const TranscriptionModelSchema: Schema.declare<TranscriptionModel<{
18
+ readonly [x: string]: unknown;
19
+ }>, TranscriptionModel<{
20
+ readonly [x: string]: unknown;
21
+ }>>;
18
22
  export declare const TranscriptionTimestamps: Schema.Literals<readonly ["none", "segment", "word"]>;
19
23
  export type TranscriptionTimestamps = Schema.Schema.Type<typeof TranscriptionTimestamps>;
20
24
  declare const TranscriptionRequest_base: Schema.Class<TranscriptionRequest, Schema.Struct<{
21
- readonly model: Schema.declare<TranscriptionModel<MediaModel.Options>, TranscriptionModel<MediaModel.Options>>;
25
+ readonly model: Schema.declare<TranscriptionModel<{
26
+ readonly [x: string]: unknown;
27
+ }>, TranscriptionModel<{
28
+ readonly [x: string]: unknown;
29
+ }>>;
22
30
  readonly audio: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
23
31
  readonly source: Schema.Union<readonly [Schema.Struct<{
24
32
  readonly type: Schema.Literal<"bytes">;
@@ -388,14 +396,6 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
388
396
  }>;
389
397
  };
390
398
  readonly isAnyOf: <const Keys>(keys: readonly Keys[]) => (value: {
391
- readonly type: "generation-queued";
392
- readonly id: string;
393
- readonly position?: number | undefined;
394
- } | {
395
- readonly type: "generation-progress";
396
- readonly id: string;
397
- readonly progress?: number | undefined;
398
- } | {
399
399
  readonly type: "text-delta";
400
400
  readonly delta: string;
401
401
  } | {
@@ -406,6 +406,14 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
406
406
  readonly endSeconds: number;
407
407
  readonly speaker?: string | undefined;
408
408
  };
409
+ } | {
410
+ readonly type: "generation-queued";
411
+ readonly id: string;
412
+ readonly position?: number | undefined;
413
+ } | {
414
+ readonly type: "generation-progress";
415
+ readonly id: string;
416
+ readonly progress?: number | undefined;
409
417
  } | {
410
418
  readonly text: string;
411
419
  readonly segments?: readonly {
@@ -424,14 +432,6 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
424
432
  readonly language?: string | undefined;
425
433
  readonly durationSeconds?: number | undefined;
426
434
  readonly usage?: {
427
- readonly type: "tokens";
428
- readonly input?: number | undefined;
429
- readonly output?: number | undefined;
430
- readonly total?: number | undefined;
431
- readonly details?: {
432
- readonly [x: string]: unknown;
433
- } | undefined;
434
- } | {
435
435
  readonly type: "seconds";
436
436
  readonly seconds: number;
437
437
  } | {
@@ -443,6 +443,14 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
443
443
  } | {
444
444
  readonly type: "compute";
445
445
  readonly seconds: number;
446
+ } | {
447
+ readonly type: "tokens";
448
+ readonly input?: number | undefined;
449
+ readonly output?: number | undefined;
450
+ readonly total?: number | undefined;
451
+ readonly details?: {
452
+ readonly [x: string]: unknown;
453
+ } | undefined;
446
454
  } | undefined;
447
455
  readonly notices?: readonly {
448
456
  readonly type: "filtered" | "moderated" | "other";
@@ -460,18 +468,6 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
460
468
  } | undefined;
461
469
  readonly type: "finish";
462
470
  }) => value is Extract<{
463
- readonly type: "generation-queued";
464
- readonly id: string;
465
- readonly position?: number | undefined;
466
- }, {
467
- readonly type: Keys;
468
- }> | Extract<{
469
- readonly type: "generation-progress";
470
- readonly id: string;
471
- readonly progress?: number | undefined;
472
- }, {
473
- readonly type: Keys;
474
- }> | Extract<{
475
471
  readonly type: "text-delta";
476
472
  readonly delta: string;
477
473
  }, {
@@ -486,6 +482,18 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
486
482
  };
487
483
  }, {
488
484
  readonly type: Keys;
485
+ }> | Extract<{
486
+ readonly type: "generation-queued";
487
+ readonly id: string;
488
+ readonly position?: number | undefined;
489
+ }, {
490
+ readonly type: Keys;
491
+ }> | Extract<{
492
+ readonly type: "generation-progress";
493
+ readonly id: string;
494
+ readonly progress?: number | undefined;
495
+ }, {
496
+ readonly type: Keys;
489
497
  }> | Extract<{
490
498
  readonly text: string;
491
499
  readonly segments?: readonly {
@@ -504,14 +512,6 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
504
512
  readonly language?: string | undefined;
505
513
  readonly durationSeconds?: number | undefined;
506
514
  readonly usage?: {
507
- readonly type: "tokens";
508
- readonly input?: number | undefined;
509
- readonly output?: number | undefined;
510
- readonly total?: number | undefined;
511
- readonly details?: {
512
- readonly [x: string]: unknown;
513
- } | undefined;
514
- } | {
515
515
  readonly type: "seconds";
516
516
  readonly seconds: number;
517
517
  } | {
@@ -523,6 +523,14 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
523
523
  } | {
524
524
  readonly type: "compute";
525
525
  readonly seconds: number;
526
+ } | {
527
+ readonly type: "tokens";
528
+ readonly input?: number | undefined;
529
+ readonly output?: number | undefined;
530
+ readonly total?: number | undefined;
531
+ readonly details?: {
532
+ readonly [x: string]: unknown;
533
+ } | undefined;
526
534
  } | undefined;
527
535
  readonly notices?: readonly {
528
536
  readonly type: "filtered" | "moderated" | "other";
@@ -561,14 +569,6 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
561
569
  readonly language?: string | undefined;
562
570
  readonly durationSeconds?: number | undefined;
563
571
  readonly usage?: {
564
- readonly type: "tokens";
565
- readonly input?: number | undefined;
566
- readonly output?: number | undefined;
567
- readonly total?: number | undefined;
568
- readonly details?: {
569
- readonly [x: string]: unknown;
570
- } | undefined;
571
- } | {
572
572
  readonly type: "seconds";
573
573
  readonly seconds: number;
574
574
  } | {
@@ -580,6 +580,14 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
580
580
  } | {
581
581
  readonly type: "compute";
582
582
  readonly seconds: number;
583
+ } | {
584
+ readonly type: "tokens";
585
+ readonly input?: number | undefined;
586
+ readonly output?: number | undefined;
587
+ readonly total?: number | undefined;
588
+ readonly details?: {
589
+ readonly [x: string]: unknown;
590
+ } | undefined;
583
591
  } | undefined;
584
592
  readonly notices?: readonly {
585
593
  readonly type: "filtered" | "moderated" | "other";
@@ -685,14 +693,6 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
685
693
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
686
694
  readonly type: Schema.tag<"finish">;
687
695
  }> as M["Type"]["type"]]: (value: M["Type"]) => any; }>(value: {
688
- readonly type: "generation-queued";
689
- readonly id: string;
690
- readonly position?: number | undefined;
691
- } | {
692
- readonly type: "generation-progress";
693
- readonly id: string;
694
- readonly progress?: number | undefined;
695
- } | {
696
696
  readonly type: "text-delta";
697
697
  readonly delta: string;
698
698
  } | {
@@ -703,6 +703,14 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
703
703
  readonly endSeconds: number;
704
704
  readonly speaker?: string | undefined;
705
705
  };
706
+ } | {
707
+ readonly type: "generation-queued";
708
+ readonly id: string;
709
+ readonly position?: number | undefined;
710
+ } | {
711
+ readonly type: "generation-progress";
712
+ readonly id: string;
713
+ readonly progress?: number | undefined;
706
714
  } | {
707
715
  readonly text: string;
708
716
  readonly segments?: readonly {
@@ -721,14 +729,6 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
721
729
  readonly language?: string | undefined;
722
730
  readonly durationSeconds?: number | undefined;
723
731
  readonly usage?: {
724
- readonly type: "tokens";
725
- readonly input?: number | undefined;
726
- readonly output?: number | undefined;
727
- readonly total?: number | undefined;
728
- readonly details?: {
729
- readonly [x: string]: unknown;
730
- } | undefined;
731
- } | {
732
732
  readonly type: "seconds";
733
733
  readonly seconds: number;
734
734
  } | {
@@ -740,6 +740,14 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
740
740
  } | {
741
741
  readonly type: "compute";
742
742
  readonly seconds: number;
743
+ } | {
744
+ readonly type: "tokens";
745
+ readonly input?: number | undefined;
746
+ readonly output?: number | undefined;
747
+ readonly total?: number | undefined;
748
+ readonly details?: {
749
+ readonly [x: string]: unknown;
750
+ } | undefined;
743
751
  } | undefined;
744
752
  readonly notices?: readonly {
745
753
  readonly type: "filtered" | "moderated" | "other";
@@ -820,14 +828,6 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
820
828
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
821
829
  readonly type: Schema.tag<"finish">;
822
830
  }> as M["Type"]["type"]]: (value: M["Type"]) => any; }>(cases: Cases): (value: {
823
- readonly type: "generation-queued";
824
- readonly id: string;
825
- readonly position?: number | undefined;
826
- } | {
827
- readonly type: "generation-progress";
828
- readonly id: string;
829
- readonly progress?: number | undefined;
830
- } | {
831
831
  readonly type: "text-delta";
832
832
  readonly delta: string;
833
833
  } | {
@@ -838,6 +838,14 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
838
838
  readonly endSeconds: number;
839
839
  readonly speaker?: string | undefined;
840
840
  };
841
+ } | {
842
+ readonly type: "generation-queued";
843
+ readonly id: string;
844
+ readonly position?: number | undefined;
845
+ } | {
846
+ readonly type: "generation-progress";
847
+ readonly id: string;
848
+ readonly progress?: number | undefined;
841
849
  } | {
842
850
  readonly text: string;
843
851
  readonly segments?: readonly {
@@ -856,14 +864,6 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
856
864
  readonly language?: string | undefined;
857
865
  readonly durationSeconds?: number | undefined;
858
866
  readonly usage?: {
859
- readonly type: "tokens";
860
- readonly input?: number | undefined;
861
- readonly output?: number | undefined;
862
- readonly total?: number | undefined;
863
- readonly details?: {
864
- readonly [x: string]: unknown;
865
- } | undefined;
866
- } | {
867
867
  readonly type: "seconds";
868
868
  readonly seconds: number;
869
869
  } | {
@@ -875,6 +875,14 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
875
875
  } | {
876
876
  readonly type: "compute";
877
877
  readonly seconds: number;
878
+ } | {
879
+ readonly type: "tokens";
880
+ readonly input?: number | undefined;
881
+ readonly output?: number | undefined;
882
+ readonly total?: number | undefined;
883
+ readonly details?: {
884
+ readonly [x: string]: unknown;
885
+ } | undefined;
878
886
  } | undefined;
879
887
  readonly notices?: readonly {
880
888
  readonly type: "filtered" | "moderated" | "other";
@@ -957,14 +965,6 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
957
965
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
958
966
  readonly type: Schema.tag<"finish">;
959
967
  }> 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<{
960
- readonly type: "generation-queued";
961
- readonly id: string;
962
- readonly position?: number | undefined;
963
- } | {
964
- readonly type: "generation-progress";
965
- readonly id: string;
966
- readonly progress?: number | undefined;
967
- } | {
968
968
  readonly type: "text-delta";
969
969
  readonly delta: string;
970
970
  } | {
@@ -975,6 +975,14 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
975
975
  readonly endSeconds: number;
976
976
  readonly speaker?: string | undefined;
977
977
  };
978
+ } | {
979
+ readonly type: "generation-queued";
980
+ readonly id: string;
981
+ readonly position?: number | undefined;
982
+ } | {
983
+ readonly type: "generation-progress";
984
+ readonly id: string;
985
+ readonly progress?: number | undefined;
978
986
  } | {
979
987
  readonly text: string;
980
988
  readonly segments?: readonly {
@@ -993,14 +1001,6 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
993
1001
  readonly language?: string | undefined;
994
1002
  readonly durationSeconds?: number | undefined;
995
1003
  readonly usage?: {
996
- readonly type: "tokens";
997
- readonly input?: number | undefined;
998
- readonly output?: number | undefined;
999
- readonly total?: number | undefined;
1000
- readonly details?: {
1001
- readonly [x: string]: unknown;
1002
- } | undefined;
1003
- } | {
1004
1004
  readonly type: "seconds";
1005
1005
  readonly seconds: number;
1006
1006
  } | {
@@ -1012,6 +1012,14 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
1012
1012
  } | {
1013
1013
  readonly type: "compute";
1014
1014
  readonly seconds: number;
1015
+ } | {
1016
+ readonly type: "tokens";
1017
+ readonly input?: number | undefined;
1018
+ readonly output?: number | undefined;
1019
+ readonly total?: number | undefined;
1020
+ readonly details?: {
1021
+ readonly [x: string]: unknown;
1022
+ } | undefined;
1015
1023
  } | undefined;
1016
1024
  readonly notices?: readonly {
1017
1025
  readonly type: "filtered" | "moderated" | "other";
@@ -1029,14 +1037,6 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
1029
1037
  } | undefined;
1030
1038
  readonly type: "finish";
1031
1039
  }, { readonly [K in "type"]: keyof Cases; }>) => any>(value: {
1032
- readonly type: "generation-queued";
1033
- readonly id: string;
1034
- readonly position?: number | undefined;
1035
- } | {
1036
- readonly type: "generation-progress";
1037
- readonly id: string;
1038
- readonly progress?: number | undefined;
1039
- } | {
1040
1040
  readonly type: "text-delta";
1041
1041
  readonly delta: string;
1042
1042
  } | {
@@ -1047,6 +1047,14 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
1047
1047
  readonly endSeconds: number;
1048
1048
  readonly speaker?: string | undefined;
1049
1049
  };
1050
+ } | {
1051
+ readonly type: "generation-queued";
1052
+ readonly id: string;
1053
+ readonly position?: number | undefined;
1054
+ } | {
1055
+ readonly type: "generation-progress";
1056
+ readonly id: string;
1057
+ readonly progress?: number | undefined;
1050
1058
  } | {
1051
1059
  readonly text: string;
1052
1060
  readonly segments?: readonly {
@@ -1065,14 +1073,6 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
1065
1073
  readonly language?: string | undefined;
1066
1074
  readonly durationSeconds?: number | undefined;
1067
1075
  readonly usage?: {
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
- } | {
1076
1076
  readonly type: "seconds";
1077
1077
  readonly seconds: number;
1078
1078
  } | {
@@ -1084,6 +1084,14 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
1084
1084
  } | {
1085
1085
  readonly type: "compute";
1086
1086
  readonly seconds: number;
1087
+ } | {
1088
+ readonly type: "tokens";
1089
+ readonly input?: number | undefined;
1090
+ readonly output?: number | undefined;
1091
+ readonly total?: number | undefined;
1092
+ readonly details?: {
1093
+ readonly [x: string]: unknown;
1094
+ } | undefined;
1087
1095
  } | undefined;
1088
1096
  readonly notices?: readonly {
1089
1097
  readonly type: "filtered" | "moderated" | "other";
@@ -1164,14 +1172,6 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
1164
1172
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
1165
1173
  readonly type: Schema.tag<"finish">;
1166
1174
  }> 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<{
1167
- readonly type: "generation-queued";
1168
- readonly id: string;
1169
- readonly position?: number | undefined;
1170
- } | {
1171
- readonly type: "generation-progress";
1172
- readonly id: string;
1173
- readonly progress?: number | undefined;
1174
- } | {
1175
1175
  readonly type: "text-delta";
1176
1176
  readonly delta: string;
1177
1177
  } | {
@@ -1182,6 +1182,14 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
1182
1182
  readonly endSeconds: number;
1183
1183
  readonly speaker?: string | undefined;
1184
1184
  };
1185
+ } | {
1186
+ readonly type: "generation-queued";
1187
+ readonly id: string;
1188
+ readonly position?: number | undefined;
1189
+ } | {
1190
+ readonly type: "generation-progress";
1191
+ readonly id: string;
1192
+ readonly progress?: number | undefined;
1185
1193
  } | {
1186
1194
  readonly text: string;
1187
1195
  readonly segments?: readonly {
@@ -1200,14 +1208,6 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
1200
1208
  readonly language?: string | undefined;
1201
1209
  readonly durationSeconds?: number | undefined;
1202
1210
  readonly usage?: {
1203
- readonly type: "tokens";
1204
- readonly input?: number | undefined;
1205
- readonly output?: number | undefined;
1206
- readonly total?: number | undefined;
1207
- readonly details?: {
1208
- readonly [x: string]: unknown;
1209
- } | undefined;
1210
- } | {
1211
1211
  readonly type: "seconds";
1212
1212
  readonly seconds: number;
1213
1213
  } | {
@@ -1219,6 +1219,14 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
1219
1219
  } | {
1220
1220
  readonly type: "compute";
1221
1221
  readonly seconds: number;
1222
+ } | {
1223
+ readonly type: "tokens";
1224
+ readonly input?: number | undefined;
1225
+ readonly output?: number | undefined;
1226
+ readonly total?: number | undefined;
1227
+ readonly details?: {
1228
+ readonly [x: string]: unknown;
1229
+ } | undefined;
1222
1230
  } | undefined;
1223
1231
  readonly notices?: readonly {
1224
1232
  readonly type: "filtered" | "moderated" | "other";
@@ -1236,14 +1244,6 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
1236
1244
  } | undefined;
1237
1245
  readonly type: "finish";
1238
1246
  }, { readonly [K in "type"]: keyof Cases; }>) => any>(cases: Cases, orElse: OrElse): (value: {
1239
- readonly type: "generation-queued";
1240
- readonly id: string;
1241
- readonly position?: number | undefined;
1242
- } | {
1243
- readonly type: "generation-progress";
1244
- readonly id: string;
1245
- readonly progress?: number | undefined;
1246
- } | {
1247
1247
  readonly type: "text-delta";
1248
1248
  readonly delta: string;
1249
1249
  } | {
@@ -1254,6 +1254,14 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
1254
1254
  readonly endSeconds: number;
1255
1255
  readonly speaker?: string | undefined;
1256
1256
  };
1257
+ } | {
1258
+ readonly type: "generation-queued";
1259
+ readonly id: string;
1260
+ readonly position?: number | undefined;
1261
+ } | {
1262
+ readonly type: "generation-progress";
1263
+ readonly id: string;
1264
+ readonly progress?: number | undefined;
1257
1265
  } | {
1258
1266
  readonly text: string;
1259
1267
  readonly segments?: readonly {
@@ -1272,14 +1280,6 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
1272
1280
  readonly language?: string | undefined;
1273
1281
  readonly durationSeconds?: number | undefined;
1274
1282
  readonly usage?: {
1275
- readonly type: "tokens";
1276
- readonly input?: number | undefined;
1277
- readonly output?: number | undefined;
1278
- readonly total?: number | undefined;
1279
- readonly details?: {
1280
- readonly [x: string]: unknown;
1281
- } | undefined;
1282
- } | {
1283
1283
  readonly type: "seconds";
1284
1284
  readonly seconds: number;
1285
1285
  } | {
@@ -1291,6 +1291,14 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
1291
1291
  } | {
1292
1292
  readonly type: "compute";
1293
1293
  readonly seconds: number;
1294
+ } | {
1295
+ readonly type: "tokens";
1296
+ readonly input?: number | undefined;
1297
+ readonly output?: number | undefined;
1298
+ readonly total?: number | undefined;
1299
+ readonly details?: {
1300
+ readonly [x: string]: unknown;
1301
+ } | undefined;
1294
1302
  } | undefined;
1295
1303
  readonly notices?: readonly {
1296
1304
  readonly type: "filtered" | "moderated" | "other";
@@ -1352,14 +1360,6 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
1352
1360
  readonly language?: string | undefined;
1353
1361
  readonly durationSeconds?: number | undefined;
1354
1362
  readonly usage?: {
1355
- readonly type: "tokens";
1356
- readonly input?: number | undefined;
1357
- readonly output?: number | undefined;
1358
- readonly total?: number | undefined;
1359
- readonly details?: {
1360
- readonly [x: string]: unknown;
1361
- } | undefined;
1362
- } | {
1363
1363
  readonly type: "seconds";
1364
1364
  readonly seconds: number;
1365
1365
  } | {
@@ -1371,6 +1371,14 @@ export declare const TranscriptionEvent: Schema.Union<readonly [Schema.Struct<{
1371
1371
  } | {
1372
1372
  readonly type: "compute";
1373
1373
  readonly seconds: number;
1374
+ } | {
1375
+ readonly type: "tokens";
1376
+ readonly input?: number | undefined;
1377
+ readonly output?: number | undefined;
1378
+ readonly total?: number | undefined;
1379
+ readonly details?: {
1380
+ readonly [x: string]: unknown;
1381
+ } | undefined;
1374
1382
  } | undefined;
1375
1383
  readonly notices?: readonly {
1376
1384
  readonly type: "filtered" | "moderated" | "other";
@@ -3,7 +3,7 @@ import { Generation, ProgressEvent, QueuedEvent } from "./generation.js";
3
3
  import { Media } from "./media.js";
4
4
  import { MediaModel, composeRoute, tryRequest } from "./media-model.js";
5
5
  import { MediaRoute } from "./route/media.js";
6
- import { AIError, HttpOptions, MediaUsage, ProviderMetadata } from "./schema/index.js";
6
+ import { AIError, HttpOptions, MediaUsage, ProviderMetadata, ProviderOptions } from "./schema/index.js";
7
7
  import { TranscriptionClient, Service } from "./transcription-client.js";
8
8
  export class TranscriptionModel extends MediaModel {
9
9
  static fromRoute(route, input) {
@@ -29,7 +29,7 @@ export class TranscriptionRequest extends Schema.Class("Transcription.Request")(
29
29
  timestamps: Schema.optional(TranscriptionTimestamps),
30
30
  diarize: Schema.optional(Schema.Boolean),
31
31
  speakers: Schema.optional(Schema.Int),
32
- providerOptions: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
32
+ providerOptions: Schema.optional(ProviderOptions),
33
33
  http: Schema.optional(HttpOptions),
34
34
  }) {
35
35
  }
@@ -17,14 +17,6 @@ export declare const VideoClient: {
17
17
  } | {
18
18
  readonly type: "finish";
19
19
  readonly usage?: {
20
- readonly type: "tokens";
21
- readonly input?: number | undefined;
22
- readonly output?: number | undefined;
23
- readonly total?: number | undefined;
24
- readonly details?: {
25
- readonly [x: string]: unknown;
26
- } | undefined;
27
- } | {
28
20
  readonly type: "seconds";
29
21
  readonly seconds: number;
30
22
  } | {
@@ -36,6 +28,14 @@ export declare const VideoClient: {
36
28
  } | {
37
29
  readonly type: "compute";
38
30
  readonly seconds: number;
31
+ } | {
32
+ readonly type: "tokens";
33
+ readonly input?: number | undefined;
34
+ readonly output?: number | undefined;
35
+ readonly total?: number | undefined;
36
+ readonly details?: {
37
+ readonly [x: string]: unknown;
38
+ } | undefined;
39
39
  } | undefined;
40
40
  readonly notices?: readonly {
41
41
  readonly type: "filtered" | "moderated" | "other";
@@ -53,7 +53,9 @@ export declare const VideoClient: {
53
53
  } | undefined;
54
54
  } | import("./generation.js").Observation, import("./index.js").AIError, VideoClientService>;
55
55
  readonly start: (request: VideoRequestFor) => import("effect/Effect").Effect<import("./generation.js").Generation<VideoResponse>, import("./index.js").AIError, VideoClientService>;
56
- readonly resume: (model: import("./video.js").VideoModel<import("./media-model.js").MediaModel.Options>, token: unknown) => import("effect/Effect").Effect<import("./generation.js").Generation<VideoResponse>, import("./index.js").AIError, VideoClientService>;
56
+ readonly resume: (model: import("./video.js").VideoModel<{
57
+ readonly [x: string]: unknown;
58
+ }>, token: unknown) => import("effect/Effect").Effect<import("./generation.js").Generation<VideoResponse>, import("./index.js").AIError, VideoClientService>;
57
59
  readonly Service: typeof VideoClientService;
58
60
  };
59
61
  export {};