@ai-sdk/cerebras 2.0.0-beta.64 → 2.0.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,61 @@
1
1
  # @ai-sdk/cerebras
2
2
 
3
+ ## 2.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - c0c8a0e: Add zai/glm-4.7 model support
8
+
9
+ ## 2.0.0
10
+
11
+ ### Major Changes
12
+
13
+ - dee8b05: ai SDK 6 beta
14
+
15
+ ### Minor Changes
16
+
17
+ - 78928cb: release: start 5.1 beta
18
+
19
+ ### Patch Changes
20
+
21
+ - 0c3b58b: fix(provider): add specificationVersion to ProviderV3
22
+ - 8d9e8ad: chore(provider): remove generics from EmbeddingModelV3
23
+
24
+ Before
25
+
26
+ ```ts
27
+ model.textEmbeddingModel('my-model-id');
28
+ ```
29
+
30
+ After
31
+
32
+ ```ts
33
+ model.embeddingModel('my-model-id');
34
+ ```
35
+
36
+ - 42e9f64: Add support for 5 new Cerebras models:
37
+
38
+ - gpt-oss-120b (120B parameters)
39
+ - qwen-3-235b-a22b-instruct-2507 (235B instruction-tuned)
40
+ - qwen-3-235b-a22b-thinking-2507 (235B enhanced reasoning)
41
+ - qwen-3-32b (32B multilingual)
42
+ - qwen-3-coder-480b (480B code generation)
43
+
44
+ Remove deprecated llama3.1-70b model.
45
+
46
+ - 95f65c2: chore: use import \* from zod/v4
47
+ - 4d34a89: feat (provider/cerebras): enable structured outputs
48
+ - ed329cb: feat: `Provider-V3`
49
+ - 1cad0ab: feat: add provider version to user-agent header
50
+ - 5e1e0ed: fix(cerebras): update model IDs based on https://inference-docs.cerebras.ai/models/overview
51
+ - 8dac895: feat: `LanguageModelV3`
52
+ - 366f50b: chore(provider): add deprecated textEmbeddingModel and textEmbedding aliases
53
+ - 4616b86: chore: update zod peer depenedency version
54
+ - Updated dependencies
55
+ - @ai-sdk/openai-compatible@2.0.0
56
+ - @ai-sdk/provider@3.0.0
57
+ - @ai-sdk/provider-utils@4.0.0
58
+
3
59
  ## 2.0.0-beta.64
4
60
 
5
61
  ### Patch Changes
@@ -444,8 +500,7 @@
444
500
  ### Patch Changes
445
501
 
446
502
  - 95f65c2: chore: use import \* from zod/v4
447
- - Updated dependencies [95f65c2]
448
- - Updated dependencies [95f65c2]
503
+ - Updated dependencies
449
504
  - @ai-sdk/openai-compatible@2.0.0-beta.11
450
505
  - @ai-sdk/provider-utils@4.0.0-beta.11
451
506
 
@@ -509,8 +564,7 @@
509
564
 
510
565
  ### Patch Changes
511
566
 
512
- - Updated dependencies [046aa3b]
513
- - Updated dependencies [e8109d3]
567
+ - Updated dependencies
514
568
  - @ai-sdk/provider@2.1.0-beta.5
515
569
  - @ai-sdk/openai-compatible@1.1.0-beta.7
516
570
  - @ai-sdk/provider-utils@3.1.0-beta.7
@@ -519,8 +573,7 @@
519
573
 
520
574
  ### Patch Changes
521
575
 
522
- - Updated dependencies [0adc679]
523
- - Updated dependencies [2b0caef]
576
+ - Updated dependencies
524
577
  - @ai-sdk/openai-compatible@1.1.0-beta.6
525
578
  - @ai-sdk/provider-utils@3.1.0-beta.6
526
579
  - @ai-sdk/provider@2.1.0-beta.4
@@ -530,8 +583,7 @@
530
583
  ### Patch Changes
531
584
 
532
585
  - 8dac895: feat: `LanguageModelV3`
533
- - Updated dependencies [8dac895]
534
- - Updated dependencies [10c1322]
586
+ - Updated dependencies
535
587
  - @ai-sdk/openai-compatible@1.1.0-beta.5
536
588
  - @ai-sdk/provider-utils@3.1.0-beta.5
537
589
  - @ai-sdk/provider@2.1.0-beta.3
@@ -550,8 +602,7 @@
550
602
  ### Patch Changes
551
603
 
552
604
  - ed329cb: feat: `Provider-V3`
553
- - Updated dependencies [ed329cb]
554
- - Updated dependencies [522f6b8]
605
+ - Updated dependencies
555
606
  - @ai-sdk/openai-compatible@1.1.0-beta.3
556
607
  - @ai-sdk/provider@2.1.0-beta.2
557
608
  - @ai-sdk/provider-utils@3.1.0-beta.3
@@ -680,8 +731,7 @@
680
731
 
681
732
  ### Patch Changes
682
733
 
683
- - Updated dependencies [034e229]
684
- - Updated dependencies [f25040d]
734
+ - Updated dependencies
685
735
  - @ai-sdk/provider-utils@3.0.3
686
736
  - @ai-sdk/openai-compatible@1.0.7
687
737
 
@@ -697,16 +747,14 @@
697
747
 
698
748
  ### Patch Changes
699
749
 
700
- - Updated dependencies [8f8a521]
701
- - Updated dependencies [e92b78b]
750
+ - Updated dependencies
702
751
  - @ai-sdk/openai-compatible@1.0.5
703
752
 
704
753
  ## 1.0.4
705
754
 
706
755
  ### Patch Changes
707
756
 
708
- - Updated dependencies [5f4c71f]
709
- - Updated dependencies [da314cd]
757
+ - Updated dependencies
710
758
  - @ai-sdk/openai-compatible@1.0.4
711
759
 
712
760
  ## 1.0.3
@@ -720,8 +768,7 @@
720
768
 
721
769
  ### Patch Changes
722
770
 
723
- - Updated dependencies [b499112]
724
- - Updated dependencies [90d212f]
771
+ - Updated dependencies
725
772
  - @ai-sdk/openai-compatible@1.0.2
726
773
  - @ai-sdk/provider-utils@3.0.1
727
774
 
@@ -744,120 +791,7 @@
744
791
  - e2aceaf: feat: add raw chunk support
745
792
  - d1a034f: feature: using Zod 4 for internal stuff
746
793
  - 205077b: fix: improve Zod compatibility
747
- - Updated dependencies [a571d6e]
748
- - Updated dependencies [742b7be]
749
- - Updated dependencies [e7fcc86]
750
- - Updated dependencies [7cddb72]
751
- - Updated dependencies [ccce59b]
752
- - Updated dependencies [e2b9e4b]
753
- - Updated dependencies [95857aa]
754
- - Updated dependencies [45c1ea2]
755
- - Updated dependencies [6f6bb89]
756
- - Updated dependencies [060370c]
757
- - Updated dependencies [dc714f3]
758
- - Updated dependencies [b5da06a]
759
- - Updated dependencies [d1a1aa1]
760
- - Updated dependencies [63f9e9b]
761
- - Updated dependencies [5d142ab]
762
- - Updated dependencies [d5f588f]
763
- - Updated dependencies [e025824]
764
- - Updated dependencies [0571b98]
765
- - Updated dependencies [6db02c9]
766
- - Updated dependencies [b6b43c7]
767
- - Updated dependencies [4fef487]
768
- - Updated dependencies [48d257a]
769
- - Updated dependencies [0c0c0b3]
770
- - Updated dependencies [0d2c085]
771
- - Updated dependencies [fa49207]
772
- - Updated dependencies [40acf9b]
773
- - Updated dependencies [cf8280e]
774
- - Updated dependencies [9222aeb]
775
- - Updated dependencies [b9a6121]
776
- - Updated dependencies [e2aceaf]
777
- - Updated dependencies [411e483]
778
- - Updated dependencies [8ba77a7]
779
- - Updated dependencies [db72adc]
780
- - Updated dependencies [7b3ae3f]
781
- - Updated dependencies [a166433]
782
- - Updated dependencies [26735b5]
783
- - Updated dependencies [443d8ec]
784
- - Updated dependencies [42e32b0]
785
- - Updated dependencies [a8c8bd5]
786
- - Updated dependencies [abf9a79]
787
- - Updated dependencies [14c9410]
788
- - Updated dependencies [e86be6f]
789
- - Updated dependencies [9bf7291]
790
- - Updated dependencies [2e13791]
791
- - Updated dependencies [7b069ed]
792
- - Updated dependencies [9f95b35]
793
- - Updated dependencies [66962ed]
794
- - Updated dependencies [0d06df6]
795
- - Updated dependencies [472524a]
796
- - Updated dependencies [dd3ff01]
797
- - Updated dependencies [d9209ca]
798
- - Updated dependencies [d9c98f4]
799
- - Updated dependencies [05d2819]
800
- - Updated dependencies [9301f86]
801
- - Updated dependencies [0a87932]
802
- - Updated dependencies [737f1e2]
803
- - Updated dependencies [c4a2fec]
804
- - Updated dependencies [957b739]
805
- - Updated dependencies [79457bd]
806
- - Updated dependencies [a3f768e]
807
- - Updated dependencies [7435eb5]
808
- - Updated dependencies [8aa9e20]
809
- - Updated dependencies [4617fab]
810
- - Updated dependencies [516be5b]
811
- - Updated dependencies [ac34802]
812
- - Updated dependencies [0054544]
813
- - Updated dependencies [cb68df0]
814
- - Updated dependencies [ad80501]
815
- - Updated dependencies [68ecf2f]
816
- - Updated dependencies [9e9c809]
817
- - Updated dependencies [32831c6]
818
- - Updated dependencies [6dc848c]
819
- - Updated dependencies [6b98118]
820
- - Updated dependencies [d0f9495]
821
- - Updated dependencies [63d791d]
822
- - Updated dependencies [87b828f]
823
- - Updated dependencies [3f2f00c]
824
- - Updated dependencies [bfdca8d]
825
- - Updated dependencies [0ff02bb]
826
- - Updated dependencies [7979f7f]
827
- - Updated dependencies [39a4fab]
828
- - Updated dependencies [44f4aba]
829
- - Updated dependencies [9bd5ab5]
830
- - Updated dependencies [57edfcb]
831
- - Updated dependencies [faf8446]
832
- - Updated dependencies [7ea4132]
833
- - Updated dependencies [d1a034f]
834
- - Updated dependencies [5c56081]
835
- - Updated dependencies [fd65bc6]
836
- - Updated dependencies [023ba40]
837
- - Updated dependencies [ea7a7c9]
838
- - Updated dependencies [1b101e1]
839
- - Updated dependencies [26535e0]
840
- - Updated dependencies [e030615]
841
- - Updated dependencies [5e57fae]
842
- - Updated dependencies [393138b]
843
- - Updated dependencies [c57e248]
844
- - Updated dependencies [88a8ee5]
845
- - Updated dependencies [41fa418]
846
- - Updated dependencies [205077b]
847
- - Updated dependencies [71f938d]
848
- - Updated dependencies [3795467]
849
- - Updated dependencies [28a5ed5]
850
- - Updated dependencies [7182d14]
851
- - Updated dependencies [c1e6647]
852
- - Updated dependencies [1766ede]
853
- - Updated dependencies [811dff3]
854
- - Updated dependencies [f10304b]
855
- - Updated dependencies [dd5fd43]
856
- - Updated dependencies [33f4a6a]
857
- - Updated dependencies [383cbfa]
858
- - Updated dependencies [27deb4d]
859
- - Updated dependencies [c4df419]
860
- - Updated dependencies [281bb1c]
794
+ - Updated dependencies
861
795
  - @ai-sdk/provider-utils@3.0.0
862
796
  - @ai-sdk/provider@2.0.0
863
797
  - @ai-sdk/openai-compatible@1.0.0
@@ -899,8 +833,7 @@
899
833
 
900
834
  ### Patch Changes
901
835
 
902
- - Updated dependencies [737f1e2]
903
- - Updated dependencies [ac34802]
836
+ - Updated dependencies
904
837
  - @ai-sdk/openai-compatible@1.0.0-beta.9
905
838
  - @ai-sdk/provider-utils@3.0.0-beta.6
906
839
 
@@ -908,8 +841,7 @@
908
841
 
909
842
  ### Patch Changes
910
843
 
911
- - Updated dependencies [57edfcb]
912
- - Updated dependencies [383cbfa]
844
+ - Updated dependencies
913
845
  - @ai-sdk/provider-utils@3.0.0-beta.5
914
846
  - @ai-sdk/openai-compatible@1.0.0-beta.8
915
847
 
@@ -956,9 +888,7 @@
956
888
  ### Patch Changes
957
889
 
958
890
  - d1a034f: feature: using Zod 4 for internal stuff
959
- - Updated dependencies [0571b98]
960
- - Updated dependencies [39a4fab]
961
- - Updated dependencies [d1a034f]
891
+ - Updated dependencies
962
892
  - @ai-sdk/provider-utils@3.0.0-beta.2
963
893
  - @ai-sdk/openai-compatible@1.0.0-beta.2
964
894
 
@@ -966,23 +896,7 @@
966
896
 
967
897
  ### Patch Changes
968
898
 
969
- - Updated dependencies [742b7be]
970
- - Updated dependencies [7cddb72]
971
- - Updated dependencies [ccce59b]
972
- - Updated dependencies [e2b9e4b]
973
- - Updated dependencies [45c1ea2]
974
- - Updated dependencies [e025824]
975
- - Updated dependencies [0d06df6]
976
- - Updated dependencies [472524a]
977
- - Updated dependencies [dd3ff01]
978
- - Updated dependencies [7435eb5]
979
- - Updated dependencies [cb68df0]
980
- - Updated dependencies [bfdca8d]
981
- - Updated dependencies [44f4aba]
982
- - Updated dependencies [023ba40]
983
- - Updated dependencies [5e57fae]
984
- - Updated dependencies [71f938d]
985
- - Updated dependencies [28a5ed5]
899
+ - Updated dependencies
986
900
  - @ai-sdk/provider@2.0.0-beta.1
987
901
  - @ai-sdk/provider-utils@3.0.0-beta.1
988
902
  - @ai-sdk/openai-compatible@1.0.0-beta.1
@@ -991,8 +905,7 @@
991
905
 
992
906
  ### Patch Changes
993
907
 
994
- - Updated dependencies [48d257a]
995
- - Updated dependencies [8ba77a7]
908
+ - Updated dependencies
996
909
  - @ai-sdk/provider@2.0.0-alpha.15
997
910
  - @ai-sdk/provider-utils@3.0.0-alpha.15
998
911
  - @ai-sdk/openai-compatible@1.0.0-alpha.15
@@ -1001,9 +914,7 @@
1001
914
 
1002
915
  ### Patch Changes
1003
916
 
1004
- - Updated dependencies [b5da06a]
1005
- - Updated dependencies [63f9e9b]
1006
- - Updated dependencies [2e13791]
917
+ - Updated dependencies
1007
918
  - @ai-sdk/provider@2.0.0-alpha.14
1008
919
  - @ai-sdk/openai-compatible@1.0.0-alpha.14
1009
920
  - @ai-sdk/provider-utils@3.0.0-alpha.14
@@ -1058,8 +969,7 @@
1058
969
 
1059
970
  ### Patch Changes
1060
971
 
1061
- - Updated dependencies [4fef487]
1062
- - Updated dependencies [9222aeb]
972
+ - Updated dependencies
1063
973
  - @ai-sdk/provider-utils@3.0.0-alpha.8
1064
974
  - @ai-sdk/provider@2.0.0-alpha.8
1065
975
  - @ai-sdk/openai-compatible@1.0.0-alpha.8
@@ -1138,8 +1048,7 @@
1138
1048
 
1139
1049
  ### Patch Changes
1140
1050
 
1141
- - Updated dependencies [516be5b]
1142
- - Updated dependencies [ea7a7c9]
1051
+ - Updated dependencies
1143
1052
  - @ai-sdk/openai-compatible@1.0.0-canary.17
1144
1053
  - @ai-sdk/provider-utils@3.0.0-canary.17
1145
1054
 
@@ -1155,10 +1064,7 @@
1155
1064
 
1156
1065
  ### Patch Changes
1157
1066
 
1158
- - Updated dependencies [a571d6e]
1159
- - Updated dependencies [a8c8bd5]
1160
- - Updated dependencies [7979f7f]
1161
- - Updated dependencies [41fa418]
1067
+ - Updated dependencies
1162
1068
  - @ai-sdk/provider-utils@3.0.0-canary.15
1163
1069
  - @ai-sdk/provider@2.0.0-canary.14
1164
1070
  - @ai-sdk/openai-compatible@1.0.0-canary.15
@@ -1167,8 +1073,7 @@
1167
1073
 
1168
1074
  ### Patch Changes
1169
1075
 
1170
- - Updated dependencies [957b739]
1171
- - Updated dependencies [9bd5ab5]
1076
+ - Updated dependencies
1172
1077
  - @ai-sdk/provider-utils@3.0.0-canary.14
1173
1078
  - @ai-sdk/provider@2.0.0-canary.13
1174
1079
  - @ai-sdk/openai-compatible@1.0.0-canary.14
@@ -1177,9 +1082,7 @@
1177
1082
 
1178
1083
  ### Patch Changes
1179
1084
 
1180
- - Updated dependencies [7b3ae3f]
1181
- - Updated dependencies [d9209ca]
1182
- - Updated dependencies [0ff02bb]
1085
+ - Updated dependencies
1183
1086
  - @ai-sdk/provider@2.0.0-canary.12
1184
1087
  - @ai-sdk/openai-compatible@1.0.0-canary.13
1185
1088
  - @ai-sdk/provider-utils@3.0.0-canary.13
@@ -1188,9 +1091,7 @@
1188
1091
 
1189
1092
  ### Patch Changes
1190
1093
 
1191
- - Updated dependencies [9bf7291]
1192
- - Updated dependencies [4617fab]
1193
- - Updated dependencies [e030615]
1094
+ - Updated dependencies
1194
1095
  - @ai-sdk/provider@2.0.0-canary.11
1195
1096
  - @ai-sdk/openai-compatible@1.0.0-canary.12
1196
1097
  - @ai-sdk/provider-utils@3.0.0-canary.12
@@ -1199,11 +1100,7 @@
1199
1100
 
1200
1101
  ### Patch Changes
1201
1102
 
1202
- - Updated dependencies [db72adc]
1203
- - Updated dependencies [42e32b0]
1204
- - Updated dependencies [66962ed]
1205
- - Updated dependencies [9301f86]
1206
- - Updated dependencies [a3f768e]
1103
+ - Updated dependencies
1207
1104
  - @ai-sdk/openai-compatible@1.0.0-canary.11
1208
1105
  - @ai-sdk/provider-utils@3.0.0-canary.11
1209
1106
  - @ai-sdk/provider@2.0.0-canary.10
@@ -1212,8 +1109,7 @@
1212
1109
 
1213
1110
  ### Patch Changes
1214
1111
 
1215
- - Updated dependencies [cf8280e]
1216
- - Updated dependencies [e86be6f]
1112
+ - Updated dependencies
1217
1113
  - @ai-sdk/openai-compatible@1.0.0-canary.10
1218
1114
  - @ai-sdk/provider@2.0.0-canary.9
1219
1115
  - @ai-sdk/provider-utils@3.0.0-canary.10
@@ -1222,8 +1118,7 @@
1222
1118
 
1223
1119
  ### Patch Changes
1224
1120
 
1225
- - Updated dependencies [95857aa]
1226
- - Updated dependencies [7ea4132]
1121
+ - Updated dependencies
1227
1122
  - @ai-sdk/provider@2.0.0-canary.8
1228
1123
  - @ai-sdk/openai-compatible@1.0.0-canary.9
1229
1124
  - @ai-sdk/provider-utils@3.0.0-canary.9
@@ -1232,11 +1127,7 @@
1232
1127
 
1233
1128
  ### Patch Changes
1234
1129
 
1235
- - Updated dependencies [5d142ab]
1236
- - Updated dependencies [b6b43c7]
1237
- - Updated dependencies [b9a6121]
1238
- - Updated dependencies [8aa9e20]
1239
- - Updated dependencies [3795467]
1130
+ - Updated dependencies
1240
1131
  - @ai-sdk/provider-utils@3.0.0-canary.8
1241
1132
  - @ai-sdk/provider@2.0.0-canary.7
1242
1133
  - @ai-sdk/openai-compatible@1.0.0-canary.8
@@ -1246,19 +1137,7 @@
1246
1137
  ### Patch Changes
1247
1138
 
1248
1139
  - fa49207: feat(providers/openai-compatible): convert to providerOptions
1249
- - Updated dependencies [fa49207]
1250
- - Updated dependencies [26735b5]
1251
- - Updated dependencies [443d8ec]
1252
- - Updated dependencies [14c9410]
1253
- - Updated dependencies [d9c98f4]
1254
- - Updated dependencies [c4a2fec]
1255
- - Updated dependencies [0054544]
1256
- - Updated dependencies [9e9c809]
1257
- - Updated dependencies [32831c6]
1258
- - Updated dependencies [d0f9495]
1259
- - Updated dependencies [fd65bc6]
1260
- - Updated dependencies [393138b]
1261
- - Updated dependencies [7182d14]
1140
+ - Updated dependencies
1262
1141
  - @ai-sdk/openai-compatible@1.0.0-canary.7
1263
1142
  - @ai-sdk/provider@2.0.0-canary.6
1264
1143
  - @ai-sdk/provider-utils@3.0.0-canary.7
@@ -1267,12 +1146,7 @@
1267
1146
 
1268
1147
  ### Patch Changes
1269
1148
 
1270
- - Updated dependencies [6db02c9]
1271
- - Updated dependencies [411e483]
1272
- - Updated dependencies [79457bd]
1273
- - Updated dependencies [ad80501]
1274
- - Updated dependencies [1766ede]
1275
- - Updated dependencies [f10304b]
1149
+ - Updated dependencies
1276
1150
  - @ai-sdk/openai-compatible@1.0.0-canary.6
1277
1151
  - @ai-sdk/provider@2.0.0-canary.5
1278
1152
  - @ai-sdk/provider-utils@3.0.0-canary.6
@@ -1299,11 +1173,7 @@
1299
1173
 
1300
1174
  ### Patch Changes
1301
1175
 
1302
- - Updated dependencies [a166433]
1303
- - Updated dependencies [abf9a79]
1304
- - Updated dependencies [9f95b35]
1305
- - Updated dependencies [0a87932]
1306
- - Updated dependencies [6dc848c]
1176
+ - Updated dependencies
1307
1177
  - @ai-sdk/provider-utils@3.0.0-canary.3
1308
1178
  - @ai-sdk/provider@2.0.0-canary.2
1309
1179
  - @ai-sdk/openai-compatible@1.0.0-canary.3
@@ -1312,8 +1182,7 @@
1312
1182
 
1313
1183
  ### Patch Changes
1314
1184
 
1315
- - Updated dependencies [c57e248]
1316
- - Updated dependencies [33f4a6a]
1185
+ - Updated dependencies
1317
1186
  - @ai-sdk/provider@2.0.0-canary.1
1318
1187
  - @ai-sdk/openai-compatible@1.0.0-canary.2
1319
1188
  - @ai-sdk/provider-utils@3.0.0-canary.2
@@ -1322,9 +1191,7 @@
1322
1191
 
1323
1192
  ### Patch Changes
1324
1193
 
1325
- - Updated dependencies [060370c]
1326
- - Updated dependencies [0c0c0b3]
1327
- - Updated dependencies [63d791d]
1194
+ - Updated dependencies
1328
1195
  - @ai-sdk/provider-utils@3.0.0-canary.1
1329
1196
  - @ai-sdk/openai-compatible@1.0.0-canary.1
1330
1197
 
@@ -1520,8 +1387,7 @@
1520
1387
 
1521
1388
  ### Patch Changes
1522
1389
 
1523
- - Updated dependencies [ed012d2]
1524
- - Updated dependencies [3a58a2e]
1390
+ - Updated dependencies
1525
1391
  - @ai-sdk/openai-compatible@0.1.2
1526
1392
  - @ai-sdk/provider-utils@2.1.2
1527
1393
  - @ai-sdk/provider@1.0.6
@@ -1530,8 +1396,7 @@
1530
1396
 
1531
1397
  ### Patch Changes
1532
1398
 
1533
- - Updated dependencies [e7a9ec9]
1534
- - Updated dependencies [0a699f1]
1399
+ - Updated dependencies
1535
1400
  - @ai-sdk/provider-utils@2.1.1
1536
1401
  - @ai-sdk/openai-compatible@0.1.1
1537
1402
  - @ai-sdk/provider@1.0.5
package/dist/index.d.mts CHANGED
@@ -2,7 +2,7 @@ import { ProviderV3, LanguageModelV3 } from '@ai-sdk/provider';
2
2
  import { FetchFunction } from '@ai-sdk/provider-utils';
3
3
  import { z } from 'zod/v4';
4
4
 
5
- type CerebrasChatModelId = 'llama3.1-8b' | 'llama-3.3-70b' | 'gpt-oss-120b' | 'qwen-3-32b' | 'qwen-3-235b-a22b-instruct-2507' | 'qwen-3-235b-a22b-thinking-2507' | 'zai-glm-4.6' | (string & {});
5
+ type CerebrasChatModelId = 'llama3.1-8b' | 'llama-3.3-70b' | 'gpt-oss-120b' | 'qwen-3-32b' | 'qwen-3-235b-a22b-instruct-2507' | 'qwen-3-235b-a22b-thinking-2507' | 'zai-glm-4.6' | 'zai-glm-4.7' | (string & {});
6
6
 
7
7
  declare const cerebrasErrorSchema: z.ZodObject<{
8
8
  message: z.ZodString;
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import { ProviderV3, LanguageModelV3 } from '@ai-sdk/provider';
2
2
  import { FetchFunction } from '@ai-sdk/provider-utils';
3
3
  import { z } from 'zod/v4';
4
4
 
5
- type CerebrasChatModelId = 'llama3.1-8b' | 'llama-3.3-70b' | 'gpt-oss-120b' | 'qwen-3-32b' | 'qwen-3-235b-a22b-instruct-2507' | 'qwen-3-235b-a22b-thinking-2507' | 'zai-glm-4.6' | (string & {});
5
+ type CerebrasChatModelId = 'llama3.1-8b' | 'llama-3.3-70b' | 'gpt-oss-120b' | 'qwen-3-32b' | 'qwen-3-235b-a22b-instruct-2507' | 'qwen-3-235b-a22b-thinking-2507' | 'zai-glm-4.6' | 'zai-glm-4.7' | (string & {});
6
6
 
7
7
  declare const cerebrasErrorSchema: z.ZodObject<{
8
8
  message: z.ZodString;
package/dist/index.js CHANGED
@@ -33,7 +33,7 @@ var import_provider_utils = require("@ai-sdk/provider-utils");
33
33
  var import_v4 = require("zod/v4");
34
34
 
35
35
  // src/version.ts
36
- var VERSION = true ? "2.0.0-beta.64" : "0.0.0-test";
36
+ var VERSION = true ? "2.0.1" : "0.0.0-test";
37
37
 
38
38
  // src/cerebras-provider.ts
39
39
  var cerebrasErrorSchema = import_v4.z.object({
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/cerebras-provider.ts","../src/version.ts"],"sourcesContent":["export { createCerebras, cerebras } from './cerebras-provider';\nexport type {\n CerebrasProvider,\n CerebrasProviderSettings,\n} from './cerebras-provider';\nexport type { CerebrasErrorData } from './cerebras-provider';\nexport { VERSION } from './version';\n","import { OpenAICompatibleChatLanguageModel } from '@ai-sdk/openai-compatible';\nimport {\n LanguageModelV3,\n NoSuchModelError,\n ProviderV3,\n} from '@ai-sdk/provider';\nimport {\n FetchFunction,\n loadApiKey,\n withoutTrailingSlash,\n withUserAgentSuffix,\n} from '@ai-sdk/provider-utils';\nimport { CerebrasChatModelId } from './cerebras-chat-options';\nimport { z } from 'zod/v4';\nimport { ProviderErrorStructure } from '@ai-sdk/openai-compatible';\nimport { VERSION } from './version';\n\n// Add error schema and structure\nconst cerebrasErrorSchema = z.object({\n message: z.string(),\n type: z.string(),\n param: z.string(),\n code: z.string(),\n});\n\nexport type CerebrasErrorData = z.infer<typeof cerebrasErrorSchema>;\n\nconst cerebrasErrorStructure: ProviderErrorStructure<CerebrasErrorData> = {\n errorSchema: cerebrasErrorSchema,\n errorToMessage: data => data.message,\n};\n\nexport interface CerebrasProviderSettings {\n /**\nCerebras API key.\n*/\n apiKey?: string;\n /**\nBase URL for the API calls.\n*/\n baseURL?: string;\n /**\nCustom headers to include in the requests.\n*/\n headers?: Record<string, string>;\n /**\nCustom fetch implementation. You can use it as a middleware to intercept requests,\nor to provide a custom fetch implementation for e.g. testing.\n*/\n fetch?: FetchFunction;\n}\n\nexport interface CerebrasProvider extends ProviderV3 {\n /**\nCreates a Cerebras model for text generation.\n*/\n (modelId: CerebrasChatModelId): LanguageModelV3;\n\n /**\nCreates a Cerebras model for text generation.\n*/\n languageModel(modelId: CerebrasChatModelId): LanguageModelV3;\n\n /**\nCreates a Cerebras chat model for text generation.\n*/\n chat(modelId: CerebrasChatModelId): LanguageModelV3;\n\n /**\n * @deprecated Use `embeddingModel` instead.\n */\n textEmbeddingModel(modelId: string): never;\n}\n\nexport function createCerebras(\n options: CerebrasProviderSettings = {},\n): CerebrasProvider {\n const baseURL = withoutTrailingSlash(\n options.baseURL ?? 'https://api.cerebras.ai/v1',\n );\n const getHeaders = () =>\n withUserAgentSuffix(\n {\n Authorization: `Bearer ${loadApiKey({\n apiKey: options.apiKey,\n environmentVariableName: 'CEREBRAS_API_KEY',\n description: 'Cerebras API key',\n })}`,\n ...options.headers,\n },\n `ai-sdk/cerebras/${VERSION}`,\n );\n\n const createLanguageModel = (modelId: CerebrasChatModelId) => {\n return new OpenAICompatibleChatLanguageModel(modelId, {\n provider: `cerebras.chat`,\n url: ({ path }) => `${baseURL}${path}`,\n headers: getHeaders,\n fetch: options.fetch,\n errorStructure: cerebrasErrorStructure,\n supportsStructuredOutputs: true,\n });\n };\n\n const provider = (modelId: CerebrasChatModelId) =>\n createLanguageModel(modelId);\n\n provider.specificationVersion = 'v3' as const;\n provider.languageModel = createLanguageModel;\n provider.chat = createLanguageModel;\n\n provider.embeddingModel = (modelId: string) => {\n throw new NoSuchModelError({ modelId, modelType: 'embeddingModel' });\n };\n provider.textEmbeddingModel = provider.embeddingModel;\n provider.imageModel = (modelId: string) => {\n throw new NoSuchModelError({ modelId, modelType: 'imageModel' });\n };\n\n return provider;\n}\n\nexport const cerebras = createCerebras();\n","// Version string of this package injected at build time.\ndeclare const __PACKAGE_VERSION__: string | undefined;\nexport const VERSION: string =\n typeof __PACKAGE_VERSION__ !== 'undefined'\n ? __PACKAGE_VERSION__\n : '0.0.0-test';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,+BAAkD;AAClD,sBAIO;AACP,4BAKO;AAEP,gBAAkB;;;ACXX,IAAM,UACX,OACI,kBACA;;;ADaN,IAAM,sBAAsB,YAAE,OAAO;AAAA,EACnC,SAAS,YAAE,OAAO;AAAA,EAClB,MAAM,YAAE,OAAO;AAAA,EACf,OAAO,YAAE,OAAO;AAAA,EAChB,MAAM,YAAE,OAAO;AACjB,CAAC;AAID,IAAM,yBAAoE;AAAA,EACxE,aAAa;AAAA,EACb,gBAAgB,UAAQ,KAAK;AAC/B;AA4CO,SAAS,eACd,UAAoC,CAAC,GACnB;AA5EpB;AA6EE,QAAM,cAAU;AAAA,KACd,aAAQ,YAAR,YAAmB;AAAA,EACrB;AACA,QAAM,aAAa,UACjB;AAAA,IACE;AAAA,MACE,eAAe,cAAU,kCAAW;AAAA,QAClC,QAAQ,QAAQ;AAAA,QAChB,yBAAyB;AAAA,QACzB,aAAa;AAAA,MACf,CAAC,CAAC;AAAA,MACF,GAAG,QAAQ;AAAA,IACb;AAAA,IACA,mBAAmB,OAAO;AAAA,EAC5B;AAEF,QAAM,sBAAsB,CAAC,YAAiC;AAC5D,WAAO,IAAI,2DAAkC,SAAS;AAAA,MACpD,UAAU;AAAA,MACV,KAAK,CAAC,EAAE,KAAK,MAAM,GAAG,OAAO,GAAG,IAAI;AAAA,MACpC,SAAS;AAAA,MACT,OAAO,QAAQ;AAAA,MACf,gBAAgB;AAAA,MAChB,2BAA2B;AAAA,IAC7B,CAAC;AAAA,EACH;AAEA,QAAM,WAAW,CAAC,YAChB,oBAAoB,OAAO;AAE7B,WAAS,uBAAuB;AAChC,WAAS,gBAAgB;AACzB,WAAS,OAAO;AAEhB,WAAS,iBAAiB,CAAC,YAAoB;AAC7C,UAAM,IAAI,iCAAiB,EAAE,SAAS,WAAW,iBAAiB,CAAC;AAAA,EACrE;AACA,WAAS,qBAAqB,SAAS;AACvC,WAAS,aAAa,CAAC,YAAoB;AACzC,UAAM,IAAI,iCAAiB,EAAE,SAAS,WAAW,aAAa,CAAC;AAAA,EACjE;AAEA,SAAO;AACT;AAEO,IAAM,WAAW,eAAe;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts","../src/cerebras-provider.ts","../src/version.ts"],"sourcesContent":["export { createCerebras, cerebras } from './cerebras-provider';\nexport type {\n CerebrasProvider,\n CerebrasProviderSettings,\n} from './cerebras-provider';\nexport type { CerebrasErrorData } from './cerebras-provider';\nexport { VERSION } from './version';\n","import { OpenAICompatibleChatLanguageModel } from '@ai-sdk/openai-compatible';\nimport {\n LanguageModelV3,\n NoSuchModelError,\n ProviderV3,\n} from '@ai-sdk/provider';\nimport {\n FetchFunction,\n loadApiKey,\n withoutTrailingSlash,\n withUserAgentSuffix,\n} from '@ai-sdk/provider-utils';\nimport { CerebrasChatModelId } from './cerebras-chat-options';\nimport { z } from 'zod/v4';\nimport { ProviderErrorStructure } from '@ai-sdk/openai-compatible';\nimport { VERSION } from './version';\n\n// Add error schema and structure\nconst cerebrasErrorSchema = z.object({\n message: z.string(),\n type: z.string(),\n param: z.string(),\n code: z.string(),\n});\n\nexport type CerebrasErrorData = z.infer<typeof cerebrasErrorSchema>;\n\nconst cerebrasErrorStructure: ProviderErrorStructure<CerebrasErrorData> = {\n errorSchema: cerebrasErrorSchema,\n errorToMessage: data => data.message,\n};\n\nexport interface CerebrasProviderSettings {\n /**\nCerebras API key.\n*/\n apiKey?: string;\n /**\nBase URL for the API calls.\n*/\n baseURL?: string;\n /**\nCustom headers to include in the requests.\n*/\n headers?: Record<string, string>;\n /**\nCustom fetch implementation. You can use it as a middleware to intercept requests,\nor to provide a custom fetch implementation for e.g. testing.\n*/\n fetch?: FetchFunction;\n}\n\nexport interface CerebrasProvider extends ProviderV3 {\n /**\nCreates a Cerebras model for text generation.\n*/\n (modelId: CerebrasChatModelId): LanguageModelV3;\n\n /**\nCreates a Cerebras model for text generation.\n*/\n languageModel(modelId: CerebrasChatModelId): LanguageModelV3;\n\n /**\nCreates a Cerebras chat model for text generation.\n*/\n chat(modelId: CerebrasChatModelId): LanguageModelV3;\n\n /**\n * @deprecated Use `embeddingModel` instead.\n */\n textEmbeddingModel(modelId: string): never;\n}\n\nexport function createCerebras(\n options: CerebrasProviderSettings = {},\n): CerebrasProvider {\n const baseURL = withoutTrailingSlash(\n options.baseURL ?? 'https://api.cerebras.ai/v1',\n );\n const getHeaders = () =>\n withUserAgentSuffix(\n {\n Authorization: `Bearer ${loadApiKey({\n apiKey: options.apiKey,\n environmentVariableName: 'CEREBRAS_API_KEY',\n description: 'Cerebras API key',\n })}`,\n ...options.headers,\n },\n `ai-sdk/cerebras/${VERSION}`,\n );\n\n const createLanguageModel = (modelId: CerebrasChatModelId) => {\n return new OpenAICompatibleChatLanguageModel(modelId, {\n provider: `cerebras.chat`,\n url: ({ path }) => `${baseURL}${path}`,\n headers: getHeaders,\n fetch: options.fetch,\n errorStructure: cerebrasErrorStructure,\n supportsStructuredOutputs: true,\n });\n };\n\n const provider = (modelId: CerebrasChatModelId) =>\n createLanguageModel(modelId);\n\n provider.specificationVersion = 'v3' as const;\n provider.languageModel = createLanguageModel;\n provider.chat = createLanguageModel;\n\n provider.embeddingModel = (modelId: string) => {\n throw new NoSuchModelError({ modelId, modelType: 'embeddingModel' });\n };\n provider.textEmbeddingModel = provider.embeddingModel;\n provider.imageModel = (modelId: string) => {\n throw new NoSuchModelError({ modelId, modelType: 'imageModel' });\n };\n\n return provider;\n}\n\nexport const cerebras = createCerebras();\n","// Version string of this package injected at build time.\ndeclare const __PACKAGE_VERSION__: string | undefined;\nexport const VERSION: string =\n typeof __PACKAGE_VERSION__ !== 'undefined'\n ? __PACKAGE_VERSION__\n : '0.0.0-test';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,+BAAkD;AAClD,sBAIO;AACP,4BAKO;AAEP,gBAAkB;;;ACXX,IAAM,UACX,OACI,UACA;;;ADaN,IAAM,sBAAsB,YAAE,OAAO;AAAA,EACnC,SAAS,YAAE,OAAO;AAAA,EAClB,MAAM,YAAE,OAAO;AAAA,EACf,OAAO,YAAE,OAAO;AAAA,EAChB,MAAM,YAAE,OAAO;AACjB,CAAC;AAID,IAAM,yBAAoE;AAAA,EACxE,aAAa;AAAA,EACb,gBAAgB,UAAQ,KAAK;AAC/B;AA4CO,SAAS,eACd,UAAoC,CAAC,GACnB;AA5EpB;AA6EE,QAAM,cAAU;AAAA,KACd,aAAQ,YAAR,YAAmB;AAAA,EACrB;AACA,QAAM,aAAa,UACjB;AAAA,IACE;AAAA,MACE,eAAe,cAAU,kCAAW;AAAA,QAClC,QAAQ,QAAQ;AAAA,QAChB,yBAAyB;AAAA,QACzB,aAAa;AAAA,MACf,CAAC,CAAC;AAAA,MACF,GAAG,QAAQ;AAAA,IACb;AAAA,IACA,mBAAmB,OAAO;AAAA,EAC5B;AAEF,QAAM,sBAAsB,CAAC,YAAiC;AAC5D,WAAO,IAAI,2DAAkC,SAAS;AAAA,MACpD,UAAU;AAAA,MACV,KAAK,CAAC,EAAE,KAAK,MAAM,GAAG,OAAO,GAAG,IAAI;AAAA,MACpC,SAAS;AAAA,MACT,OAAO,QAAQ;AAAA,MACf,gBAAgB;AAAA,MAChB,2BAA2B;AAAA,IAC7B,CAAC;AAAA,EACH;AAEA,QAAM,WAAW,CAAC,YAChB,oBAAoB,OAAO;AAE7B,WAAS,uBAAuB;AAChC,WAAS,gBAAgB;AACzB,WAAS,OAAO;AAEhB,WAAS,iBAAiB,CAAC,YAAoB;AAC7C,UAAM,IAAI,iCAAiB,EAAE,SAAS,WAAW,iBAAiB,CAAC;AAAA,EACrE;AACA,WAAS,qBAAqB,SAAS;AACvC,WAAS,aAAa,CAAC,YAAoB;AACzC,UAAM,IAAI,iCAAiB,EAAE,SAAS,WAAW,aAAa,CAAC;AAAA,EACjE;AAEA,SAAO;AACT;AAEO,IAAM,WAAW,eAAe;","names":[]}
package/dist/index.mjs CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  import { z } from "zod/v4";
12
12
 
13
13
  // src/version.ts
14
- var VERSION = true ? "2.0.0-beta.64" : "0.0.0-test";
14
+ var VERSION = true ? "2.0.1" : "0.0.0-test";
15
15
 
16
16
  // src/cerebras-provider.ts
17
17
  var cerebrasErrorSchema = z.object({
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/cerebras-provider.ts","../src/version.ts"],"sourcesContent":["import { OpenAICompatibleChatLanguageModel } from '@ai-sdk/openai-compatible';\nimport {\n LanguageModelV3,\n NoSuchModelError,\n ProviderV3,\n} from '@ai-sdk/provider';\nimport {\n FetchFunction,\n loadApiKey,\n withoutTrailingSlash,\n withUserAgentSuffix,\n} from '@ai-sdk/provider-utils';\nimport { CerebrasChatModelId } from './cerebras-chat-options';\nimport { z } from 'zod/v4';\nimport { ProviderErrorStructure } from '@ai-sdk/openai-compatible';\nimport { VERSION } from './version';\n\n// Add error schema and structure\nconst cerebrasErrorSchema = z.object({\n message: z.string(),\n type: z.string(),\n param: z.string(),\n code: z.string(),\n});\n\nexport type CerebrasErrorData = z.infer<typeof cerebrasErrorSchema>;\n\nconst cerebrasErrorStructure: ProviderErrorStructure<CerebrasErrorData> = {\n errorSchema: cerebrasErrorSchema,\n errorToMessage: data => data.message,\n};\n\nexport interface CerebrasProviderSettings {\n /**\nCerebras API key.\n*/\n apiKey?: string;\n /**\nBase URL for the API calls.\n*/\n baseURL?: string;\n /**\nCustom headers to include in the requests.\n*/\n headers?: Record<string, string>;\n /**\nCustom fetch implementation. You can use it as a middleware to intercept requests,\nor to provide a custom fetch implementation for e.g. testing.\n*/\n fetch?: FetchFunction;\n}\n\nexport interface CerebrasProvider extends ProviderV3 {\n /**\nCreates a Cerebras model for text generation.\n*/\n (modelId: CerebrasChatModelId): LanguageModelV3;\n\n /**\nCreates a Cerebras model for text generation.\n*/\n languageModel(modelId: CerebrasChatModelId): LanguageModelV3;\n\n /**\nCreates a Cerebras chat model for text generation.\n*/\n chat(modelId: CerebrasChatModelId): LanguageModelV3;\n\n /**\n * @deprecated Use `embeddingModel` instead.\n */\n textEmbeddingModel(modelId: string): never;\n}\n\nexport function createCerebras(\n options: CerebrasProviderSettings = {},\n): CerebrasProvider {\n const baseURL = withoutTrailingSlash(\n options.baseURL ?? 'https://api.cerebras.ai/v1',\n );\n const getHeaders = () =>\n withUserAgentSuffix(\n {\n Authorization: `Bearer ${loadApiKey({\n apiKey: options.apiKey,\n environmentVariableName: 'CEREBRAS_API_KEY',\n description: 'Cerebras API key',\n })}`,\n ...options.headers,\n },\n `ai-sdk/cerebras/${VERSION}`,\n );\n\n const createLanguageModel = (modelId: CerebrasChatModelId) => {\n return new OpenAICompatibleChatLanguageModel(modelId, {\n provider: `cerebras.chat`,\n url: ({ path }) => `${baseURL}${path}`,\n headers: getHeaders,\n fetch: options.fetch,\n errorStructure: cerebrasErrorStructure,\n supportsStructuredOutputs: true,\n });\n };\n\n const provider = (modelId: CerebrasChatModelId) =>\n createLanguageModel(modelId);\n\n provider.specificationVersion = 'v3' as const;\n provider.languageModel = createLanguageModel;\n provider.chat = createLanguageModel;\n\n provider.embeddingModel = (modelId: string) => {\n throw new NoSuchModelError({ modelId, modelType: 'embeddingModel' });\n };\n provider.textEmbeddingModel = provider.embeddingModel;\n provider.imageModel = (modelId: string) => {\n throw new NoSuchModelError({ modelId, modelType: 'imageModel' });\n };\n\n return provider;\n}\n\nexport const cerebras = createCerebras();\n","// Version string of this package injected at build time.\ndeclare const __PACKAGE_VERSION__: string | undefined;\nexport const VERSION: string =\n typeof __PACKAGE_VERSION__ !== 'undefined'\n ? __PACKAGE_VERSION__\n : '0.0.0-test';\n"],"mappings":";AAAA,SAAS,yCAAyC;AAClD;AAAA,EAEE;AAAA,OAEK;AACP;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,SAAS;;;ACXX,IAAM,UACX,OACI,kBACA;;;ADaN,IAAM,sBAAsB,EAAE,OAAO;AAAA,EACnC,SAAS,EAAE,OAAO;AAAA,EAClB,MAAM,EAAE,OAAO;AAAA,EACf,OAAO,EAAE,OAAO;AAAA,EAChB,MAAM,EAAE,OAAO;AACjB,CAAC;AAID,IAAM,yBAAoE;AAAA,EACxE,aAAa;AAAA,EACb,gBAAgB,UAAQ,KAAK;AAC/B;AA4CO,SAAS,eACd,UAAoC,CAAC,GACnB;AA5EpB;AA6EE,QAAM,UAAU;AAAA,KACd,aAAQ,YAAR,YAAmB;AAAA,EACrB;AACA,QAAM,aAAa,MACjB;AAAA,IACE;AAAA,MACE,eAAe,UAAU,WAAW;AAAA,QAClC,QAAQ,QAAQ;AAAA,QAChB,yBAAyB;AAAA,QACzB,aAAa;AAAA,MACf,CAAC,CAAC;AAAA,MACF,GAAG,QAAQ;AAAA,IACb;AAAA,IACA,mBAAmB,OAAO;AAAA,EAC5B;AAEF,QAAM,sBAAsB,CAAC,YAAiC;AAC5D,WAAO,IAAI,kCAAkC,SAAS;AAAA,MACpD,UAAU;AAAA,MACV,KAAK,CAAC,EAAE,KAAK,MAAM,GAAG,OAAO,GAAG,IAAI;AAAA,MACpC,SAAS;AAAA,MACT,OAAO,QAAQ;AAAA,MACf,gBAAgB;AAAA,MAChB,2BAA2B;AAAA,IAC7B,CAAC;AAAA,EACH;AAEA,QAAM,WAAW,CAAC,YAChB,oBAAoB,OAAO;AAE7B,WAAS,uBAAuB;AAChC,WAAS,gBAAgB;AACzB,WAAS,OAAO;AAEhB,WAAS,iBAAiB,CAAC,YAAoB;AAC7C,UAAM,IAAI,iBAAiB,EAAE,SAAS,WAAW,iBAAiB,CAAC;AAAA,EACrE;AACA,WAAS,qBAAqB,SAAS;AACvC,WAAS,aAAa,CAAC,YAAoB;AACzC,UAAM,IAAI,iBAAiB,EAAE,SAAS,WAAW,aAAa,CAAC;AAAA,EACjE;AAEA,SAAO;AACT;AAEO,IAAM,WAAW,eAAe;","names":[]}
1
+ {"version":3,"sources":["../src/cerebras-provider.ts","../src/version.ts"],"sourcesContent":["import { OpenAICompatibleChatLanguageModel } from '@ai-sdk/openai-compatible';\nimport {\n LanguageModelV3,\n NoSuchModelError,\n ProviderV3,\n} from '@ai-sdk/provider';\nimport {\n FetchFunction,\n loadApiKey,\n withoutTrailingSlash,\n withUserAgentSuffix,\n} from '@ai-sdk/provider-utils';\nimport { CerebrasChatModelId } from './cerebras-chat-options';\nimport { z } from 'zod/v4';\nimport { ProviderErrorStructure } from '@ai-sdk/openai-compatible';\nimport { VERSION } from './version';\n\n// Add error schema and structure\nconst cerebrasErrorSchema = z.object({\n message: z.string(),\n type: z.string(),\n param: z.string(),\n code: z.string(),\n});\n\nexport type CerebrasErrorData = z.infer<typeof cerebrasErrorSchema>;\n\nconst cerebrasErrorStructure: ProviderErrorStructure<CerebrasErrorData> = {\n errorSchema: cerebrasErrorSchema,\n errorToMessage: data => data.message,\n};\n\nexport interface CerebrasProviderSettings {\n /**\nCerebras API key.\n*/\n apiKey?: string;\n /**\nBase URL for the API calls.\n*/\n baseURL?: string;\n /**\nCustom headers to include in the requests.\n*/\n headers?: Record<string, string>;\n /**\nCustom fetch implementation. You can use it as a middleware to intercept requests,\nor to provide a custom fetch implementation for e.g. testing.\n*/\n fetch?: FetchFunction;\n}\n\nexport interface CerebrasProvider extends ProviderV3 {\n /**\nCreates a Cerebras model for text generation.\n*/\n (modelId: CerebrasChatModelId): LanguageModelV3;\n\n /**\nCreates a Cerebras model for text generation.\n*/\n languageModel(modelId: CerebrasChatModelId): LanguageModelV3;\n\n /**\nCreates a Cerebras chat model for text generation.\n*/\n chat(modelId: CerebrasChatModelId): LanguageModelV3;\n\n /**\n * @deprecated Use `embeddingModel` instead.\n */\n textEmbeddingModel(modelId: string): never;\n}\n\nexport function createCerebras(\n options: CerebrasProviderSettings = {},\n): CerebrasProvider {\n const baseURL = withoutTrailingSlash(\n options.baseURL ?? 'https://api.cerebras.ai/v1',\n );\n const getHeaders = () =>\n withUserAgentSuffix(\n {\n Authorization: `Bearer ${loadApiKey({\n apiKey: options.apiKey,\n environmentVariableName: 'CEREBRAS_API_KEY',\n description: 'Cerebras API key',\n })}`,\n ...options.headers,\n },\n `ai-sdk/cerebras/${VERSION}`,\n );\n\n const createLanguageModel = (modelId: CerebrasChatModelId) => {\n return new OpenAICompatibleChatLanguageModel(modelId, {\n provider: `cerebras.chat`,\n url: ({ path }) => `${baseURL}${path}`,\n headers: getHeaders,\n fetch: options.fetch,\n errorStructure: cerebrasErrorStructure,\n supportsStructuredOutputs: true,\n });\n };\n\n const provider = (modelId: CerebrasChatModelId) =>\n createLanguageModel(modelId);\n\n provider.specificationVersion = 'v3' as const;\n provider.languageModel = createLanguageModel;\n provider.chat = createLanguageModel;\n\n provider.embeddingModel = (modelId: string) => {\n throw new NoSuchModelError({ modelId, modelType: 'embeddingModel' });\n };\n provider.textEmbeddingModel = provider.embeddingModel;\n provider.imageModel = (modelId: string) => {\n throw new NoSuchModelError({ modelId, modelType: 'imageModel' });\n };\n\n return provider;\n}\n\nexport const cerebras = createCerebras();\n","// Version string of this package injected at build time.\ndeclare const __PACKAGE_VERSION__: string | undefined;\nexport const VERSION: string =\n typeof __PACKAGE_VERSION__ !== 'undefined'\n ? __PACKAGE_VERSION__\n : '0.0.0-test';\n"],"mappings":";AAAA,SAAS,yCAAyC;AAClD;AAAA,EAEE;AAAA,OAEK;AACP;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,SAAS;;;ACXX,IAAM,UACX,OACI,UACA;;;ADaN,IAAM,sBAAsB,EAAE,OAAO;AAAA,EACnC,SAAS,EAAE,OAAO;AAAA,EAClB,MAAM,EAAE,OAAO;AAAA,EACf,OAAO,EAAE,OAAO;AAAA,EAChB,MAAM,EAAE,OAAO;AACjB,CAAC;AAID,IAAM,yBAAoE;AAAA,EACxE,aAAa;AAAA,EACb,gBAAgB,UAAQ,KAAK;AAC/B;AA4CO,SAAS,eACd,UAAoC,CAAC,GACnB;AA5EpB;AA6EE,QAAM,UAAU;AAAA,KACd,aAAQ,YAAR,YAAmB;AAAA,EACrB;AACA,QAAM,aAAa,MACjB;AAAA,IACE;AAAA,MACE,eAAe,UAAU,WAAW;AAAA,QAClC,QAAQ,QAAQ;AAAA,QAChB,yBAAyB;AAAA,QACzB,aAAa;AAAA,MACf,CAAC,CAAC;AAAA,MACF,GAAG,QAAQ;AAAA,IACb;AAAA,IACA,mBAAmB,OAAO;AAAA,EAC5B;AAEF,QAAM,sBAAsB,CAAC,YAAiC;AAC5D,WAAO,IAAI,kCAAkC,SAAS;AAAA,MACpD,UAAU;AAAA,MACV,KAAK,CAAC,EAAE,KAAK,MAAM,GAAG,OAAO,GAAG,IAAI;AAAA,MACpC,SAAS;AAAA,MACT,OAAO,QAAQ;AAAA,MACf,gBAAgB;AAAA,MAChB,2BAA2B;AAAA,IAC7B,CAAC;AAAA,EACH;AAEA,QAAM,WAAW,CAAC,YAChB,oBAAoB,OAAO;AAE7B,WAAS,uBAAuB;AAChC,WAAS,gBAAgB;AACzB,WAAS,OAAO;AAEhB,WAAS,iBAAiB,CAAC,YAAoB;AAC7C,UAAM,IAAI,iBAAiB,EAAE,SAAS,WAAW,iBAAiB,CAAC;AAAA,EACrE;AACA,WAAS,qBAAqB,SAAS;AACvC,WAAS,aAAa,CAAC,YAAoB;AACzC,UAAM,IAAI,iBAAiB,EAAE,SAAS,WAAW,aAAa,CAAC;AAAA,EACjE;AAEA,SAAO;AACT;AAEO,IAAM,WAAW,eAAe;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/cerebras",
3
- "version": "2.0.0-beta.64",
3
+ "version": "2.0.1",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -20,9 +20,9 @@
20
20
  }
21
21
  },
22
22
  "dependencies": {
23
- "@ai-sdk/openai-compatible": "2.0.0-beta.60",
24
- "@ai-sdk/provider": "3.0.0-beta.32",
25
- "@ai-sdk/provider-utils": "4.0.0-beta.59"
23
+ "@ai-sdk/openai-compatible": "2.0.0",
24
+ "@ai-sdk/provider": "3.0.0",
25
+ "@ai-sdk/provider-utils": "4.0.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/node": "20.17.24",