@broberg/ai-sdk 0.5.0 → 0.6.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/index.d.ts +124 -44
- package/dist/index.js +105 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { z } from 'zod';
|
|
|
5
5
|
type Transport = "http" | "subprocess";
|
|
6
6
|
/** Named capability tier. Resolves to a (provider, model, transport) triple via
|
|
7
7
|
* the tier map, overridable per call. */
|
|
8
|
-
type Tier = "fast" | "smart" | "powerful" | "cheap" | "vision" | "embedding";
|
|
8
|
+
type Tier = "fast" | "smart" | "powerful" | "cheap" | "vision" | "video" | "embedding";
|
|
9
9
|
/** The concrete routing target a Tier (or a per-call override) resolves to. */
|
|
10
10
|
interface TierSpec {
|
|
11
11
|
provider: string;
|
|
@@ -13,7 +13,7 @@ interface TierSpec {
|
|
|
13
13
|
transport: Transport;
|
|
14
14
|
}
|
|
15
15
|
/** High-level capability a call exercises. Mirrors the capability layer (F5). */
|
|
16
|
-
type Capability = "chat" | "vision" | "translate" | "image" | "embedding" | "transcribe" | "mockup" | "design" | "extract" | "classify" | "rerank";
|
|
16
|
+
type Capability = "chat" | "vision" | "video" | "translate" | "image" | "embedding" | "transcribe" | "mockup" | "design" | "extract" | "classify" | "rerank";
|
|
17
17
|
type Role = "system" | "user" | "assistant" | "tool";
|
|
18
18
|
/** A piece of message content. Text everywhere; image parts feed vision. */
|
|
19
19
|
type ContentPart = {
|
|
@@ -23,6 +23,10 @@ type ContentPart = {
|
|
|
23
23
|
type: "image";
|
|
24
24
|
image: string | Uint8Array;
|
|
25
25
|
mimeType?: string;
|
|
26
|
+
} | {
|
|
27
|
+
type: "video";
|
|
28
|
+
video: string | Uint8Array;
|
|
29
|
+
mimeType?: string;
|
|
26
30
|
};
|
|
27
31
|
interface Message {
|
|
28
32
|
role: Role;
|
|
@@ -361,7 +365,7 @@ declare const messageSchema: z.ZodObject<{
|
|
|
361
365
|
toolCallId?: string | undefined;
|
|
362
366
|
}>;
|
|
363
367
|
declare const chatInputSchema: z.ZodObject<{
|
|
364
|
-
tier: z.ZodOptional<z.ZodEnum<["fast", "smart", "powerful", "cheap", "vision", "embedding"]>>;
|
|
368
|
+
tier: z.ZodOptional<z.ZodEnum<["fast", "smart", "powerful", "cheap", "vision", "video", "embedding"]>>;
|
|
365
369
|
override: z.ZodOptional<z.ZodObject<{
|
|
366
370
|
provider: z.ZodOptional<z.ZodString>;
|
|
367
371
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -375,7 +379,7 @@ declare const chatInputSchema: z.ZodObject<{
|
|
|
375
379
|
model?: string | undefined;
|
|
376
380
|
transport?: "http" | "subprocess" | undefined;
|
|
377
381
|
}>>;
|
|
378
|
-
fallback: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEnum<["fast", "smart", "powerful", "cheap", "vision", "embedding"]>, z.ZodObject<{
|
|
382
|
+
fallback: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEnum<["fast", "smart", "powerful", "cheap", "vision", "video", "embedding"]>, z.ZodObject<{
|
|
379
383
|
provider: z.ZodString;
|
|
380
384
|
model: z.ZodString;
|
|
381
385
|
transport: z.ZodEnum<["http", "subprocess"]>;
|
|
@@ -508,13 +512,13 @@ declare const chatInputSchema: z.ZodObject<{
|
|
|
508
512
|
temperature?: number | undefined;
|
|
509
513
|
maxTokens?: number | undefined;
|
|
510
514
|
responseFormat?: "text" | "json" | undefined;
|
|
511
|
-
tier?: "fast" | "smart" | "powerful" | "cheap" | "vision" | "embedding" | undefined;
|
|
515
|
+
tier?: "fast" | "smart" | "powerful" | "cheap" | "vision" | "video" | "embedding" | undefined;
|
|
512
516
|
override?: {
|
|
513
517
|
provider?: string | undefined;
|
|
514
518
|
model?: string | undefined;
|
|
515
519
|
transport?: "http" | "subprocess" | undefined;
|
|
516
520
|
} | undefined;
|
|
517
|
-
fallback?: ("fast" | "smart" | "powerful" | "cheap" | "vision" | "embedding" | {
|
|
521
|
+
fallback?: ("fast" | "smart" | "powerful" | "cheap" | "vision" | "video" | "embedding" | {
|
|
518
522
|
provider: string;
|
|
519
523
|
model: string;
|
|
520
524
|
transport: "http" | "subprocess";
|
|
@@ -549,13 +553,13 @@ declare const chatInputSchema: z.ZodObject<{
|
|
|
549
553
|
temperature?: number | undefined;
|
|
550
554
|
maxTokens?: number | undefined;
|
|
551
555
|
responseFormat?: "text" | "json" | undefined;
|
|
552
|
-
tier?: "fast" | "smart" | "powerful" | "cheap" | "vision" | "embedding" | undefined;
|
|
556
|
+
tier?: "fast" | "smart" | "powerful" | "cheap" | "vision" | "video" | "embedding" | undefined;
|
|
553
557
|
override?: {
|
|
554
558
|
provider?: string | undefined;
|
|
555
559
|
model?: string | undefined;
|
|
556
560
|
transport?: "http" | "subprocess" | undefined;
|
|
557
561
|
} | undefined;
|
|
558
|
-
fallback?: ("fast" | "smart" | "powerful" | "cheap" | "vision" | "embedding" | {
|
|
562
|
+
fallback?: ("fast" | "smart" | "powerful" | "cheap" | "vision" | "video" | "embedding" | {
|
|
559
563
|
provider: string;
|
|
560
564
|
model: string;
|
|
561
565
|
transport: "http" | "subprocess";
|
|
@@ -564,7 +568,7 @@ declare const chatInputSchema: z.ZodObject<{
|
|
|
564
568
|
labels?: Record<string, string> | undefined;
|
|
565
569
|
}>;
|
|
566
570
|
declare const visionInputSchema: z.ZodObject<{
|
|
567
|
-
tier: z.ZodOptional<z.ZodEnum<["fast", "smart", "powerful", "cheap", "vision", "embedding"]>>;
|
|
571
|
+
tier: z.ZodOptional<z.ZodEnum<["fast", "smart", "powerful", "cheap", "vision", "video", "embedding"]>>;
|
|
568
572
|
override: z.ZodOptional<z.ZodObject<{
|
|
569
573
|
provider: z.ZodOptional<z.ZodString>;
|
|
570
574
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -578,7 +582,7 @@ declare const visionInputSchema: z.ZodObject<{
|
|
|
578
582
|
model?: string | undefined;
|
|
579
583
|
transport?: "http" | "subprocess" | undefined;
|
|
580
584
|
}>>;
|
|
581
|
-
fallback: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEnum<["fast", "smart", "powerful", "cheap", "vision", "embedding"]>, z.ZodObject<{
|
|
585
|
+
fallback: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEnum<["fast", "smart", "powerful", "cheap", "vision", "video", "embedding"]>, z.ZodObject<{
|
|
582
586
|
provider: z.ZodString;
|
|
583
587
|
model: z.ZodString;
|
|
584
588
|
transport: z.ZodEnum<["http", "subprocess"]>;
|
|
@@ -600,13 +604,13 @@ declare const visionInputSchema: z.ZodObject<{
|
|
|
600
604
|
image: string | Uint8Array<ArrayBuffer>;
|
|
601
605
|
prompt: string;
|
|
602
606
|
mimeType?: string | undefined;
|
|
603
|
-
tier?: "fast" | "smart" | "powerful" | "cheap" | "vision" | "embedding" | undefined;
|
|
607
|
+
tier?: "fast" | "smart" | "powerful" | "cheap" | "vision" | "video" | "embedding" | undefined;
|
|
604
608
|
override?: {
|
|
605
609
|
provider?: string | undefined;
|
|
606
610
|
model?: string | undefined;
|
|
607
611
|
transport?: "http" | "subprocess" | undefined;
|
|
608
612
|
} | undefined;
|
|
609
|
-
fallback?: ("fast" | "smart" | "powerful" | "cheap" | "vision" | "embedding" | {
|
|
613
|
+
fallback?: ("fast" | "smart" | "powerful" | "cheap" | "vision" | "video" | "embedding" | {
|
|
610
614
|
provider: string;
|
|
611
615
|
model: string;
|
|
612
616
|
transport: "http" | "subprocess";
|
|
@@ -617,13 +621,81 @@ declare const visionInputSchema: z.ZodObject<{
|
|
|
617
621
|
image: string | Uint8Array<ArrayBuffer>;
|
|
618
622
|
prompt: string;
|
|
619
623
|
mimeType?: string | undefined;
|
|
620
|
-
tier?: "fast" | "smart" | "powerful" | "cheap" | "vision" | "embedding" | undefined;
|
|
624
|
+
tier?: "fast" | "smart" | "powerful" | "cheap" | "vision" | "video" | "embedding" | undefined;
|
|
625
|
+
override?: {
|
|
626
|
+
provider?: string | undefined;
|
|
627
|
+
model?: string | undefined;
|
|
628
|
+
transport?: "http" | "subprocess" | undefined;
|
|
629
|
+
} | undefined;
|
|
630
|
+
fallback?: ("fast" | "smart" | "powerful" | "cheap" | "vision" | "video" | "embedding" | {
|
|
631
|
+
provider: string;
|
|
632
|
+
model: string;
|
|
633
|
+
transport: "http" | "subprocess";
|
|
634
|
+
})[] | undefined;
|
|
635
|
+
purpose?: string | undefined;
|
|
636
|
+
labels?: Record<string, string> | undefined;
|
|
637
|
+
}>;
|
|
638
|
+
declare const videoInputSchema: z.ZodObject<{
|
|
639
|
+
tier: z.ZodOptional<z.ZodEnum<["fast", "smart", "powerful", "cheap", "vision", "video", "embedding"]>>;
|
|
640
|
+
override: z.ZodOptional<z.ZodObject<{
|
|
641
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
642
|
+
model: z.ZodOptional<z.ZodString>;
|
|
643
|
+
transport: z.ZodOptional<z.ZodEnum<["http", "subprocess"]>>;
|
|
644
|
+
}, "strip", z.ZodTypeAny, {
|
|
645
|
+
provider?: string | undefined;
|
|
646
|
+
model?: string | undefined;
|
|
647
|
+
transport?: "http" | "subprocess" | undefined;
|
|
648
|
+
}, {
|
|
649
|
+
provider?: string | undefined;
|
|
650
|
+
model?: string | undefined;
|
|
651
|
+
transport?: "http" | "subprocess" | undefined;
|
|
652
|
+
}>>;
|
|
653
|
+
fallback: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEnum<["fast", "smart", "powerful", "cheap", "vision", "video", "embedding"]>, z.ZodObject<{
|
|
654
|
+
provider: z.ZodString;
|
|
655
|
+
model: z.ZodString;
|
|
656
|
+
transport: z.ZodEnum<["http", "subprocess"]>;
|
|
657
|
+
}, "strip", z.ZodTypeAny, {
|
|
658
|
+
provider: string;
|
|
659
|
+
model: string;
|
|
660
|
+
transport: "http" | "subprocess";
|
|
661
|
+
}, {
|
|
662
|
+
provider: string;
|
|
663
|
+
model: string;
|
|
664
|
+
transport: "http" | "subprocess";
|
|
665
|
+
}>]>, "many">>;
|
|
666
|
+
purpose: z.ZodOptional<z.ZodString>;
|
|
667
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
668
|
+
video: z.ZodUnion<[z.ZodString, z.ZodType<Uint8Array<ArrayBuffer>, z.ZodTypeDef, Uint8Array<ArrayBuffer>>]>;
|
|
669
|
+
prompt: z.ZodString;
|
|
670
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
671
|
+
}, "strip", z.ZodTypeAny, {
|
|
672
|
+
video: string | Uint8Array<ArrayBuffer>;
|
|
673
|
+
prompt: string;
|
|
674
|
+
mimeType?: string | undefined;
|
|
675
|
+
tier?: "fast" | "smart" | "powerful" | "cheap" | "vision" | "video" | "embedding" | undefined;
|
|
676
|
+
override?: {
|
|
677
|
+
provider?: string | undefined;
|
|
678
|
+
model?: string | undefined;
|
|
679
|
+
transport?: "http" | "subprocess" | undefined;
|
|
680
|
+
} | undefined;
|
|
681
|
+
fallback?: ("fast" | "smart" | "powerful" | "cheap" | "vision" | "video" | "embedding" | {
|
|
682
|
+
provider: string;
|
|
683
|
+
model: string;
|
|
684
|
+
transport: "http" | "subprocess";
|
|
685
|
+
})[] | undefined;
|
|
686
|
+
purpose?: string | undefined;
|
|
687
|
+
labels?: Record<string, string> | undefined;
|
|
688
|
+
}, {
|
|
689
|
+
video: string | Uint8Array<ArrayBuffer>;
|
|
690
|
+
prompt: string;
|
|
691
|
+
mimeType?: string | undefined;
|
|
692
|
+
tier?: "fast" | "smart" | "powerful" | "cheap" | "vision" | "video" | "embedding" | undefined;
|
|
621
693
|
override?: {
|
|
622
694
|
provider?: string | undefined;
|
|
623
695
|
model?: string | undefined;
|
|
624
696
|
transport?: "http" | "subprocess" | undefined;
|
|
625
697
|
} | undefined;
|
|
626
|
-
fallback?: ("fast" | "smart" | "powerful" | "cheap" | "vision" | "embedding" | {
|
|
698
|
+
fallback?: ("fast" | "smart" | "powerful" | "cheap" | "vision" | "video" | "embedding" | {
|
|
627
699
|
provider: string;
|
|
628
700
|
model: string;
|
|
629
701
|
transport: "http" | "subprocess";
|
|
@@ -632,7 +704,7 @@ declare const visionInputSchema: z.ZodObject<{
|
|
|
632
704
|
labels?: Record<string, string> | undefined;
|
|
633
705
|
}>;
|
|
634
706
|
declare const translateInputSchema: z.ZodObject<{
|
|
635
|
-
tier: z.ZodOptional<z.ZodEnum<["fast", "smart", "powerful", "cheap", "vision", "embedding"]>>;
|
|
707
|
+
tier: z.ZodOptional<z.ZodEnum<["fast", "smart", "powerful", "cheap", "vision", "video", "embedding"]>>;
|
|
636
708
|
override: z.ZodOptional<z.ZodObject<{
|
|
637
709
|
provider: z.ZodOptional<z.ZodString>;
|
|
638
710
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -646,7 +718,7 @@ declare const translateInputSchema: z.ZodObject<{
|
|
|
646
718
|
model?: string | undefined;
|
|
647
719
|
transport?: "http" | "subprocess" | undefined;
|
|
648
720
|
}>>;
|
|
649
|
-
fallback: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEnum<["fast", "smart", "powerful", "cheap", "vision", "embedding"]>, z.ZodObject<{
|
|
721
|
+
fallback: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEnum<["fast", "smart", "powerful", "cheap", "vision", "video", "embedding"]>, z.ZodObject<{
|
|
650
722
|
provider: z.ZodString;
|
|
651
723
|
model: z.ZodString;
|
|
652
724
|
transport: z.ZodEnum<["http", "subprocess"]>;
|
|
@@ -667,13 +739,13 @@ declare const translateInputSchema: z.ZodObject<{
|
|
|
667
739
|
}, "strip", z.ZodTypeAny, {
|
|
668
740
|
text: string;
|
|
669
741
|
to: string;
|
|
670
|
-
tier?: "fast" | "smart" | "powerful" | "cheap" | "vision" | "embedding" | undefined;
|
|
742
|
+
tier?: "fast" | "smart" | "powerful" | "cheap" | "vision" | "video" | "embedding" | undefined;
|
|
671
743
|
override?: {
|
|
672
744
|
provider?: string | undefined;
|
|
673
745
|
model?: string | undefined;
|
|
674
746
|
transport?: "http" | "subprocess" | undefined;
|
|
675
747
|
} | undefined;
|
|
676
|
-
fallback?: ("fast" | "smart" | "powerful" | "cheap" | "vision" | "embedding" | {
|
|
748
|
+
fallback?: ("fast" | "smart" | "powerful" | "cheap" | "vision" | "video" | "embedding" | {
|
|
677
749
|
provider: string;
|
|
678
750
|
model: string;
|
|
679
751
|
transport: "http" | "subprocess";
|
|
@@ -684,13 +756,13 @@ declare const translateInputSchema: z.ZodObject<{
|
|
|
684
756
|
}, {
|
|
685
757
|
text: string;
|
|
686
758
|
to: string;
|
|
687
|
-
tier?: "fast" | "smart" | "powerful" | "cheap" | "vision" | "embedding" | undefined;
|
|
759
|
+
tier?: "fast" | "smart" | "powerful" | "cheap" | "vision" | "video" | "embedding" | undefined;
|
|
688
760
|
override?: {
|
|
689
761
|
provider?: string | undefined;
|
|
690
762
|
model?: string | undefined;
|
|
691
763
|
transport?: "http" | "subprocess" | undefined;
|
|
692
764
|
} | undefined;
|
|
693
|
-
fallback?: ("fast" | "smart" | "powerful" | "cheap" | "vision" | "embedding" | {
|
|
765
|
+
fallback?: ("fast" | "smart" | "powerful" | "cheap" | "vision" | "video" | "embedding" | {
|
|
694
766
|
provider: string;
|
|
695
767
|
model: string;
|
|
696
768
|
transport: "http" | "subprocess";
|
|
@@ -700,7 +772,7 @@ declare const translateInputSchema: z.ZodObject<{
|
|
|
700
772
|
from?: string | undefined;
|
|
701
773
|
}>;
|
|
702
774
|
declare const imageInputSchema: z.ZodObject<{
|
|
703
|
-
tier: z.ZodOptional<z.ZodEnum<["fast", "smart", "powerful", "cheap", "vision", "embedding"]>>;
|
|
775
|
+
tier: z.ZodOptional<z.ZodEnum<["fast", "smart", "powerful", "cheap", "vision", "video", "embedding"]>>;
|
|
704
776
|
override: z.ZodOptional<z.ZodObject<{
|
|
705
777
|
provider: z.ZodOptional<z.ZodString>;
|
|
706
778
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -714,7 +786,7 @@ declare const imageInputSchema: z.ZodObject<{
|
|
|
714
786
|
model?: string | undefined;
|
|
715
787
|
transport?: "http" | "subprocess" | undefined;
|
|
716
788
|
}>>;
|
|
717
|
-
fallback: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEnum<["fast", "smart", "powerful", "cheap", "vision", "embedding"]>, z.ZodObject<{
|
|
789
|
+
fallback: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEnum<["fast", "smart", "powerful", "cheap", "vision", "video", "embedding"]>, z.ZodObject<{
|
|
718
790
|
provider: z.ZodString;
|
|
719
791
|
model: z.ZodString;
|
|
720
792
|
transport: z.ZodEnum<["http", "subprocess"]>;
|
|
@@ -734,13 +806,13 @@ declare const imageInputSchema: z.ZodObject<{
|
|
|
734
806
|
height: z.ZodOptional<z.ZodNumber>;
|
|
735
807
|
}, "strip", z.ZodTypeAny, {
|
|
736
808
|
prompt: string;
|
|
737
|
-
tier?: "fast" | "smart" | "powerful" | "cheap" | "vision" | "embedding" | undefined;
|
|
809
|
+
tier?: "fast" | "smart" | "powerful" | "cheap" | "vision" | "video" | "embedding" | undefined;
|
|
738
810
|
override?: {
|
|
739
811
|
provider?: string | undefined;
|
|
740
812
|
model?: string | undefined;
|
|
741
813
|
transport?: "http" | "subprocess" | undefined;
|
|
742
814
|
} | undefined;
|
|
743
|
-
fallback?: ("fast" | "smart" | "powerful" | "cheap" | "vision" | "embedding" | {
|
|
815
|
+
fallback?: ("fast" | "smart" | "powerful" | "cheap" | "vision" | "video" | "embedding" | {
|
|
744
816
|
provider: string;
|
|
745
817
|
model: string;
|
|
746
818
|
transport: "http" | "subprocess";
|
|
@@ -751,13 +823,13 @@ declare const imageInputSchema: z.ZodObject<{
|
|
|
751
823
|
height?: number | undefined;
|
|
752
824
|
}, {
|
|
753
825
|
prompt: string;
|
|
754
|
-
tier?: "fast" | "smart" | "powerful" | "cheap" | "vision" | "embedding" | undefined;
|
|
826
|
+
tier?: "fast" | "smart" | "powerful" | "cheap" | "vision" | "video" | "embedding" | undefined;
|
|
755
827
|
override?: {
|
|
756
828
|
provider?: string | undefined;
|
|
757
829
|
model?: string | undefined;
|
|
758
830
|
transport?: "http" | "subprocess" | undefined;
|
|
759
831
|
} | undefined;
|
|
760
|
-
fallback?: ("fast" | "smart" | "powerful" | "cheap" | "vision" | "embedding" | {
|
|
832
|
+
fallback?: ("fast" | "smart" | "powerful" | "cheap" | "vision" | "video" | "embedding" | {
|
|
761
833
|
provider: string;
|
|
762
834
|
model: string;
|
|
763
835
|
transport: "http" | "subprocess";
|
|
@@ -768,7 +840,7 @@ declare const imageInputSchema: z.ZodObject<{
|
|
|
768
840
|
height?: number | undefined;
|
|
769
841
|
}>;
|
|
770
842
|
declare const embeddingInputSchema: z.ZodObject<{
|
|
771
|
-
tier: z.ZodOptional<z.ZodEnum<["fast", "smart", "powerful", "cheap", "vision", "embedding"]>>;
|
|
843
|
+
tier: z.ZodOptional<z.ZodEnum<["fast", "smart", "powerful", "cheap", "vision", "video", "embedding"]>>;
|
|
772
844
|
override: z.ZodOptional<z.ZodObject<{
|
|
773
845
|
provider: z.ZodOptional<z.ZodString>;
|
|
774
846
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -782,7 +854,7 @@ declare const embeddingInputSchema: z.ZodObject<{
|
|
|
782
854
|
model?: string | undefined;
|
|
783
855
|
transport?: "http" | "subprocess" | undefined;
|
|
784
856
|
}>>;
|
|
785
|
-
fallback: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEnum<["fast", "smart", "powerful", "cheap", "vision", "embedding"]>, z.ZodObject<{
|
|
857
|
+
fallback: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEnum<["fast", "smart", "powerful", "cheap", "vision", "video", "embedding"]>, z.ZodObject<{
|
|
786
858
|
provider: z.ZodString;
|
|
787
859
|
model: z.ZodString;
|
|
788
860
|
transport: z.ZodEnum<["http", "subprocess"]>;
|
|
@@ -800,13 +872,13 @@ declare const embeddingInputSchema: z.ZodObject<{
|
|
|
800
872
|
text: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
801
873
|
}, "strip", z.ZodTypeAny, {
|
|
802
874
|
text: string | string[];
|
|
803
|
-
tier?: "fast" | "smart" | "powerful" | "cheap" | "vision" | "embedding" | undefined;
|
|
875
|
+
tier?: "fast" | "smart" | "powerful" | "cheap" | "vision" | "video" | "embedding" | undefined;
|
|
804
876
|
override?: {
|
|
805
877
|
provider?: string | undefined;
|
|
806
878
|
model?: string | undefined;
|
|
807
879
|
transport?: "http" | "subprocess" | undefined;
|
|
808
880
|
} | undefined;
|
|
809
|
-
fallback?: ("fast" | "smart" | "powerful" | "cheap" | "vision" | "embedding" | {
|
|
881
|
+
fallback?: ("fast" | "smart" | "powerful" | "cheap" | "vision" | "video" | "embedding" | {
|
|
810
882
|
provider: string;
|
|
811
883
|
model: string;
|
|
812
884
|
transport: "http" | "subprocess";
|
|
@@ -815,13 +887,13 @@ declare const embeddingInputSchema: z.ZodObject<{
|
|
|
815
887
|
labels?: Record<string, string> | undefined;
|
|
816
888
|
}, {
|
|
817
889
|
text: string | string[];
|
|
818
|
-
tier?: "fast" | "smart" | "powerful" | "cheap" | "vision" | "embedding" | undefined;
|
|
890
|
+
tier?: "fast" | "smart" | "powerful" | "cheap" | "vision" | "video" | "embedding" | undefined;
|
|
819
891
|
override?: {
|
|
820
892
|
provider?: string | undefined;
|
|
821
893
|
model?: string | undefined;
|
|
822
894
|
transport?: "http" | "subprocess" | undefined;
|
|
823
895
|
} | undefined;
|
|
824
|
-
fallback?: ("fast" | "smart" | "powerful" | "cheap" | "vision" | "embedding" | {
|
|
896
|
+
fallback?: ("fast" | "smart" | "powerful" | "cheap" | "vision" | "video" | "embedding" | {
|
|
825
897
|
provider: string;
|
|
826
898
|
model: string;
|
|
827
899
|
transport: "http" | "subprocess";
|
|
@@ -830,7 +902,7 @@ declare const embeddingInputSchema: z.ZodObject<{
|
|
|
830
902
|
labels?: Record<string, string> | undefined;
|
|
831
903
|
}>;
|
|
832
904
|
declare const transcribeInputSchema: z.ZodObject<{
|
|
833
|
-
tier: z.ZodOptional<z.ZodEnum<["fast", "smart", "powerful", "cheap", "vision", "embedding"]>>;
|
|
905
|
+
tier: z.ZodOptional<z.ZodEnum<["fast", "smart", "powerful", "cheap", "vision", "video", "embedding"]>>;
|
|
834
906
|
override: z.ZodOptional<z.ZodObject<{
|
|
835
907
|
provider: z.ZodOptional<z.ZodString>;
|
|
836
908
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -844,7 +916,7 @@ declare const transcribeInputSchema: z.ZodObject<{
|
|
|
844
916
|
model?: string | undefined;
|
|
845
917
|
transport?: "http" | "subprocess" | undefined;
|
|
846
918
|
}>>;
|
|
847
|
-
fallback: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEnum<["fast", "smart", "powerful", "cheap", "vision", "embedding"]>, z.ZodObject<{
|
|
919
|
+
fallback: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEnum<["fast", "smart", "powerful", "cheap", "vision", "video", "embedding"]>, z.ZodObject<{
|
|
848
920
|
provider: z.ZodString;
|
|
849
921
|
model: z.ZodString;
|
|
850
922
|
transport: z.ZodEnum<["http", "subprocess"]>;
|
|
@@ -867,13 +939,13 @@ declare const transcribeInputSchema: z.ZodObject<{
|
|
|
867
939
|
}, "strip", z.ZodTypeAny, {
|
|
868
940
|
audio: string | Uint8Array<ArrayBuffer>;
|
|
869
941
|
language?: string | undefined;
|
|
870
|
-
tier?: "fast" | "smart" | "powerful" | "cheap" | "vision" | "embedding" | undefined;
|
|
942
|
+
tier?: "fast" | "smart" | "powerful" | "cheap" | "vision" | "video" | "embedding" | undefined;
|
|
871
943
|
override?: {
|
|
872
944
|
provider?: string | undefined;
|
|
873
945
|
model?: string | undefined;
|
|
874
946
|
transport?: "http" | "subprocess" | undefined;
|
|
875
947
|
} | undefined;
|
|
876
|
-
fallback?: ("fast" | "smart" | "powerful" | "cheap" | "vision" | "embedding" | {
|
|
948
|
+
fallback?: ("fast" | "smart" | "powerful" | "cheap" | "vision" | "video" | "embedding" | {
|
|
877
949
|
provider: string;
|
|
878
950
|
model: string;
|
|
879
951
|
transport: "http" | "subprocess";
|
|
@@ -884,13 +956,13 @@ declare const transcribeInputSchema: z.ZodObject<{
|
|
|
884
956
|
}, {
|
|
885
957
|
audio: string | Uint8Array<ArrayBuffer>;
|
|
886
958
|
language?: string | undefined;
|
|
887
|
-
tier?: "fast" | "smart" | "powerful" | "cheap" | "vision" | "embedding" | undefined;
|
|
959
|
+
tier?: "fast" | "smart" | "powerful" | "cheap" | "vision" | "video" | "embedding" | undefined;
|
|
888
960
|
override?: {
|
|
889
961
|
provider?: string | undefined;
|
|
890
962
|
model?: string | undefined;
|
|
891
963
|
transport?: "http" | "subprocess" | undefined;
|
|
892
964
|
} | undefined;
|
|
893
|
-
fallback?: ("fast" | "smart" | "powerful" | "cheap" | "vision" | "embedding" | {
|
|
965
|
+
fallback?: ("fast" | "smart" | "powerful" | "cheap" | "vision" | "video" | "embedding" | {
|
|
894
966
|
provider: string;
|
|
895
967
|
model: string;
|
|
896
968
|
transport: "http" | "subprocess";
|
|
@@ -900,7 +972,7 @@ declare const transcribeInputSchema: z.ZodObject<{
|
|
|
900
972
|
durationSec?: number | undefined;
|
|
901
973
|
}>;
|
|
902
974
|
declare const aiConfigSchema: z.ZodObject<{
|
|
903
|
-
defaults: z.ZodOptional<z.ZodRecord<z.ZodEnum<["fast", "smart", "powerful", "cheap", "vision", "embedding"]>, z.ZodObject<{
|
|
975
|
+
defaults: z.ZodOptional<z.ZodRecord<z.ZodEnum<["fast", "smart", "powerful", "cheap", "vision", "video", "embedding"]>, z.ZodObject<{
|
|
904
976
|
provider: z.ZodString;
|
|
905
977
|
model: z.ZodString;
|
|
906
978
|
transport: z.ZodEnum<["http", "subprocess"]>;
|
|
@@ -926,7 +998,7 @@ declare const aiConfigSchema: z.ZodObject<{
|
|
|
926
998
|
rollingUsd?: number | undefined;
|
|
927
999
|
}>>;
|
|
928
1000
|
}, "strip", z.ZodTypeAny, {
|
|
929
|
-
defaults?: Partial<Record<"fast" | "smart" | "powerful" | "cheap" | "vision" | "embedding", {
|
|
1001
|
+
defaults?: Partial<Record<"fast" | "smart" | "powerful" | "cheap" | "vision" | "video" | "embedding", {
|
|
930
1002
|
provider: string;
|
|
931
1003
|
model: string;
|
|
932
1004
|
transport: "http" | "subprocess";
|
|
@@ -938,7 +1010,7 @@ declare const aiConfigSchema: z.ZodObject<{
|
|
|
938
1010
|
rollingUsd?: number | undefined;
|
|
939
1011
|
} | undefined;
|
|
940
1012
|
}, {
|
|
941
|
-
defaults?: Partial<Record<"fast" | "smart" | "powerful" | "cheap" | "vision" | "embedding", {
|
|
1013
|
+
defaults?: Partial<Record<"fast" | "smart" | "powerful" | "cheap" | "vision" | "video" | "embedding", {
|
|
942
1014
|
provider: string;
|
|
943
1015
|
model: string;
|
|
944
1016
|
transport: "http" | "subprocess";
|
|
@@ -952,6 +1024,7 @@ declare const aiConfigSchema: z.ZodObject<{
|
|
|
952
1024
|
}>;
|
|
953
1025
|
type ChatInput = z.infer<typeof chatInputSchema>;
|
|
954
1026
|
type VisionInput = z.infer<typeof visionInputSchema>;
|
|
1027
|
+
type VideoInput = z.infer<typeof videoInputSchema>;
|
|
955
1028
|
type TranslateInput = z.infer<typeof translateInputSchema>;
|
|
956
1029
|
type ImageInput = z.infer<typeof imageInputSchema>;
|
|
957
1030
|
type EmbeddingInput = z.infer<typeof embeddingInputSchema>;
|
|
@@ -964,6 +1037,8 @@ interface AiClient {
|
|
|
964
1037
|
* caller owns the tool-loop (per-turn engine, not an agent runtime). */
|
|
965
1038
|
chatStream(input: ChatInput): AsyncIterable<ChatStreamEvent>;
|
|
966
1039
|
vision(input: VisionInput): Promise<ChatResult>;
|
|
1040
|
+
/** Video Vision (F019) — analyze a video natively. Default tier: "video". */
|
|
1041
|
+
video(input: VideoInput): Promise<ChatResult>;
|
|
967
1042
|
translate(input: TranslateInput): Promise<TranslateResult>;
|
|
968
1043
|
image(input: ImageInput): Promise<ImageResult>;
|
|
969
1044
|
embedding(input: EmbeddingInput): Promise<EmbeddingResult>;
|
|
@@ -1016,6 +1091,11 @@ declare function openrouterAdapter(config?: {
|
|
|
1016
1091
|
title?: string;
|
|
1017
1092
|
}): ProviderAdapter;
|
|
1018
1093
|
|
|
1094
|
+
declare function mistralAdapter(config?: {
|
|
1095
|
+
apiKey?: string;
|
|
1096
|
+
baseUrl?: string;
|
|
1097
|
+
}): ProviderAdapter;
|
|
1098
|
+
|
|
1019
1099
|
interface FalAdapterConfig {
|
|
1020
1100
|
apiKey?: string;
|
|
1021
1101
|
/** "sync" (default — fal.run, fast models) or "queue" (queue.fal.run, polled). */
|
|
@@ -1063,8 +1143,8 @@ declare const falStubAdapter: ProviderAdapter;
|
|
|
1063
1143
|
* wires the live adapters. */
|
|
1064
1144
|
declare const stubProviders: Record<string, ProviderAdapter>;
|
|
1065
1145
|
|
|
1066
|
-
declare const VERSION: "0.
|
|
1067
|
-
declare const SDK_TAG: "@broberg/ai-sdk@0.
|
|
1146
|
+
declare const VERSION: "0.6.0";
|
|
1147
|
+
declare const SDK_TAG: "@broberg/ai-sdk@0.6.0";
|
|
1068
1148
|
|
|
1069
1149
|
/** Built-in defaults. Every entry is overridable via AiConfig.defaults or a
|
|
1070
1150
|
* per-call override. Model IDs are current at scaffold time; callers pin their
|
|
@@ -1257,4 +1337,4 @@ interface StreamTransportRequest extends TransportRequest {
|
|
|
1257
1337
|
*/
|
|
1258
1338
|
declare function streamTransport(req: StreamTransportRequest): AsyncIterable<string>;
|
|
1259
1339
|
|
|
1260
|
-
export { type AiClient, type AiConfig, type BudgetConfig, BudgetExceededError, BudgetGuard, type BudgetStore, type CallOptions, type Capability, type ChatInput, type ChatRequest, type ChatResult, type ChatStreamEvent, type ClassifyInput, type ClassifyResult, type ContentPart, type Contracts, type CostSink, type CostSummary, DEFAULT_TIER_MAP, type DesignInput, type DesignResult, type DiscordSinkConfig, type EmbeddingInput, type EmbeddingRequest, type EmbeddingResult, type ExtractInput, type ExtractResult, type FalAdapterConfig, type HttpResponse, type ImageInput, type ImageRequest, type ImageResult, type Message, type MockupInput, type MockupResult, type OpenAICompatibleConfig, type PricingEntry, type ProviderAdapter, type RerankInput, type RerankResult, type Role, SDK_TAG, type SqliteBudgetStoreConfig, type SqliteSinkConfig, StreamHttpError, type SubprocessResponse, type Tier, type TierSpec, type Tool, type ToolCall, type TranscribeInput, type TranscribeRequest, type TranscribeResult, type TranslateInput, type TranslateResult, type Transport, type TransportRequest, type TransportResponse, type UpmetricsSinkConfig, type Usage, VERSION, type VisionInput, aiConfigSchema, anthropicAdapter, anthropicApiAdapter, anthropicSubprocessAdapter, chatInputSchema, computeCost, createAI, deepinfraAdapter, defaultProviders, discordSink, embeddingInputSchema, falAdapter, falStubAdapter, freshUsage, fromProviderToolCall, geminiAdapter, getCostSummary, getPrice, httpTransport, imageInputSchema, makeContracts, makeOpenAICompatibleAdapter, messageSchema, multiSink, noopSink, openaiAdapter, openaiStubAdapter, openrouterAdapter, parseClaudeCliJson, parseJsonLoose, resolveTier, sqliteBudgetStore, sqliteSink, streamTransport, stubProviders, subprocessTransport, tierSpecSchema, toProviderTools, toolSchema, translateInputSchema, upmetricsSink, visionInputSchema };
|
|
1340
|
+
export { type AiClient, type AiConfig, type BudgetConfig, BudgetExceededError, BudgetGuard, type BudgetStore, type CallOptions, type Capability, type ChatInput, type ChatRequest, type ChatResult, type ChatStreamEvent, type ClassifyInput, type ClassifyResult, type ContentPart, type Contracts, type CostSink, type CostSummary, DEFAULT_TIER_MAP, type DesignInput, type DesignResult, type DiscordSinkConfig, type EmbeddingInput, type EmbeddingRequest, type EmbeddingResult, type ExtractInput, type ExtractResult, type FalAdapterConfig, type HttpResponse, type ImageInput, type ImageRequest, type ImageResult, type Message, type MockupInput, type MockupResult, type OpenAICompatibleConfig, type PricingEntry, type ProviderAdapter, type RerankInput, type RerankResult, type Role, SDK_TAG, type SqliteBudgetStoreConfig, type SqliteSinkConfig, StreamHttpError, type SubprocessResponse, type Tier, type TierSpec, type Tool, type ToolCall, type TranscribeInput, type TranscribeRequest, type TranscribeResult, type TranslateInput, type TranslateResult, type Transport, type TransportRequest, type TransportResponse, type UpmetricsSinkConfig, type Usage, VERSION, type VideoInput, type VisionInput, aiConfigSchema, anthropicAdapter, anthropicApiAdapter, anthropicSubprocessAdapter, chatInputSchema, computeCost, createAI, deepinfraAdapter, defaultProviders, discordSink, embeddingInputSchema, falAdapter, falStubAdapter, freshUsage, fromProviderToolCall, geminiAdapter, getCostSummary, getPrice, httpTransport, imageInputSchema, makeContracts, makeOpenAICompatibleAdapter, messageSchema, mistralAdapter, multiSink, noopSink, openaiAdapter, openaiStubAdapter, openrouterAdapter, parseClaudeCliJson, parseJsonLoose, resolveTier, sqliteBudgetStore, sqliteSink, streamTransport, stubProviders, subprocessTransport, tierSpecSchema, toProviderTools, toolSchema, translateInputSchema, upmetricsSink, visionInputSchema };
|