@hebo-ai/gateway 0.4.2 → 0.5.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/README.md +8 -6
- package/dist/endpoints/chat-completions/converters.d.ts +3 -1
- package/dist/endpoints/chat-completions/converters.js +121 -90
- package/dist/endpoints/chat-completions/otel.js +7 -0
- package/dist/endpoints/chat-completions/schema.d.ts +400 -76
- package/dist/endpoints/chat-completions/schema.js +80 -36
- package/dist/endpoints/embeddings/schema.d.ts +1 -1
- package/dist/endpoints/embeddings/schema.js +1 -1
- package/dist/errors/gateway.js +1 -0
- package/dist/logger/default.d.ts +0 -1
- package/dist/logger/default.js +30 -6
- package/dist/middleware/utils.js +1 -0
- package/dist/models/amazon/middleware.js +1 -0
- package/dist/models/anthropic/middleware.d.ts +2 -0
- package/dist/models/anthropic/middleware.js +77 -16
- package/dist/models/google/middleware.js +17 -0
- package/dist/models/google/presets.d.ts +387 -0
- package/dist/models/google/presets.js +9 -2
- package/dist/models/openai/middleware.js +1 -0
- package/dist/models/types.d.ts +1 -1
- package/dist/models/types.js +1 -0
- package/dist/providers/bedrock/index.d.ts +1 -0
- package/dist/providers/bedrock/index.js +1 -0
- package/dist/providers/bedrock/middleware.d.ts +2 -0
- package/dist/providers/bedrock/middleware.js +35 -0
- package/package.json +19 -21
- package/src/endpoints/chat-completions/converters.test.ts +219 -0
- package/src/endpoints/chat-completions/converters.ts +144 -104
- package/src/endpoints/chat-completions/handler.test.ts +87 -0
- package/src/endpoints/chat-completions/otel.ts +6 -0
- package/src/endpoints/chat-completions/schema.ts +85 -43
- package/src/endpoints/embeddings/schema.ts +1 -1
- package/src/errors/gateway.ts +2 -0
- package/src/logger/default.ts +34 -8
- package/src/middleware/utils.ts +1 -0
- package/src/models/amazon/middleware.ts +1 -0
- package/src/models/anthropic/middleware.test.ts +332 -1
- package/src/models/anthropic/middleware.ts +83 -19
- package/src/models/google/middleware.test.ts +31 -0
- package/src/models/google/middleware.ts +18 -0
- package/src/models/google/presets.ts +13 -2
- package/src/models/openai/middleware.ts +1 -0
- package/src/models/types.ts +1 -0
- package/src/providers/bedrock/index.ts +1 -0
- package/src/providers/bedrock/middleware.test.ts +73 -0
- package/src/providers/bedrock/middleware.ts +43 -0
|
@@ -230,6 +230,84 @@ export declare const gemini3ProPreview: <const O extends {
|
|
|
230
230
|
context: number;
|
|
231
231
|
providers: readonly ["vertex"];
|
|
232
232
|
} & O>;
|
|
233
|
+
export declare const gemini31ProPreview: <const O extends {
|
|
234
|
+
name?: string | undefined;
|
|
235
|
+
created?: string | undefined;
|
|
236
|
+
knowledge?: string | undefined;
|
|
237
|
+
modalities?: {
|
|
238
|
+
input?: readonly ("text" | "file" | "image" | "audio" | "video" | "pdf")[] | undefined;
|
|
239
|
+
output?: readonly ("text" | "embedding" | "image" | "audio" | "video")[] | undefined;
|
|
240
|
+
} | undefined;
|
|
241
|
+
context?: number | undefined;
|
|
242
|
+
capabilities?: readonly ("temperature" | "reasoning" | "attachments" | "tool_call" | "structured_output")[] | undefined;
|
|
243
|
+
providers?: readonly ("anthropic" | "azure" | "bedrock" | "cohere" | "groq" | "openai" | "vertex" | "voyage" | {
|
|
244
|
+
readonly [x: number]: string | undefined;
|
|
245
|
+
toString?: (() => string) | undefined;
|
|
246
|
+
charAt?: {} | undefined;
|
|
247
|
+
charCodeAt?: {} | undefined;
|
|
248
|
+
concat?: {} | undefined;
|
|
249
|
+
indexOf?: {} | undefined;
|
|
250
|
+
lastIndexOf?: {} | undefined;
|
|
251
|
+
localeCompare?: {} | undefined;
|
|
252
|
+
match?: {} | undefined;
|
|
253
|
+
replace?: {} | undefined;
|
|
254
|
+
search?: {} | undefined;
|
|
255
|
+
slice?: {} | undefined;
|
|
256
|
+
split?: {} | undefined;
|
|
257
|
+
substring?: {} | undefined;
|
|
258
|
+
toLowerCase?: (() => string) | undefined;
|
|
259
|
+
toLocaleLowerCase?: {} | undefined;
|
|
260
|
+
toUpperCase?: (() => string) | undefined;
|
|
261
|
+
toLocaleUpperCase?: {} | undefined;
|
|
262
|
+
trim?: (() => string) | undefined;
|
|
263
|
+
readonly length?: number | undefined;
|
|
264
|
+
substr?: {} | undefined;
|
|
265
|
+
valueOf?: (() => string) | undefined;
|
|
266
|
+
codePointAt?: {} | undefined;
|
|
267
|
+
includes?: {} | undefined;
|
|
268
|
+
endsWith?: {} | undefined;
|
|
269
|
+
normalize?: {} | undefined;
|
|
270
|
+
repeat?: {} | undefined;
|
|
271
|
+
startsWith?: {} | undefined;
|
|
272
|
+
anchor?: {} | undefined;
|
|
273
|
+
big?: (() => string) | undefined;
|
|
274
|
+
blink?: (() => string) | undefined;
|
|
275
|
+
bold?: (() => string) | undefined;
|
|
276
|
+
fixed?: (() => string) | undefined;
|
|
277
|
+
fontcolor?: {} | undefined;
|
|
278
|
+
fontsize?: {} | undefined;
|
|
279
|
+
italics?: (() => string) | undefined;
|
|
280
|
+
link?: {} | undefined;
|
|
281
|
+
small?: (() => string) | undefined;
|
|
282
|
+
strike?: (() => string) | undefined;
|
|
283
|
+
sub?: (() => string) | undefined;
|
|
284
|
+
sup?: (() => string) | undefined;
|
|
285
|
+
padStart?: {} | undefined;
|
|
286
|
+
padEnd?: {} | undefined;
|
|
287
|
+
trimEnd?: (() => string) | undefined;
|
|
288
|
+
trimStart?: (() => string) | undefined;
|
|
289
|
+
trimLeft?: (() => string) | undefined;
|
|
290
|
+
trimRight?: (() => string) | undefined;
|
|
291
|
+
matchAll?: {} | undefined;
|
|
292
|
+
replaceAll?: {} | undefined;
|
|
293
|
+
at?: {} | undefined;
|
|
294
|
+
[Symbol.iterator]?: (() => StringIterator<string>) | undefined;
|
|
295
|
+
})[] | undefined;
|
|
296
|
+
additionalProperties?: {
|
|
297
|
+
[x: string]: unknown;
|
|
298
|
+
} | undefined;
|
|
299
|
+
}>(override?: O | undefined) => Record<"google/gemini-3.1-pro-preview", {
|
|
300
|
+
name: string;
|
|
301
|
+
created: string;
|
|
302
|
+
knowledge: string;
|
|
303
|
+
modalities: {
|
|
304
|
+
input: readonly ["text", "image", "pdf", "file", "audio", "video"];
|
|
305
|
+
output: readonly ["text"];
|
|
306
|
+
};
|
|
307
|
+
capabilities: readonly ["attachments", "reasoning", "tool_call", "structured_output", "temperature"];
|
|
308
|
+
context: number;
|
|
309
|
+
providers: readonly ["vertex"];
|
|
310
|
+
} & O>;
|
|
233
311
|
export declare const gemini25FlashLite: <const O extends {
|
|
234
312
|
name?: string | undefined;
|
|
235
313
|
created?: string | undefined;
|
|
@@ -851,6 +929,83 @@ export declare const gemini: {
|
|
|
851
929
|
capabilities: readonly ["attachments", "reasoning", "tool_call", "structured_output", "temperature"];
|
|
852
930
|
context: number;
|
|
853
931
|
providers: readonly ["vertex"];
|
|
932
|
+
} & O>, <const O extends {
|
|
933
|
+
name?: string | undefined;
|
|
934
|
+
created?: string | undefined;
|
|
935
|
+
knowledge?: string | undefined;
|
|
936
|
+
modalities?: {
|
|
937
|
+
input?: readonly ("text" | "file" | "image" | "audio" | "video" | "pdf")[] | undefined;
|
|
938
|
+
output?: readonly ("text" | "embedding" | "image" | "audio" | "video")[] | undefined;
|
|
939
|
+
} | undefined;
|
|
940
|
+
context?: number | undefined;
|
|
941
|
+
capabilities?: readonly ("temperature" | "reasoning" | "attachments" | "tool_call" | "structured_output")[] | undefined;
|
|
942
|
+
providers?: readonly ("anthropic" | "azure" | "bedrock" | "cohere" | "groq" | "openai" | "vertex" | "voyage" | {
|
|
943
|
+
readonly [x: number]: string | undefined;
|
|
944
|
+
toString?: (() => string) | undefined;
|
|
945
|
+
charAt?: {} | undefined;
|
|
946
|
+
charCodeAt?: {} | undefined;
|
|
947
|
+
concat?: {} | undefined;
|
|
948
|
+
indexOf?: {} | undefined;
|
|
949
|
+
lastIndexOf?: {} | undefined;
|
|
950
|
+
localeCompare?: {} | undefined;
|
|
951
|
+
match?: {} | undefined;
|
|
952
|
+
replace?: {} | undefined;
|
|
953
|
+
search?: {} | undefined;
|
|
954
|
+
slice?: {} | undefined;
|
|
955
|
+
split?: {} | undefined;
|
|
956
|
+
substring?: {} | undefined;
|
|
957
|
+
toLowerCase?: (() => string) | undefined;
|
|
958
|
+
toLocaleLowerCase?: {} | undefined;
|
|
959
|
+
toUpperCase?: (() => string) | undefined;
|
|
960
|
+
toLocaleUpperCase?: {} | undefined;
|
|
961
|
+
trim?: (() => string) | undefined;
|
|
962
|
+
readonly length?: number | undefined;
|
|
963
|
+
substr?: {} | undefined;
|
|
964
|
+
valueOf?: (() => string) | undefined;
|
|
965
|
+
codePointAt?: {} | undefined;
|
|
966
|
+
includes?: {} | undefined;
|
|
967
|
+
endsWith?: {} | undefined;
|
|
968
|
+
normalize?: {} | undefined;
|
|
969
|
+
repeat?: {} | undefined;
|
|
970
|
+
startsWith?: {} | undefined;
|
|
971
|
+
anchor?: {} | undefined;
|
|
972
|
+
big?: (() => string) | undefined;
|
|
973
|
+
blink?: (() => string) | undefined;
|
|
974
|
+
bold?: (() => string) | undefined;
|
|
975
|
+
fixed?: (() => string) | undefined;
|
|
976
|
+
fontcolor?: {} | undefined;
|
|
977
|
+
fontsize?: {} | undefined;
|
|
978
|
+
italics?: (() => string) | undefined;
|
|
979
|
+
link?: {} | undefined;
|
|
980
|
+
small?: (() => string) | undefined;
|
|
981
|
+
strike?: (() => string) | undefined;
|
|
982
|
+
sub?: (() => string) | undefined;
|
|
983
|
+
sup?: (() => string) | undefined;
|
|
984
|
+
padStart?: {} | undefined;
|
|
985
|
+
padEnd?: {} | undefined;
|
|
986
|
+
trimEnd?: (() => string) | undefined;
|
|
987
|
+
trimStart?: (() => string) | undefined;
|
|
988
|
+
trimLeft?: (() => string) | undefined;
|
|
989
|
+
trimRight?: (() => string) | undefined;
|
|
990
|
+
matchAll?: {} | undefined;
|
|
991
|
+
replaceAll?: {} | undefined;
|
|
992
|
+
at?: {} | undefined;
|
|
993
|
+
[Symbol.iterator]?: (() => StringIterator<string>) | undefined;
|
|
994
|
+
})[] | undefined;
|
|
995
|
+
additionalProperties?: {
|
|
996
|
+
[x: string]: unknown;
|
|
997
|
+
} | undefined;
|
|
998
|
+
}>(override?: O | undefined) => Record<"google/gemini-3.1-pro-preview", {
|
|
999
|
+
name: string;
|
|
1000
|
+
created: string;
|
|
1001
|
+
knowledge: string;
|
|
1002
|
+
modalities: {
|
|
1003
|
+
input: readonly ["text", "image", "pdf", "file", "audio", "video"];
|
|
1004
|
+
output: readonly ["text"];
|
|
1005
|
+
};
|
|
1006
|
+
capabilities: readonly ["attachments", "reasoning", "tool_call", "structured_output", "temperature"];
|
|
1007
|
+
context: number;
|
|
1008
|
+
providers: readonly ["vertex"];
|
|
854
1009
|
} & O>];
|
|
855
1010
|
readonly embeddings: readonly [<const O extends {
|
|
856
1011
|
name?: string | undefined;
|
|
@@ -1223,6 +1378,83 @@ export declare const gemini: {
|
|
|
1223
1378
|
additionalProperties?: {
|
|
1224
1379
|
[x: string]: unknown;
|
|
1225
1380
|
} | undefined;
|
|
1381
|
+
}>(override?: O | undefined) => Record<"google/gemini-3.1-pro-preview", {
|
|
1382
|
+
name: string;
|
|
1383
|
+
created: string;
|
|
1384
|
+
knowledge: string;
|
|
1385
|
+
modalities: {
|
|
1386
|
+
input: readonly ["text", "image", "pdf", "file", "audio", "video"];
|
|
1387
|
+
output: readonly ["text"];
|
|
1388
|
+
};
|
|
1389
|
+
capabilities: readonly ["attachments", "reasoning", "tool_call", "structured_output", "temperature"];
|
|
1390
|
+
context: number;
|
|
1391
|
+
providers: readonly ["vertex"];
|
|
1392
|
+
} & O>) | (<const O extends {
|
|
1393
|
+
name?: string | undefined;
|
|
1394
|
+
created?: string | undefined;
|
|
1395
|
+
knowledge?: string | undefined;
|
|
1396
|
+
modalities?: {
|
|
1397
|
+
input?: readonly ("text" | "file" | "image" | "audio" | "video" | "pdf")[] | undefined;
|
|
1398
|
+
output?: readonly ("text" | "embedding" | "image" | "audio" | "video")[] | undefined;
|
|
1399
|
+
} | undefined;
|
|
1400
|
+
context?: number | undefined;
|
|
1401
|
+
capabilities?: readonly ("temperature" | "reasoning" | "attachments" | "tool_call" | "structured_output")[] | undefined;
|
|
1402
|
+
providers?: readonly ("anthropic" | "azure" | "bedrock" | "cohere" | "groq" | "openai" | "vertex" | "voyage" | {
|
|
1403
|
+
readonly [x: number]: string | undefined;
|
|
1404
|
+
toString?: (() => string) | undefined;
|
|
1405
|
+
charAt?: {} | undefined;
|
|
1406
|
+
charCodeAt?: {} | undefined;
|
|
1407
|
+
concat?: {} | undefined;
|
|
1408
|
+
indexOf?: {} | undefined;
|
|
1409
|
+
lastIndexOf?: {} | undefined;
|
|
1410
|
+
localeCompare?: {} | undefined;
|
|
1411
|
+
match?: {} | undefined;
|
|
1412
|
+
replace?: {} | undefined;
|
|
1413
|
+
search?: {} | undefined;
|
|
1414
|
+
slice?: {} | undefined;
|
|
1415
|
+
split?: {} | undefined;
|
|
1416
|
+
substring?: {} | undefined;
|
|
1417
|
+
toLowerCase?: (() => string) | undefined;
|
|
1418
|
+
toLocaleLowerCase?: {} | undefined;
|
|
1419
|
+
toUpperCase?: (() => string) | undefined;
|
|
1420
|
+
toLocaleUpperCase?: {} | undefined;
|
|
1421
|
+
trim?: (() => string) | undefined;
|
|
1422
|
+
readonly length?: number | undefined;
|
|
1423
|
+
substr?: {} | undefined;
|
|
1424
|
+
valueOf?: (() => string) | undefined;
|
|
1425
|
+
codePointAt?: {} | undefined;
|
|
1426
|
+
includes?: {} | undefined;
|
|
1427
|
+
endsWith?: {} | undefined;
|
|
1428
|
+
normalize?: {} | undefined;
|
|
1429
|
+
repeat?: {} | undefined;
|
|
1430
|
+
startsWith?: {} | undefined;
|
|
1431
|
+
anchor?: {} | undefined;
|
|
1432
|
+
big?: (() => string) | undefined;
|
|
1433
|
+
blink?: (() => string) | undefined;
|
|
1434
|
+
bold?: (() => string) | undefined;
|
|
1435
|
+
fixed?: (() => string) | undefined;
|
|
1436
|
+
fontcolor?: {} | undefined;
|
|
1437
|
+
fontsize?: {} | undefined;
|
|
1438
|
+
italics?: (() => string) | undefined;
|
|
1439
|
+
link?: {} | undefined;
|
|
1440
|
+
small?: (() => string) | undefined;
|
|
1441
|
+
strike?: (() => string) | undefined;
|
|
1442
|
+
sub?: (() => string) | undefined;
|
|
1443
|
+
sup?: (() => string) | undefined;
|
|
1444
|
+
padStart?: {} | undefined;
|
|
1445
|
+
padEnd?: {} | undefined;
|
|
1446
|
+
trimEnd?: (() => string) | undefined;
|
|
1447
|
+
trimStart?: (() => string) | undefined;
|
|
1448
|
+
trimLeft?: (() => string) | undefined;
|
|
1449
|
+
trimRight?: (() => string) | undefined;
|
|
1450
|
+
matchAll?: {} | undefined;
|
|
1451
|
+
replaceAll?: {} | undefined;
|
|
1452
|
+
at?: {} | undefined;
|
|
1453
|
+
[Symbol.iterator]?: (() => StringIterator<string>) | undefined;
|
|
1454
|
+
})[] | undefined;
|
|
1455
|
+
additionalProperties?: {
|
|
1456
|
+
[x: string]: unknown;
|
|
1457
|
+
} | undefined;
|
|
1226
1458
|
}>(override?: O | undefined) => Record<"google/gemini-2.5-flash-lite", {
|
|
1227
1459
|
name: string;
|
|
1228
1460
|
created: string;
|
|
@@ -1775,6 +2007,83 @@ export declare const gemini: {
|
|
|
1775
2007
|
capabilities: readonly ["attachments", "reasoning", "tool_call", "structured_output", "temperature"];
|
|
1776
2008
|
context: number;
|
|
1777
2009
|
providers: readonly ["vertex"];
|
|
2010
|
+
} & O>, <const O extends {
|
|
2011
|
+
name?: string | undefined;
|
|
2012
|
+
created?: string | undefined;
|
|
2013
|
+
knowledge?: string | undefined;
|
|
2014
|
+
modalities?: {
|
|
2015
|
+
input?: readonly ("text" | "file" | "image" | "audio" | "video" | "pdf")[] | undefined;
|
|
2016
|
+
output?: readonly ("text" | "embedding" | "image" | "audio" | "video")[] | undefined;
|
|
2017
|
+
} | undefined;
|
|
2018
|
+
context?: number | undefined;
|
|
2019
|
+
capabilities?: readonly ("temperature" | "reasoning" | "attachments" | "tool_call" | "structured_output")[] | undefined;
|
|
2020
|
+
providers?: readonly ("anthropic" | "azure" | "bedrock" | "cohere" | "groq" | "openai" | "vertex" | "voyage" | {
|
|
2021
|
+
readonly [x: number]: string | undefined;
|
|
2022
|
+
toString?: (() => string) | undefined;
|
|
2023
|
+
charAt?: {} | undefined;
|
|
2024
|
+
charCodeAt?: {} | undefined;
|
|
2025
|
+
concat?: {} | undefined;
|
|
2026
|
+
indexOf?: {} | undefined;
|
|
2027
|
+
lastIndexOf?: {} | undefined;
|
|
2028
|
+
localeCompare?: {} | undefined;
|
|
2029
|
+
match?: {} | undefined;
|
|
2030
|
+
replace?: {} | undefined;
|
|
2031
|
+
search?: {} | undefined;
|
|
2032
|
+
slice?: {} | undefined;
|
|
2033
|
+
split?: {} | undefined;
|
|
2034
|
+
substring?: {} | undefined;
|
|
2035
|
+
toLowerCase?: (() => string) | undefined;
|
|
2036
|
+
toLocaleLowerCase?: {} | undefined;
|
|
2037
|
+
toUpperCase?: (() => string) | undefined;
|
|
2038
|
+
toLocaleUpperCase?: {} | undefined;
|
|
2039
|
+
trim?: (() => string) | undefined;
|
|
2040
|
+
readonly length?: number | undefined;
|
|
2041
|
+
substr?: {} | undefined;
|
|
2042
|
+
valueOf?: (() => string) | undefined;
|
|
2043
|
+
codePointAt?: {} | undefined;
|
|
2044
|
+
includes?: {} | undefined;
|
|
2045
|
+
endsWith?: {} | undefined;
|
|
2046
|
+
normalize?: {} | undefined;
|
|
2047
|
+
repeat?: {} | undefined;
|
|
2048
|
+
startsWith?: {} | undefined;
|
|
2049
|
+
anchor?: {} | undefined;
|
|
2050
|
+
big?: (() => string) | undefined;
|
|
2051
|
+
blink?: (() => string) | undefined;
|
|
2052
|
+
bold?: (() => string) | undefined;
|
|
2053
|
+
fixed?: (() => string) | undefined;
|
|
2054
|
+
fontcolor?: {} | undefined;
|
|
2055
|
+
fontsize?: {} | undefined;
|
|
2056
|
+
italics?: (() => string) | undefined;
|
|
2057
|
+
link?: {} | undefined;
|
|
2058
|
+
small?: (() => string) | undefined;
|
|
2059
|
+
strike?: (() => string) | undefined;
|
|
2060
|
+
sub?: (() => string) | undefined;
|
|
2061
|
+
sup?: (() => string) | undefined;
|
|
2062
|
+
padStart?: {} | undefined;
|
|
2063
|
+
padEnd?: {} | undefined;
|
|
2064
|
+
trimEnd?: (() => string) | undefined;
|
|
2065
|
+
trimStart?: (() => string) | undefined;
|
|
2066
|
+
trimLeft?: (() => string) | undefined;
|
|
2067
|
+
trimRight?: (() => string) | undefined;
|
|
2068
|
+
matchAll?: {} | undefined;
|
|
2069
|
+
replaceAll?: {} | undefined;
|
|
2070
|
+
at?: {} | undefined;
|
|
2071
|
+
[Symbol.iterator]?: (() => StringIterator<string>) | undefined;
|
|
2072
|
+
})[] | undefined;
|
|
2073
|
+
additionalProperties?: {
|
|
2074
|
+
[x: string]: unknown;
|
|
2075
|
+
} | undefined;
|
|
2076
|
+
}>(override?: O | undefined) => Record<"google/gemini-3.1-pro-preview", {
|
|
2077
|
+
name: string;
|
|
2078
|
+
created: string;
|
|
2079
|
+
knowledge: string;
|
|
2080
|
+
modalities: {
|
|
2081
|
+
input: readonly ["text", "image", "pdf", "file", "audio", "video"];
|
|
2082
|
+
output: readonly ["text"];
|
|
2083
|
+
};
|
|
2084
|
+
capabilities: readonly ["attachments", "reasoning", "tool_call", "structured_output", "temperature"];
|
|
2085
|
+
context: number;
|
|
2086
|
+
providers: readonly ["vertex"];
|
|
1778
2087
|
} & O>];
|
|
1779
2088
|
readonly "v2.5": readonly [<const O extends {
|
|
1780
2089
|
name?: string | undefined;
|
|
@@ -2163,4 +2472,82 @@ export declare const gemini: {
|
|
|
2163
2472
|
context: number;
|
|
2164
2473
|
providers: readonly ["vertex"];
|
|
2165
2474
|
} & O>];
|
|
2475
|
+
readonly "v3.1-preview": readonly [<const O extends {
|
|
2476
|
+
name?: string | undefined;
|
|
2477
|
+
created?: string | undefined;
|
|
2478
|
+
knowledge?: string | undefined;
|
|
2479
|
+
modalities?: {
|
|
2480
|
+
input?: readonly ("text" | "file" | "image" | "audio" | "video" | "pdf")[] | undefined;
|
|
2481
|
+
output?: readonly ("text" | "embedding" | "image" | "audio" | "video")[] | undefined;
|
|
2482
|
+
} | undefined;
|
|
2483
|
+
context?: number | undefined;
|
|
2484
|
+
capabilities?: readonly ("temperature" | "reasoning" | "attachments" | "tool_call" | "structured_output")[] | undefined;
|
|
2485
|
+
providers?: readonly ("anthropic" | "azure" | "bedrock" | "cohere" | "groq" | "openai" | "vertex" | "voyage" | {
|
|
2486
|
+
readonly [x: number]: string | undefined;
|
|
2487
|
+
toString?: (() => string) | undefined;
|
|
2488
|
+
charAt?: {} | undefined;
|
|
2489
|
+
charCodeAt?: {} | undefined;
|
|
2490
|
+
concat?: {} | undefined;
|
|
2491
|
+
indexOf?: {} | undefined;
|
|
2492
|
+
lastIndexOf?: {} | undefined;
|
|
2493
|
+
localeCompare?: {} | undefined;
|
|
2494
|
+
match?: {} | undefined;
|
|
2495
|
+
replace?: {} | undefined;
|
|
2496
|
+
search?: {} | undefined;
|
|
2497
|
+
slice?: {} | undefined;
|
|
2498
|
+
split?: {} | undefined;
|
|
2499
|
+
substring?: {} | undefined;
|
|
2500
|
+
toLowerCase?: (() => string) | undefined;
|
|
2501
|
+
toLocaleLowerCase?: {} | undefined;
|
|
2502
|
+
toUpperCase?: (() => string) | undefined;
|
|
2503
|
+
toLocaleUpperCase?: {} | undefined;
|
|
2504
|
+
trim?: (() => string) | undefined;
|
|
2505
|
+
readonly length?: number | undefined;
|
|
2506
|
+
substr?: {} | undefined;
|
|
2507
|
+
valueOf?: (() => string) | undefined;
|
|
2508
|
+
codePointAt?: {} | undefined;
|
|
2509
|
+
includes?: {} | undefined;
|
|
2510
|
+
endsWith?: {} | undefined;
|
|
2511
|
+
normalize?: {} | undefined;
|
|
2512
|
+
repeat?: {} | undefined;
|
|
2513
|
+
startsWith?: {} | undefined;
|
|
2514
|
+
anchor?: {} | undefined;
|
|
2515
|
+
big?: (() => string) | undefined;
|
|
2516
|
+
blink?: (() => string) | undefined;
|
|
2517
|
+
bold?: (() => string) | undefined;
|
|
2518
|
+
fixed?: (() => string) | undefined;
|
|
2519
|
+
fontcolor?: {} | undefined;
|
|
2520
|
+
fontsize?: {} | undefined;
|
|
2521
|
+
italics?: (() => string) | undefined;
|
|
2522
|
+
link?: {} | undefined;
|
|
2523
|
+
small?: (() => string) | undefined;
|
|
2524
|
+
strike?: (() => string) | undefined;
|
|
2525
|
+
sub?: (() => string) | undefined;
|
|
2526
|
+
sup?: (() => string) | undefined;
|
|
2527
|
+
padStart?: {} | undefined;
|
|
2528
|
+
padEnd?: {} | undefined;
|
|
2529
|
+
trimEnd?: (() => string) | undefined;
|
|
2530
|
+
trimStart?: (() => string) | undefined;
|
|
2531
|
+
trimLeft?: (() => string) | undefined;
|
|
2532
|
+
trimRight?: (() => string) | undefined;
|
|
2533
|
+
matchAll?: {} | undefined;
|
|
2534
|
+
replaceAll?: {} | undefined;
|
|
2535
|
+
at?: {} | undefined;
|
|
2536
|
+
[Symbol.iterator]?: (() => StringIterator<string>) | undefined;
|
|
2537
|
+
})[] | undefined;
|
|
2538
|
+
additionalProperties?: {
|
|
2539
|
+
[x: string]: unknown;
|
|
2540
|
+
} | undefined;
|
|
2541
|
+
}>(override?: O | undefined) => Record<"google/gemini-3.1-pro-preview", {
|
|
2542
|
+
name: string;
|
|
2543
|
+
created: string;
|
|
2544
|
+
knowledge: string;
|
|
2545
|
+
modalities: {
|
|
2546
|
+
input: readonly ["text", "image", "pdf", "file", "audio", "video"];
|
|
2547
|
+
output: readonly ["text"];
|
|
2548
|
+
};
|
|
2549
|
+
capabilities: readonly ["attachments", "reasoning", "tool_call", "structured_output", "temperature"];
|
|
2550
|
+
context: number;
|
|
2551
|
+
providers: readonly ["vertex"];
|
|
2552
|
+
} & O>];
|
|
2166
2553
|
};
|
|
@@ -39,6 +39,12 @@ export const gemini3ProPreview = presetFor()("google/gemini-3-pro-preview", {
|
|
|
39
39
|
created: "2025-11-18",
|
|
40
40
|
knowledge: "2025-01",
|
|
41
41
|
});
|
|
42
|
+
export const gemini31ProPreview = presetFor()("google/gemini-3.1-pro-preview", {
|
|
43
|
+
...GEMINI_BASE,
|
|
44
|
+
name: "Gemini 3.1 Pro (Preview)",
|
|
45
|
+
created: "2026-02-19",
|
|
46
|
+
knowledge: "2025-01",
|
|
47
|
+
});
|
|
42
48
|
export const gemini25FlashLite = presetFor()("google/gemini-2.5-flash-lite", {
|
|
43
49
|
...GEMINI_BASE,
|
|
44
50
|
name: "Gemini 2.5 Flash Lite",
|
|
@@ -60,17 +66,18 @@ export const gemini25Pro = presetFor()("google/gemini-2.5-pro", {
|
|
|
60
66
|
const geminiAtomic = {
|
|
61
67
|
"v2.5": [gemini25FlashLite, gemini25Flash, gemini25Pro],
|
|
62
68
|
"v3-preview": [gemini3FlashPreview, gemini3ProPreview],
|
|
69
|
+
"v3.1-preview": [gemini31ProPreview],
|
|
63
70
|
embeddings: [geminiEmbedding001],
|
|
64
71
|
};
|
|
65
72
|
const geminiGroups = {
|
|
66
73
|
"v2.x": [...geminiAtomic["v2.5"]],
|
|
67
|
-
"v3.x": [...geminiAtomic["v3-preview"]],
|
|
74
|
+
"v3.x": [...geminiAtomic["v3-preview"], ...geminiAtomic["v3.1-preview"]],
|
|
68
75
|
};
|
|
69
76
|
export const gemini = {
|
|
70
77
|
...geminiAtomic,
|
|
71
78
|
...geminiGroups,
|
|
72
79
|
latest: [...geminiAtomic["v2.5"]],
|
|
73
|
-
preview: [...geminiAtomic["v3-preview"]],
|
|
80
|
+
preview: [...geminiAtomic["v3-preview"], ...geminiAtomic["v3.1-preview"]],
|
|
74
81
|
embeddings: [...geminiAtomic["embeddings"]],
|
|
75
82
|
all: Object.values(geminiAtomic).flat(),
|
|
76
83
|
};
|
package/dist/models/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ProviderId } from "../providers/types";
|
|
2
|
-
export declare const CANONICAL_MODEL_IDS: readonly ["anthropic/claude-opus-4.6", "anthropic/claude-sonnet-4.6", "anthropic/claude-haiku-4.5", "anthropic/claude-sonnet-4.5", "anthropic/claude-opus-4.5", "anthropic/claude-opus-4.1", "anthropic/claude-opus-4", "anthropic/claude-sonnet-4", "anthropic/claude-sonnet-3.7", "anthropic/claude-sonnet-3.5", "anthropic/claude-haiku-3.5", "anthropic/claude-haiku-3", "openai/gpt-oss-20b", "openai/gpt-oss-120b", "openai/gpt-5", "openai/gpt-5-pro", "openai/gpt-5.2", "openai/gpt-5.2-chat", "openai/gpt-5.2-pro", "openai/gpt-5.2-codex", "openai/gpt-5.3-codex", "openai/gpt-5-mini", "openai/gpt-5-nano", "openai/gpt-5-codex", "openai/gpt-5.1-codex", "openai/gpt-5.1-codex-max", "openai/gpt-5.1-chat", "openai/gpt-5.1", "openai/text-embedding-3-small", "openai/text-embedding-3-large", "amazon/nova-micro", "amazon/nova-lite", "amazon/nova-pro", "amazon/nova-premier", "amazon/nova-2-lite", "amazon/nova-2-multimodal-embeddings", "google/gemini-2.5-flash-lite", "google/gemini-2.5-flash", "google/gemini-2.5-pro", "google/gemini-3-flash-preview", "google/gemini-3-pro-preview", "google/embedding-001", "meta/llama-3.1-8b", "meta/llama-3.1-70b", "meta/llama-3.1-405b", "meta/llama-3.2-1b", "meta/llama-3.2-3b", "meta/llama-3.2-11b", "meta/llama-3.2-90b", "meta/llama-3.3-70b", "meta/llama-4-scout", "meta/llama-4-maverick", "cohere/embed-v4.0", "cohere/embed-english-v3.0", "cohere/embed-english-light-v3.0", "cohere/embed-multilingual-v3.0", "cohere/embed-multilingual-light-v3.0", "cohere/command-a", "cohere/command-r7b", "cohere/command-a-translate", "cohere/command-a-reasoning", "cohere/command-a-vision", "cohere/command-r", "cohere/command-r-plus", "voyage/voyage-2-code", "voyage/voyage-2-law", "voyage/voyage-2-finance", "voyage/voyage-3-code", "voyage/voyage-3-large", "voyage/voyage-3.5-lite", "voyage/voyage-3.5", "voyage/voyage-4-lite", "voyage/voyage-4", "voyage/voyage-4-large"];
|
|
2
|
+
export declare const CANONICAL_MODEL_IDS: readonly ["anthropic/claude-opus-4.6", "anthropic/claude-sonnet-4.6", "anthropic/claude-haiku-4.5", "anthropic/claude-sonnet-4.5", "anthropic/claude-opus-4.5", "anthropic/claude-opus-4.1", "anthropic/claude-opus-4", "anthropic/claude-sonnet-4", "anthropic/claude-sonnet-3.7", "anthropic/claude-sonnet-3.5", "anthropic/claude-haiku-3.5", "anthropic/claude-haiku-3", "openai/gpt-oss-20b", "openai/gpt-oss-120b", "openai/gpt-5", "openai/gpt-5-pro", "openai/gpt-5.2", "openai/gpt-5.2-chat", "openai/gpt-5.2-pro", "openai/gpt-5.2-codex", "openai/gpt-5.3-codex", "openai/gpt-5-mini", "openai/gpt-5-nano", "openai/gpt-5-codex", "openai/gpt-5.1-codex", "openai/gpt-5.1-codex-max", "openai/gpt-5.1-chat", "openai/gpt-5.1", "openai/text-embedding-3-small", "openai/text-embedding-3-large", "amazon/nova-micro", "amazon/nova-lite", "amazon/nova-pro", "amazon/nova-premier", "amazon/nova-2-lite", "amazon/nova-2-multimodal-embeddings", "google/gemini-2.5-flash-lite", "google/gemini-2.5-flash", "google/gemini-2.5-pro", "google/gemini-3-flash-preview", "google/gemini-3-pro-preview", "google/gemini-3.1-pro-preview", "google/embedding-001", "meta/llama-3.1-8b", "meta/llama-3.1-70b", "meta/llama-3.1-405b", "meta/llama-3.2-1b", "meta/llama-3.2-3b", "meta/llama-3.2-11b", "meta/llama-3.2-90b", "meta/llama-3.3-70b", "meta/llama-4-scout", "meta/llama-4-maverick", "cohere/embed-v4.0", "cohere/embed-english-v3.0", "cohere/embed-english-light-v3.0", "cohere/embed-multilingual-v3.0", "cohere/embed-multilingual-light-v3.0", "cohere/command-a", "cohere/command-r7b", "cohere/command-a-translate", "cohere/command-a-reasoning", "cohere/command-a-vision", "cohere/command-r", "cohere/command-r-plus", "voyage/voyage-2-code", "voyage/voyage-2-law", "voyage/voyage-2-finance", "voyage/voyage-3-code", "voyage/voyage-3-large", "voyage/voyage-3.5-lite", "voyage/voyage-3.5", "voyage/voyage-4-lite", "voyage/voyage-4", "voyage/voyage-4-large"];
|
|
3
3
|
export type CanonicalModelId = (typeof CANONICAL_MODEL_IDS)[number];
|
|
4
4
|
export type ModelId = CanonicalModelId | (string & {});
|
|
5
5
|
export type CatalogModel = {
|
package/dist/models/types.js
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { modelMiddlewareMatcher } from "../../middleware/matcher";
|
|
2
|
+
export const bedrockAnthropicReasoningMiddleware = {
|
|
3
|
+
specificationVersion: "v3",
|
|
4
|
+
// eslint-disable-next-line require-await
|
|
5
|
+
transformParams: async ({ params, model }) => {
|
|
6
|
+
if (!model.modelId.includes("claude"))
|
|
7
|
+
return params;
|
|
8
|
+
const bedrock = params.providerOptions?.["bedrock"];
|
|
9
|
+
if (!bedrock || typeof bedrock !== "object")
|
|
10
|
+
return params;
|
|
11
|
+
const bedrockOptions = bedrock;
|
|
12
|
+
const thinking = bedrockOptions["thinking"];
|
|
13
|
+
const effort = bedrockOptions["effort"];
|
|
14
|
+
if (!thinking && effort === undefined)
|
|
15
|
+
return params;
|
|
16
|
+
const target = (bedrockOptions["reasoningConfig"] ??= {});
|
|
17
|
+
if (thinking && typeof thinking === "object") {
|
|
18
|
+
const thinkingOptions = thinking;
|
|
19
|
+
if (thinkingOptions["type"] !== undefined) {
|
|
20
|
+
target["type"] = thinkingOptions["type"];
|
|
21
|
+
}
|
|
22
|
+
if (thinkingOptions["budgetTokens"] !== undefined) {
|
|
23
|
+
target["budgetTokens"] = thinkingOptions["budgetTokens"];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (effort !== undefined)
|
|
27
|
+
target["maxReasoningEffort"] = effort;
|
|
28
|
+
delete bedrockOptions["thinking"];
|
|
29
|
+
delete bedrockOptions["effort"];
|
|
30
|
+
return params;
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
modelMiddlewareMatcher.useForProvider("amazon-bedrock", {
|
|
34
|
+
language: [bedrockAnthropicReasoningMiddleware],
|
|
35
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hebo-ai/gateway",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "AI gateway as a framework. For full control over models, routing & lifecycle. OpenAI-compatible /chat/completions, /embeddings & /models.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -154,40 +154,38 @@
|
|
|
154
154
|
"test": "bun test"
|
|
155
155
|
},
|
|
156
156
|
"dependencies": {
|
|
157
|
-
"@ai-sdk/provider": "^3.0.
|
|
158
|
-
"
|
|
159
|
-
"ai": "^6.0.67",
|
|
160
|
-
"serialize-error": "^13.0.1",
|
|
157
|
+
"@ai-sdk/provider": "^3.0.8",
|
|
158
|
+
"ai": "^6.0.97",
|
|
161
159
|
"zod": "^4.3.6"
|
|
162
160
|
},
|
|
163
161
|
"devDependencies": {
|
|
164
|
-
"@ai-sdk/amazon-bedrock": "^4.0.
|
|
165
|
-
"@ai-sdk/anthropic": "^3.0.
|
|
166
|
-
"@ai-sdk/cohere": "^3.0.
|
|
167
|
-
"@ai-sdk/google-vertex": "^4.0.
|
|
168
|
-
"@ai-sdk/groq": "^3.0.
|
|
169
|
-
"@ai-sdk/openai": "^3.0.
|
|
170
|
-
"@aws-sdk/credential-providers": "^3.
|
|
162
|
+
"@ai-sdk/amazon-bedrock": "^4.0.63",
|
|
163
|
+
"@ai-sdk/anthropic": "^3.0.46",
|
|
164
|
+
"@ai-sdk/cohere": "^3.0.21",
|
|
165
|
+
"@ai-sdk/google-vertex": "^4.0.61",
|
|
166
|
+
"@ai-sdk/groq": "^3.0.24",
|
|
167
|
+
"@ai-sdk/openai": "^3.0.30",
|
|
168
|
+
"@aws-sdk/credential-providers": "^3.995.0",
|
|
171
169
|
"@langfuse/otel": "^4.6.1",
|
|
172
170
|
"@mjackson/node-fetch-server": "^0.7.0",
|
|
173
171
|
"@opentelemetry/api": "^1.9.0",
|
|
174
172
|
"@opentelemetry/context-async-hooks": "^2.5.1",
|
|
175
173
|
"@opentelemetry/sdk-trace-base": "^2.5.1",
|
|
176
|
-
"@tanstack/react-router": "^1.
|
|
177
|
-
"@tanstack/react-start": "^1.
|
|
174
|
+
"@tanstack/react-router": "^1.161.3",
|
|
175
|
+
"@tanstack/react-start": "^1.161.3",
|
|
178
176
|
"@types/bun": "latest",
|
|
179
|
-
"@types/react": "^19.2.
|
|
177
|
+
"@types/react": "^19.2.14",
|
|
180
178
|
"@types/react-dom": "^19.2.3",
|
|
181
|
-
"elysia": "^1.4.
|
|
182
|
-
"hono": "^4.
|
|
183
|
-
"lefthook": "^2.
|
|
179
|
+
"elysia": "^1.4.25",
|
|
180
|
+
"hono": "^4.12.0",
|
|
181
|
+
"lefthook": "^2.1.1",
|
|
184
182
|
"next": "^16.1.6",
|
|
185
183
|
"oxfmt": "^0.24.0",
|
|
186
|
-
"oxlint": "^1.
|
|
187
|
-
"pino": "^10.3.
|
|
184
|
+
"oxlint": "^1.49.0",
|
|
185
|
+
"pino": "^10.3.1",
|
|
188
186
|
"typescript": "^5.9.3",
|
|
189
187
|
"vite": "^7.3.1",
|
|
190
|
-
"vite-tsconfig-paths": "^6.
|
|
188
|
+
"vite-tsconfig-paths": "^6.1.1",
|
|
191
189
|
"voyage-ai-provider": "^3.0.0"
|
|
192
190
|
},
|
|
193
191
|
"peerDependencies": {
|