@opencode/ai 0.0.0-dev-329 → 0.0.0-dev-347
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -71
- package/dist/effect.d.ts +0 -12
- package/dist/effect.js +0 -9
- package/dist/experimental/testing.d.ts +3 -0
- package/dist/experimental/testing.js +3 -0
- package/dist/experimental.d.ts +12 -0
- package/dist/experimental.js +9 -0
- package/dist/index.d.ts +323 -316
- package/dist/index.js +23 -19
- package/dist/llm.js +16 -17
- package/dist/route/client.d.ts +3 -0
- package/dist/route/client.js +5 -4
- package/dist/schema/errors.d.ts +6 -0
- package/dist/schema/errors.js +8 -0
- package/dist/schema/events.d.ts +2 -0
- package/dist/schema/events.js +4 -0
- package/dist/testing.d.ts +0 -3
- package/dist/testing.js +3 -11
- package/package.json +7 -3
package/dist/index.d.ts
CHANGED
|
@@ -561,178 +561,181 @@ export declare const make: <R = never>(options?: Options<R>) => {
|
|
|
561
561
|
start: <const Model extends ImageModel>(input: ImageRequestInput<Model> | ImageRequest, options?: RunOptions) => Promise<GenerationHandle<import("./image.js").ImageResponse>>;
|
|
562
562
|
resume: (model: ImageModel, token: unknown, options?: RunOptions) => Promise<GenerationHandle<import("./image.js").ImageResponse>>;
|
|
563
563
|
};
|
|
564
|
-
|
|
565
|
-
request: typeof import("./
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
readonly position?: number | undefined;
|
|
577
|
-
} | {
|
|
578
|
-
readonly type: "generation-progress";
|
|
579
|
-
readonly id: string;
|
|
580
|
-
readonly progress?: number | undefined;
|
|
581
|
-
} | {
|
|
582
|
-
readonly type: "finish";
|
|
583
|
-
readonly usage?: {
|
|
584
|
-
readonly type: "seconds";
|
|
585
|
-
readonly seconds: number;
|
|
564
|
+
decision: {
|
|
565
|
+
request: typeof import("./decision.js").request;
|
|
566
|
+
generate: <const Model extends DecisionModel, const Questions extends DecisionQuestions>(input: DecisionRequestInput<Model, Questions>, options?: RunOptions) => Promise<import("./decision.js").DecisionResponseFor<Questions>>;
|
|
567
|
+
};
|
|
568
|
+
/** Experimental: may change without compatibility guarantees. */
|
|
569
|
+
experimental: {
|
|
570
|
+
speech: {
|
|
571
|
+
request: typeof import("./speech.js").request;
|
|
572
|
+
generate: <const Model extends SpeechModel>(input: SpeechRequestInput<Model> | SpeechRequest, options?: RunOptions) => Promise<import("./speech.js").SpeechResponse>;
|
|
573
|
+
stream: <const Model extends SpeechModel>(input: SpeechRequestInput<Model> | SpeechRequest, options?: RunOptions) => AsyncIterable<{
|
|
574
|
+
readonly type: "audio-delta";
|
|
575
|
+
readonly chunk: Uint8Array<ArrayBufferLike>;
|
|
586
576
|
} | {
|
|
587
|
-
readonly type: "
|
|
588
|
-
readonly
|
|
577
|
+
readonly type: "timestamps";
|
|
578
|
+
readonly items: readonly {
|
|
579
|
+
readonly text: string;
|
|
580
|
+
readonly startSeconds: number;
|
|
581
|
+
readonly endSeconds: number;
|
|
582
|
+
}[];
|
|
589
583
|
} | {
|
|
590
|
-
readonly type: "
|
|
591
|
-
readonly
|
|
584
|
+
readonly type: "generation-queued";
|
|
585
|
+
readonly id: string;
|
|
586
|
+
readonly position?: number | undefined;
|
|
592
587
|
} | {
|
|
593
|
-
readonly type: "
|
|
594
|
-
readonly
|
|
588
|
+
readonly type: "generation-progress";
|
|
589
|
+
readonly id: string;
|
|
590
|
+
readonly progress?: number | undefined;
|
|
595
591
|
} | {
|
|
596
|
-
readonly type: "
|
|
597
|
-
readonly
|
|
598
|
-
readonly
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
592
|
+
readonly type: "finish";
|
|
593
|
+
readonly audio: Media.Asset;
|
|
594
|
+
readonly usage?: {
|
|
595
|
+
readonly type: "seconds";
|
|
596
|
+
readonly seconds: number;
|
|
597
|
+
} | {
|
|
598
|
+
readonly type: "characters";
|
|
599
|
+
readonly characters: number;
|
|
600
|
+
} | {
|
|
601
|
+
readonly type: "credits";
|
|
602
|
+
readonly credits: number;
|
|
603
|
+
} | {
|
|
604
|
+
readonly type: "compute";
|
|
605
|
+
readonly seconds: number;
|
|
606
|
+
} | {
|
|
607
|
+
readonly type: "tokens";
|
|
608
|
+
readonly input?: number | undefined;
|
|
609
|
+
readonly output?: number | undefined;
|
|
610
|
+
readonly total?: number | undefined;
|
|
611
|
+
readonly details?: {
|
|
612
|
+
readonly [x: string]: unknown;
|
|
613
|
+
} | undefined;
|
|
602
614
|
} | undefined;
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
};
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
readonly chunk: Uint8Array<ArrayBufferLike>;
|
|
617
|
-
} | {
|
|
618
|
-
readonly type: "timestamps";
|
|
619
|
-
readonly items: readonly {
|
|
620
|
-
readonly text: string;
|
|
621
|
-
readonly startSeconds: number;
|
|
622
|
-
readonly endSeconds: number;
|
|
623
|
-
}[];
|
|
624
|
-
} | {
|
|
625
|
-
readonly type: "generation-queued";
|
|
626
|
-
readonly id: string;
|
|
627
|
-
readonly position?: number | undefined;
|
|
628
|
-
} | {
|
|
629
|
-
readonly type: "generation-progress";
|
|
630
|
-
readonly id: string;
|
|
631
|
-
readonly progress?: number | undefined;
|
|
632
|
-
} | {
|
|
633
|
-
readonly type: "finish";
|
|
634
|
-
readonly audio: Media.Asset;
|
|
635
|
-
readonly usage?: {
|
|
636
|
-
readonly type: "seconds";
|
|
637
|
-
readonly seconds: number;
|
|
615
|
+
readonly providerMetadata?: {
|
|
616
|
+
readonly [x: string]: {
|
|
617
|
+
readonly [x: string]: unknown;
|
|
618
|
+
};
|
|
619
|
+
} | undefined;
|
|
620
|
+
}>;
|
|
621
|
+
};
|
|
622
|
+
transcription: {
|
|
623
|
+
request: typeof import("./transcription.js").request;
|
|
624
|
+
generate: <const Model extends TranscriptionModel>(input: TranscriptionRequestInput<Model> | TranscriptionRequest, options?: AwaitOptions & RunOptions) => Promise<import("./transcription.js").TranscriptionResponse>;
|
|
625
|
+
stream: <const Model extends TranscriptionModel>(input: TranscriptionRequestInput<Model> | TranscriptionRequest, options?: AwaitOptions & RunOptions) => AsyncIterable<{
|
|
626
|
+
readonly type: "text-delta";
|
|
627
|
+
readonly delta: string;
|
|
638
628
|
} | {
|
|
639
|
-
readonly type: "
|
|
640
|
-
readonly
|
|
629
|
+
readonly type: "segment";
|
|
630
|
+
readonly segment: {
|
|
631
|
+
readonly text: string;
|
|
632
|
+
readonly startSeconds: number;
|
|
633
|
+
readonly endSeconds: number;
|
|
634
|
+
readonly speaker?: string | undefined;
|
|
635
|
+
};
|
|
641
636
|
} | {
|
|
642
|
-
readonly type: "
|
|
643
|
-
readonly
|
|
637
|
+
readonly type: "generation-queued";
|
|
638
|
+
readonly id: string;
|
|
639
|
+
readonly position?: number | undefined;
|
|
644
640
|
} | {
|
|
645
|
-
readonly type: "
|
|
646
|
-
readonly
|
|
641
|
+
readonly type: "generation-progress";
|
|
642
|
+
readonly id: string;
|
|
643
|
+
readonly progress?: number | undefined;
|
|
647
644
|
} | {
|
|
648
|
-
readonly type: "tokens";
|
|
649
|
-
readonly input?: number | undefined;
|
|
650
|
-
readonly output?: number | undefined;
|
|
651
|
-
readonly total?: number | undefined;
|
|
652
|
-
readonly details?: {
|
|
653
|
-
readonly [x: string]: unknown;
|
|
654
|
-
} | undefined;
|
|
655
|
-
} | undefined;
|
|
656
|
-
readonly providerMetadata?: {
|
|
657
|
-
readonly [x: string]: {
|
|
658
|
-
readonly [x: string]: unknown;
|
|
659
|
-
};
|
|
660
|
-
} | undefined;
|
|
661
|
-
}>;
|
|
662
|
-
};
|
|
663
|
-
transcription: {
|
|
664
|
-
request: typeof import("./transcription.js").request;
|
|
665
|
-
generate: <const Model extends TranscriptionModel>(input: TranscriptionRequestInput<Model> | TranscriptionRequest, options?: AwaitOptions & RunOptions) => Promise<import("./transcription.js").TranscriptionResponse>;
|
|
666
|
-
stream: <const Model extends TranscriptionModel>(input: TranscriptionRequestInput<Model> | TranscriptionRequest, options?: AwaitOptions & RunOptions) => AsyncIterable<{
|
|
667
|
-
readonly type: "text-delta";
|
|
668
|
-
readonly delta: string;
|
|
669
|
-
} | {
|
|
670
|
-
readonly type: "segment";
|
|
671
|
-
readonly segment: {
|
|
672
645
|
readonly text: string;
|
|
673
|
-
readonly
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
readonly
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
646
|
+
readonly segments?: readonly {
|
|
647
|
+
readonly text: string;
|
|
648
|
+
readonly startSeconds: number;
|
|
649
|
+
readonly endSeconds: number;
|
|
650
|
+
readonly speaker?: string | undefined;
|
|
651
|
+
}[] | undefined;
|
|
652
|
+
readonly words?: readonly {
|
|
653
|
+
readonly text: string;
|
|
654
|
+
readonly startSeconds: number;
|
|
655
|
+
readonly endSeconds: number;
|
|
656
|
+
readonly speaker?: string | undefined;
|
|
657
|
+
readonly confidence?: number | undefined;
|
|
658
|
+
}[] | undefined;
|
|
659
|
+
readonly language?: string | undefined;
|
|
660
|
+
readonly durationSeconds?: number | undefined;
|
|
661
|
+
readonly usage?: {
|
|
662
|
+
readonly type: "seconds";
|
|
663
|
+
readonly seconds: number;
|
|
664
|
+
} | {
|
|
665
|
+
readonly type: "characters";
|
|
666
|
+
readonly characters: number;
|
|
667
|
+
} | {
|
|
668
|
+
readonly type: "credits";
|
|
669
|
+
readonly credits: number;
|
|
670
|
+
} | {
|
|
671
|
+
readonly type: "compute";
|
|
672
|
+
readonly seconds: number;
|
|
673
|
+
} | {
|
|
674
|
+
readonly type: "tokens";
|
|
675
|
+
readonly input?: number | undefined;
|
|
676
|
+
readonly output?: number | undefined;
|
|
677
|
+
readonly total?: number | undefined;
|
|
678
|
+
readonly details?: {
|
|
679
|
+
readonly [x: string]: unknown;
|
|
680
|
+
} | undefined;
|
|
681
|
+
} | undefined;
|
|
682
|
+
readonly providerMetadata?: {
|
|
683
|
+
readonly [x: string]: {
|
|
684
|
+
readonly [x: string]: unknown;
|
|
685
|
+
};
|
|
686
|
+
} | undefined;
|
|
687
|
+
readonly type: "finish";
|
|
688
|
+
}>;
|
|
689
|
+
start: <const Model extends TranscriptionModel>(input: TranscriptionRequestInput<Model> | TranscriptionRequest, options?: RunOptions) => Promise<GenerationHandle<import("./transcription.js").TranscriptionResponse>>;
|
|
690
|
+
resume: (model: TranscriptionModel, token: unknown, options?: RunOptions) => Promise<GenerationHandle<import("./transcription.js").TranscriptionResponse>>;
|
|
691
|
+
};
|
|
692
|
+
video: {
|
|
693
|
+
request: typeof import("./video.js").request;
|
|
694
|
+
start: <const Model extends VideoModel>(input: VideoRequestInput<Model> | VideoRequest, options?: RunOptions) => Promise<GenerationHandle<import("./video.js").VideoResponse>>;
|
|
695
|
+
generate: <const Model extends VideoModel>(input: VideoRequestInput<Model> | VideoRequest, options?: AwaitOptions & RunOptions) => Promise<import("./video.js").VideoResponse>;
|
|
696
|
+
resume: (model: VideoModel, token: unknown, options?: RunOptions) => Promise<GenerationHandle<import("./video.js").VideoResponse>>;
|
|
697
|
+
stream: <const Model extends VideoModel>(input: VideoRequestInput<Model> | VideoRequest, options?: AwaitOptions & RunOptions) => AsyncIterable<{
|
|
698
|
+
readonly type: "video";
|
|
699
|
+
readonly index: number;
|
|
700
|
+
readonly video: Media.Asset;
|
|
708
701
|
} | {
|
|
709
|
-
readonly type: "
|
|
710
|
-
readonly
|
|
702
|
+
readonly type: "generation-queued";
|
|
703
|
+
readonly id: string;
|
|
704
|
+
readonly position?: number | undefined;
|
|
711
705
|
} | {
|
|
712
|
-
readonly type: "
|
|
713
|
-
readonly
|
|
706
|
+
readonly type: "generation-progress";
|
|
707
|
+
readonly id: string;
|
|
708
|
+
readonly progress?: number | undefined;
|
|
714
709
|
} | {
|
|
715
|
-
readonly type: "
|
|
716
|
-
readonly
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
readonly
|
|
710
|
+
readonly type: "finish";
|
|
711
|
+
readonly usage?: {
|
|
712
|
+
readonly type: "seconds";
|
|
713
|
+
readonly seconds: number;
|
|
714
|
+
} | {
|
|
715
|
+
readonly type: "characters";
|
|
716
|
+
readonly characters: number;
|
|
717
|
+
} | {
|
|
718
|
+
readonly type: "credits";
|
|
719
|
+
readonly credits: number;
|
|
720
|
+
} | {
|
|
721
|
+
readonly type: "compute";
|
|
722
|
+
readonly seconds: number;
|
|
723
|
+
} | {
|
|
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;
|
|
721
731
|
} | undefined;
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
};
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
}>;
|
|
730
|
-
start: <const Model extends TranscriptionModel>(input: TranscriptionRequestInput<Model> | TranscriptionRequest, options?: RunOptions) => Promise<GenerationHandle<import("./transcription.js").TranscriptionResponse>>;
|
|
731
|
-
resume: (model: TranscriptionModel, token: unknown, options?: RunOptions) => Promise<GenerationHandle<import("./transcription.js").TranscriptionResponse>>;
|
|
732
|
-
};
|
|
733
|
-
decision: {
|
|
734
|
-
request: typeof import("./decision.js").request;
|
|
735
|
-
generate: <const Model extends DecisionModel, const Questions extends DecisionQuestions>(input: DecisionRequestInput<Model, Questions>, options?: RunOptions) => Promise<import("./decision.js").DecisionResponseFor<Questions>>;
|
|
732
|
+
readonly providerMetadata?: {
|
|
733
|
+
readonly [x: string]: {
|
|
734
|
+
readonly [x: string]: unknown;
|
|
735
|
+
};
|
|
736
|
+
} | undefined;
|
|
737
|
+
}>;
|
|
738
|
+
};
|
|
736
739
|
};
|
|
737
740
|
dispose: () => Promise<void>;
|
|
738
741
|
};
|
|
@@ -1262,180 +1265,184 @@ export declare const ai: {
|
|
|
1262
1265
|
start: <const Model extends ImageModel>(input: ImageRequest | ImageRequestInput<Model>, options?: RunOptions) => Promise<GenerationHandle<import("./image.js").ImageResponse>>;
|
|
1263
1266
|
resume: (model: ImageModel, token: unknown, options?: RunOptions) => Promise<GenerationHandle<import("./image.js").ImageResponse>>;
|
|
1264
1267
|
};
|
|
1265
|
-
|
|
1266
|
-
request: typeof import("./
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
readonly position?: number | undefined;
|
|
1278
|
-
} | {
|
|
1279
|
-
readonly type: "generation-progress";
|
|
1280
|
-
readonly id: string;
|
|
1281
|
-
readonly progress?: number | undefined;
|
|
1282
|
-
} | {
|
|
1283
|
-
readonly type: "finish";
|
|
1284
|
-
readonly usage?: {
|
|
1285
|
-
readonly type: "seconds";
|
|
1286
|
-
readonly seconds: number;
|
|
1268
|
+
decision: {
|
|
1269
|
+
request: typeof import("./decision.js").request;
|
|
1270
|
+
generate: <const Model extends DecisionModel, const Questions extends DecisionQuestions>(input: DecisionRequestInput<Model, Questions>, options?: RunOptions) => Promise<import("./decision.js").DecisionResponseFor<Questions>>;
|
|
1271
|
+
};
|
|
1272
|
+
/** Experimental: may change without compatibility guarantees. */
|
|
1273
|
+
experimental: {
|
|
1274
|
+
speech: {
|
|
1275
|
+
request: typeof import("./speech.js").request;
|
|
1276
|
+
generate: <const Model extends SpeechModel>(input: SpeechRequest | SpeechRequestInput<Model>, options?: RunOptions) => Promise<import("./speech.js").SpeechResponse>;
|
|
1277
|
+
stream: <const Model extends SpeechModel>(input: SpeechRequest | SpeechRequestInput<Model>, options?: RunOptions) => AsyncIterable<{
|
|
1278
|
+
readonly type: "audio-delta";
|
|
1279
|
+
readonly chunk: Uint8Array<ArrayBufferLike>;
|
|
1287
1280
|
} | {
|
|
1288
|
-
readonly type: "
|
|
1289
|
-
readonly
|
|
1281
|
+
readonly type: "timestamps";
|
|
1282
|
+
readonly items: readonly {
|
|
1283
|
+
readonly text: string;
|
|
1284
|
+
readonly startSeconds: number;
|
|
1285
|
+
readonly endSeconds: number;
|
|
1286
|
+
}[];
|
|
1290
1287
|
} | {
|
|
1291
|
-
readonly type: "
|
|
1292
|
-
readonly
|
|
1288
|
+
readonly type: "generation-queued";
|
|
1289
|
+
readonly id: string;
|
|
1290
|
+
readonly position?: number | undefined;
|
|
1293
1291
|
} | {
|
|
1294
|
-
readonly type: "
|
|
1295
|
-
readonly
|
|
1292
|
+
readonly type: "generation-progress";
|
|
1293
|
+
readonly id: string;
|
|
1294
|
+
readonly progress?: number | undefined;
|
|
1296
1295
|
} | {
|
|
1297
|
-
readonly type: "
|
|
1298
|
-
readonly
|
|
1299
|
-
readonly
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1296
|
+
readonly type: "finish";
|
|
1297
|
+
readonly audio: Media.Asset;
|
|
1298
|
+
readonly usage?: {
|
|
1299
|
+
readonly type: "seconds";
|
|
1300
|
+
readonly seconds: number;
|
|
1301
|
+
} | {
|
|
1302
|
+
readonly type: "characters";
|
|
1303
|
+
readonly characters: number;
|
|
1304
|
+
} | {
|
|
1305
|
+
readonly type: "credits";
|
|
1306
|
+
readonly credits: number;
|
|
1307
|
+
} | {
|
|
1308
|
+
readonly type: "compute";
|
|
1309
|
+
readonly seconds: number;
|
|
1310
|
+
} | {
|
|
1311
|
+
readonly type: "tokens";
|
|
1312
|
+
readonly input?: number | undefined;
|
|
1313
|
+
readonly output?: number | undefined;
|
|
1314
|
+
readonly total?: number | undefined;
|
|
1315
|
+
readonly details?: {
|
|
1316
|
+
readonly [x: string]: unknown;
|
|
1317
|
+
} | undefined;
|
|
1303
1318
|
} | undefined;
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
};
|
|
1309
|
-
}
|
|
1310
|
-
}
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
readonly chunk: Uint8Array<ArrayBufferLike>;
|
|
1318
|
-
} | {
|
|
1319
|
-
readonly type: "timestamps";
|
|
1320
|
-
readonly items: readonly {
|
|
1321
|
-
readonly text: string;
|
|
1322
|
-
readonly startSeconds: number;
|
|
1323
|
-
readonly endSeconds: number;
|
|
1324
|
-
}[];
|
|
1325
|
-
} | {
|
|
1326
|
-
readonly type: "generation-queued";
|
|
1327
|
-
readonly id: string;
|
|
1328
|
-
readonly position?: number | undefined;
|
|
1329
|
-
} | {
|
|
1330
|
-
readonly type: "generation-progress";
|
|
1331
|
-
readonly id: string;
|
|
1332
|
-
readonly progress?: number | undefined;
|
|
1333
|
-
} | {
|
|
1334
|
-
readonly type: "finish";
|
|
1335
|
-
readonly audio: Media.Asset;
|
|
1336
|
-
readonly usage?: {
|
|
1337
|
-
readonly type: "seconds";
|
|
1338
|
-
readonly seconds: number;
|
|
1319
|
+
readonly providerMetadata?: {
|
|
1320
|
+
readonly [x: string]: {
|
|
1321
|
+
readonly [x: string]: unknown;
|
|
1322
|
+
};
|
|
1323
|
+
} | undefined;
|
|
1324
|
+
}>;
|
|
1325
|
+
};
|
|
1326
|
+
transcription: {
|
|
1327
|
+
request: typeof import("./transcription.js").request;
|
|
1328
|
+
generate: <const Model extends TranscriptionModel>(input: TranscriptionRequest | TranscriptionRequestInput<Model>, options?: AwaitOptions & RunOptions) => Promise<import("./transcription.js").TranscriptionResponse>;
|
|
1329
|
+
stream: <const Model extends TranscriptionModel>(input: TranscriptionRequest | TranscriptionRequestInput<Model>, options?: AwaitOptions & RunOptions) => AsyncIterable<{
|
|
1330
|
+
readonly type: "text-delta";
|
|
1331
|
+
readonly delta: string;
|
|
1339
1332
|
} | {
|
|
1340
|
-
readonly type: "
|
|
1341
|
-
readonly
|
|
1333
|
+
readonly type: "segment";
|
|
1334
|
+
readonly segment: {
|
|
1335
|
+
readonly text: string;
|
|
1336
|
+
readonly startSeconds: number;
|
|
1337
|
+
readonly endSeconds: number;
|
|
1338
|
+
readonly speaker?: string | undefined;
|
|
1339
|
+
};
|
|
1342
1340
|
} | {
|
|
1343
|
-
readonly type: "
|
|
1344
|
-
readonly
|
|
1341
|
+
readonly type: "generation-queued";
|
|
1342
|
+
readonly id: string;
|
|
1343
|
+
readonly position?: number | undefined;
|
|
1345
1344
|
} | {
|
|
1346
|
-
readonly type: "
|
|
1347
|
-
readonly
|
|
1345
|
+
readonly type: "generation-progress";
|
|
1346
|
+
readonly id: string;
|
|
1347
|
+
readonly progress?: number | undefined;
|
|
1348
1348
|
} | {
|
|
1349
|
-
readonly type: "tokens";
|
|
1350
|
-
readonly input?: number | undefined;
|
|
1351
|
-
readonly output?: number | undefined;
|
|
1352
|
-
readonly total?: number | undefined;
|
|
1353
|
-
readonly details?: {
|
|
1354
|
-
readonly [x: string]: unknown;
|
|
1355
|
-
} | undefined;
|
|
1356
|
-
} | undefined;
|
|
1357
|
-
readonly providerMetadata?: {
|
|
1358
|
-
readonly [x: string]: {
|
|
1359
|
-
readonly [x: string]: unknown;
|
|
1360
|
-
};
|
|
1361
|
-
} | undefined;
|
|
1362
|
-
}>;
|
|
1363
|
-
};
|
|
1364
|
-
transcription: {
|
|
1365
|
-
request: typeof import("./transcription.js").request;
|
|
1366
|
-
generate: <const Model extends TranscriptionModel>(input: TranscriptionRequest | TranscriptionRequestInput<Model>, options?: AwaitOptions & RunOptions) => Promise<import("./transcription.js").TranscriptionResponse>;
|
|
1367
|
-
stream: <const Model extends TranscriptionModel>(input: TranscriptionRequest | TranscriptionRequestInput<Model>, options?: AwaitOptions & RunOptions) => AsyncIterable<{
|
|
1368
|
-
readonly type: "text-delta";
|
|
1369
|
-
readonly delta: string;
|
|
1370
|
-
} | {
|
|
1371
|
-
readonly type: "segment";
|
|
1372
|
-
readonly segment: {
|
|
1373
1349
|
readonly text: string;
|
|
1374
|
-
readonly
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
readonly
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1350
|
+
readonly segments?: readonly {
|
|
1351
|
+
readonly text: string;
|
|
1352
|
+
readonly startSeconds: number;
|
|
1353
|
+
readonly endSeconds: number;
|
|
1354
|
+
readonly speaker?: string | undefined;
|
|
1355
|
+
}[] | undefined;
|
|
1356
|
+
readonly words?: readonly {
|
|
1357
|
+
readonly text: string;
|
|
1358
|
+
readonly startSeconds: number;
|
|
1359
|
+
readonly endSeconds: number;
|
|
1360
|
+
readonly speaker?: string | undefined;
|
|
1361
|
+
readonly confidence?: number | undefined;
|
|
1362
|
+
}[] | undefined;
|
|
1363
|
+
readonly language?: string | undefined;
|
|
1364
|
+
readonly durationSeconds?: number | undefined;
|
|
1365
|
+
readonly usage?: {
|
|
1366
|
+
readonly type: "seconds";
|
|
1367
|
+
readonly seconds: number;
|
|
1368
|
+
} | {
|
|
1369
|
+
readonly type: "characters";
|
|
1370
|
+
readonly characters: number;
|
|
1371
|
+
} | {
|
|
1372
|
+
readonly type: "credits";
|
|
1373
|
+
readonly credits: number;
|
|
1374
|
+
} | {
|
|
1375
|
+
readonly type: "compute";
|
|
1376
|
+
readonly seconds: number;
|
|
1377
|
+
} | {
|
|
1378
|
+
readonly type: "tokens";
|
|
1379
|
+
readonly input?: number | undefined;
|
|
1380
|
+
readonly output?: number | undefined;
|
|
1381
|
+
readonly total?: number | undefined;
|
|
1382
|
+
readonly details?: {
|
|
1383
|
+
readonly [x: string]: unknown;
|
|
1384
|
+
} | undefined;
|
|
1385
|
+
} | undefined;
|
|
1386
|
+
readonly providerMetadata?: {
|
|
1387
|
+
readonly [x: string]: {
|
|
1388
|
+
readonly [x: string]: unknown;
|
|
1389
|
+
};
|
|
1390
|
+
} | undefined;
|
|
1391
|
+
readonly type: "finish";
|
|
1392
|
+
}>;
|
|
1393
|
+
start: <const Model extends TranscriptionModel>(input: TranscriptionRequest | TranscriptionRequestInput<Model>, options?: RunOptions) => Promise<GenerationHandle<import("./transcription.js").TranscriptionResponse>>;
|
|
1394
|
+
resume: (model: TranscriptionModel, token: unknown, options?: RunOptions) => Promise<GenerationHandle<import("./transcription.js").TranscriptionResponse>>;
|
|
1395
|
+
};
|
|
1396
|
+
video: {
|
|
1397
|
+
request: typeof import("./video.js").request;
|
|
1398
|
+
start: <const Model extends VideoModel>(input: VideoRequest | VideoRequestInput<Model>, options?: RunOptions) => Promise<GenerationHandle<import("./video.js").VideoResponse>>;
|
|
1399
|
+
generate: <const Model extends VideoModel>(input: VideoRequest | VideoRequestInput<Model>, options?: AwaitOptions & RunOptions) => Promise<import("./video.js").VideoResponse>;
|
|
1400
|
+
resume: (model: VideoModel, token: unknown, options?: RunOptions) => Promise<GenerationHandle<import("./video.js").VideoResponse>>;
|
|
1401
|
+
stream: <const Model extends VideoModel>(input: VideoRequest | VideoRequestInput<Model>, options?: AwaitOptions & RunOptions) => AsyncIterable<{
|
|
1402
|
+
readonly type: "video";
|
|
1403
|
+
readonly index: number;
|
|
1404
|
+
readonly video: Media.Asset;
|
|
1409
1405
|
} | {
|
|
1410
|
-
readonly type: "
|
|
1411
|
-
readonly
|
|
1406
|
+
readonly type: "generation-queued";
|
|
1407
|
+
readonly id: string;
|
|
1408
|
+
readonly position?: number | undefined;
|
|
1412
1409
|
} | {
|
|
1413
|
-
readonly type: "
|
|
1414
|
-
readonly
|
|
1410
|
+
readonly type: "generation-progress";
|
|
1411
|
+
readonly id: string;
|
|
1412
|
+
readonly progress?: number | undefined;
|
|
1415
1413
|
} | {
|
|
1416
|
-
readonly type: "
|
|
1417
|
-
readonly
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
readonly
|
|
1414
|
+
readonly type: "finish";
|
|
1415
|
+
readonly usage?: {
|
|
1416
|
+
readonly type: "seconds";
|
|
1417
|
+
readonly seconds: number;
|
|
1418
|
+
} | {
|
|
1419
|
+
readonly type: "characters";
|
|
1420
|
+
readonly characters: number;
|
|
1421
|
+
} | {
|
|
1422
|
+
readonly type: "credits";
|
|
1423
|
+
readonly credits: number;
|
|
1424
|
+
} | {
|
|
1425
|
+
readonly type: "compute";
|
|
1426
|
+
readonly seconds: number;
|
|
1427
|
+
} | {
|
|
1428
|
+
readonly type: "tokens";
|
|
1429
|
+
readonly input?: number | undefined;
|
|
1430
|
+
readonly output?: number | undefined;
|
|
1431
|
+
readonly total?: number | undefined;
|
|
1432
|
+
readonly details?: {
|
|
1433
|
+
readonly [x: string]: unknown;
|
|
1434
|
+
} | undefined;
|
|
1422
1435
|
} | undefined;
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
};
|
|
1428
|
-
}
|
|
1429
|
-
|
|
1430
|
-
}>;
|
|
1431
|
-
start: <const Model extends TranscriptionModel>(input: TranscriptionRequest | TranscriptionRequestInput<Model>, options?: RunOptions) => Promise<GenerationHandle<import("./transcription.js").TranscriptionResponse>>;
|
|
1432
|
-
resume: (model: TranscriptionModel, token: unknown, options?: RunOptions) => Promise<GenerationHandle<import("./transcription.js").TranscriptionResponse>>;
|
|
1433
|
-
};
|
|
1434
|
-
decision: {
|
|
1435
|
-
request: typeof import("./decision.js").request;
|
|
1436
|
-
generate: <const Model extends DecisionModel, const Questions extends DecisionQuestions>(input: DecisionRequestInput<Model, Questions>, options?: RunOptions) => Promise<import("./decision.js").DecisionResponseFor<Questions>>;
|
|
1436
|
+
readonly providerMetadata?: {
|
|
1437
|
+
readonly [x: string]: {
|
|
1438
|
+
readonly [x: string]: unknown;
|
|
1439
|
+
};
|
|
1440
|
+
} | undefined;
|
|
1441
|
+
}>;
|
|
1442
|
+
};
|
|
1437
1443
|
};
|
|
1438
1444
|
dispose: () => Promise<void>;
|
|
1439
1445
|
};
|
|
1446
|
+
export { AIError } from "./schema/index.js";
|
|
1440
1447
|
export * as AI from "./index.js";
|
|
1441
1448
|
export type { ExecutableTool, Tool, ToolOptions, Tools } from "./tool.js";
|