@hebo-ai/gateway 0.9.0 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (212) hide show
  1. package/README.md +82 -4
  2. package/package.json +34 -34
  3. package/dist/config.d.ts +0 -2
  4. package/dist/config.js +0 -111
  5. package/dist/endpoints/chat-completions/converters.d.ts +0 -26
  6. package/dist/endpoints/chat-completions/converters.js +0 -524
  7. package/dist/endpoints/chat-completions/handler.d.ts +0 -2
  8. package/dist/endpoints/chat-completions/handler.js +0 -149
  9. package/dist/endpoints/chat-completions/index.d.ts +0 -4
  10. package/dist/endpoints/chat-completions/index.js +0 -4
  11. package/dist/endpoints/chat-completions/otel.d.ts +0 -5
  12. package/dist/endpoints/chat-completions/otel.js +0 -175
  13. package/dist/endpoints/chat-completions/schema.d.ts +0 -1170
  14. package/dist/endpoints/chat-completions/schema.js +0 -252
  15. package/dist/endpoints/conversations/converters.d.ts +0 -8
  16. package/dist/endpoints/conversations/converters.js +0 -29
  17. package/dist/endpoints/conversations/handler.d.ts +0 -2
  18. package/dist/endpoints/conversations/handler.js +0 -276
  19. package/dist/endpoints/conversations/index.d.ts +0 -3
  20. package/dist/endpoints/conversations/index.js +0 -3
  21. package/dist/endpoints/conversations/schema.d.ts +0 -1511
  22. package/dist/endpoints/conversations/schema.js +0 -74
  23. package/dist/endpoints/conversations/storage/dialects/greptime.d.ts +0 -10
  24. package/dist/endpoints/conversations/storage/dialects/greptime.js +0 -75
  25. package/dist/endpoints/conversations/storage/dialects/mysql.d.ts +0 -12
  26. package/dist/endpoints/conversations/storage/dialects/mysql.js +0 -118
  27. package/dist/endpoints/conversations/storage/dialects/postgres.d.ts +0 -16
  28. package/dist/endpoints/conversations/storage/dialects/postgres.js +0 -185
  29. package/dist/endpoints/conversations/storage/dialects/sqlite.d.ts +0 -11
  30. package/dist/endpoints/conversations/storage/dialects/sqlite.js +0 -176
  31. package/dist/endpoints/conversations/storage/dialects/types.d.ts +0 -42
  32. package/dist/endpoints/conversations/storage/dialects/types.js +0 -0
  33. package/dist/endpoints/conversations/storage/dialects/utils.d.ts +0 -25
  34. package/dist/endpoints/conversations/storage/dialects/utils.js +0 -80
  35. package/dist/endpoints/conversations/storage/memory.d.ts +0 -25
  36. package/dist/endpoints/conversations/storage/memory.js +0 -200
  37. package/dist/endpoints/conversations/storage/sql.d.ts +0 -33
  38. package/dist/endpoints/conversations/storage/sql.js +0 -278
  39. package/dist/endpoints/conversations/storage/types.d.ts +0 -39
  40. package/dist/endpoints/conversations/storage/types.js +0 -0
  41. package/dist/endpoints/embeddings/converters.d.ts +0 -10
  42. package/dist/endpoints/embeddings/converters.js +0 -31
  43. package/dist/endpoints/embeddings/handler.d.ts +0 -2
  44. package/dist/endpoints/embeddings/handler.js +0 -104
  45. package/dist/endpoints/embeddings/index.d.ts +0 -4
  46. package/dist/endpoints/embeddings/index.js +0 -4
  47. package/dist/endpoints/embeddings/otel.d.ts +0 -5
  48. package/dist/endpoints/embeddings/otel.js +0 -29
  49. package/dist/endpoints/embeddings/schema.d.ts +0 -44
  50. package/dist/endpoints/embeddings/schema.js +0 -29
  51. package/dist/endpoints/models/converters.d.ts +0 -6
  52. package/dist/endpoints/models/converters.js +0 -42
  53. package/dist/endpoints/models/handler.d.ts +0 -2
  54. package/dist/endpoints/models/handler.js +0 -29
  55. package/dist/endpoints/models/index.d.ts +0 -3
  56. package/dist/endpoints/models/index.js +0 -3
  57. package/dist/endpoints/models/schema.d.ts +0 -42
  58. package/dist/endpoints/models/schema.js +0 -31
  59. package/dist/endpoints/responses/converters.d.ts +0 -17
  60. package/dist/endpoints/responses/converters.js +0 -1034
  61. package/dist/endpoints/responses/handler.d.ts +0 -2
  62. package/dist/endpoints/responses/handler.js +0 -137
  63. package/dist/endpoints/responses/index.d.ts +0 -4
  64. package/dist/endpoints/responses/index.js +0 -4
  65. package/dist/endpoints/responses/otel.d.ts +0 -6
  66. package/dist/endpoints/responses/otel.js +0 -221
  67. package/dist/endpoints/responses/schema.d.ts +0 -2109
  68. package/dist/endpoints/responses/schema.js +0 -314
  69. package/dist/endpoints/shared/converters.d.ts +0 -55
  70. package/dist/endpoints/shared/converters.js +0 -179
  71. package/dist/endpoints/shared/schema.d.ts +0 -70
  72. package/dist/endpoints/shared/schema.js +0 -46
  73. package/dist/errors/ai-sdk.d.ts +0 -2
  74. package/dist/errors/ai-sdk.js +0 -52
  75. package/dist/errors/gateway.d.ts +0 -5
  76. package/dist/errors/gateway.js +0 -13
  77. package/dist/errors/openai.d.ts +0 -15
  78. package/dist/errors/openai.js +0 -40
  79. package/dist/errors/utils.d.ts +0 -22
  80. package/dist/errors/utils.js +0 -44
  81. package/dist/gateway.d.ts +0 -11
  82. package/dist/gateway.js +0 -44
  83. package/dist/index.d.ts +0 -11
  84. package/dist/index.js +0 -10
  85. package/dist/lifecycle.d.ts +0 -3
  86. package/dist/lifecycle.js +0 -113
  87. package/dist/logger/default.d.ts +0 -4
  88. package/dist/logger/default.js +0 -81
  89. package/dist/logger/index.d.ts +0 -11
  90. package/dist/logger/index.js +0 -25
  91. package/dist/middleware/common.d.ts +0 -12
  92. package/dist/middleware/common.js +0 -146
  93. package/dist/middleware/debug.d.ts +0 -3
  94. package/dist/middleware/debug.js +0 -27
  95. package/dist/middleware/matcher.d.ts +0 -28
  96. package/dist/middleware/matcher.js +0 -118
  97. package/dist/middleware/utils.d.ts +0 -2
  98. package/dist/middleware/utils.js +0 -24
  99. package/dist/models/amazon/index.d.ts +0 -2
  100. package/dist/models/amazon/index.js +0 -2
  101. package/dist/models/amazon/middleware.d.ts +0 -3
  102. package/dist/models/amazon/middleware.js +0 -68
  103. package/dist/models/amazon/presets.d.ts +0 -345
  104. package/dist/models/amazon/presets.js +0 -80
  105. package/dist/models/anthropic/index.d.ts +0 -2
  106. package/dist/models/anthropic/index.js +0 -2
  107. package/dist/models/anthropic/middleware.d.ts +0 -5
  108. package/dist/models/anthropic/middleware.js +0 -127
  109. package/dist/models/anthropic/presets.d.ts +0 -711
  110. package/dist/models/anthropic/presets.js +0 -135
  111. package/dist/models/catalog.d.ts +0 -4
  112. package/dist/models/catalog.js +0 -8
  113. package/dist/models/cohere/index.d.ts +0 -2
  114. package/dist/models/cohere/index.js +0 -2
  115. package/dist/models/cohere/middleware.d.ts +0 -3
  116. package/dist/models/cohere/middleware.js +0 -62
  117. package/dist/models/cohere/presets.d.ts +0 -411
  118. package/dist/models/cohere/presets.js +0 -134
  119. package/dist/models/google/index.d.ts +0 -2
  120. package/dist/models/google/index.js +0 -2
  121. package/dist/models/google/middleware.d.ts +0 -8
  122. package/dist/models/google/middleware.js +0 -111
  123. package/dist/models/google/presets.d.ts +0 -403
  124. package/dist/models/google/presets.js +0 -88
  125. package/dist/models/meta/index.d.ts +0 -1
  126. package/dist/models/meta/index.js +0 -1
  127. package/dist/models/meta/presets.d.ts +0 -483
  128. package/dist/models/meta/presets.js +0 -95
  129. package/dist/models/openai/index.d.ts +0 -2
  130. package/dist/models/openai/index.js +0 -2
  131. package/dist/models/openai/middleware.d.ts +0 -4
  132. package/dist/models/openai/middleware.js +0 -88
  133. package/dist/models/openai/presets.d.ts +0 -1319
  134. package/dist/models/openai/presets.js +0 -277
  135. package/dist/models/types.d.ts +0 -20
  136. package/dist/models/types.js +0 -92
  137. package/dist/models/voyage/index.d.ts +0 -2
  138. package/dist/models/voyage/index.js +0 -2
  139. package/dist/models/voyage/middleware.d.ts +0 -2
  140. package/dist/models/voyage/middleware.js +0 -19
  141. package/dist/models/voyage/presets.d.ts +0 -436
  142. package/dist/models/voyage/presets.js +0 -85
  143. package/dist/providers/anthropic/canonical.d.ts +0 -3
  144. package/dist/providers/anthropic/canonical.js +0 -9
  145. package/dist/providers/anthropic/index.d.ts +0 -1
  146. package/dist/providers/anthropic/index.js +0 -1
  147. package/dist/providers/bedrock/canonical.d.ts +0 -17
  148. package/dist/providers/bedrock/canonical.js +0 -61
  149. package/dist/providers/bedrock/index.d.ts +0 -2
  150. package/dist/providers/bedrock/index.js +0 -2
  151. package/dist/providers/bedrock/middleware.d.ts +0 -5
  152. package/dist/providers/bedrock/middleware.js +0 -137
  153. package/dist/providers/cohere/canonical.d.ts +0 -3
  154. package/dist/providers/cohere/canonical.js +0 -17
  155. package/dist/providers/cohere/index.d.ts +0 -1
  156. package/dist/providers/cohere/index.js +0 -1
  157. package/dist/providers/groq/canonical.d.ts +0 -3
  158. package/dist/providers/groq/canonical.js +0 -12
  159. package/dist/providers/groq/index.d.ts +0 -2
  160. package/dist/providers/groq/index.js +0 -2
  161. package/dist/providers/groq/middleware.d.ts +0 -2
  162. package/dist/providers/groq/middleware.js +0 -31
  163. package/dist/providers/openai/canonical.d.ts +0 -3
  164. package/dist/providers/openai/canonical.js +0 -8
  165. package/dist/providers/openai/index.d.ts +0 -1
  166. package/dist/providers/openai/index.js +0 -1
  167. package/dist/providers/registry.d.ts +0 -24
  168. package/dist/providers/registry.js +0 -103
  169. package/dist/providers/types.d.ts +0 -7
  170. package/dist/providers/types.js +0 -11
  171. package/dist/providers/vertex/canonical.d.ts +0 -3
  172. package/dist/providers/vertex/canonical.js +0 -8
  173. package/dist/providers/vertex/index.d.ts +0 -2
  174. package/dist/providers/vertex/index.js +0 -2
  175. package/dist/providers/vertex/middleware.d.ts +0 -2
  176. package/dist/providers/vertex/middleware.js +0 -47
  177. package/dist/providers/voyage/canonical.d.ts +0 -3
  178. package/dist/providers/voyage/canonical.js +0 -7
  179. package/dist/providers/voyage/index.d.ts +0 -1
  180. package/dist/providers/voyage/index.js +0 -1
  181. package/dist/telemetry/ai-sdk.d.ts +0 -2
  182. package/dist/telemetry/ai-sdk.js +0 -31
  183. package/dist/telemetry/baggage.d.ts +0 -1
  184. package/dist/telemetry/baggage.js +0 -24
  185. package/dist/telemetry/fetch.d.ts +0 -2
  186. package/dist/telemetry/fetch.js +0 -49
  187. package/dist/telemetry/gen-ai.d.ts +0 -6
  188. package/dist/telemetry/gen-ai.js +0 -78
  189. package/dist/telemetry/http.d.ts +0 -3
  190. package/dist/telemetry/http.js +0 -54
  191. package/dist/telemetry/index.d.ts +0 -1
  192. package/dist/telemetry/index.js +0 -1
  193. package/dist/telemetry/memory.d.ts +0 -2
  194. package/dist/telemetry/memory.js +0 -43
  195. package/dist/telemetry/span.d.ts +0 -13
  196. package/dist/telemetry/span.js +0 -60
  197. package/dist/types.d.ts +0 -216
  198. package/dist/types.js +0 -2
  199. package/dist/utils/env.d.ts +0 -2
  200. package/dist/utils/env.js +0 -7
  201. package/dist/utils/headers.d.ts +0 -4
  202. package/dist/utils/headers.js +0 -22
  203. package/dist/utils/preset.d.ts +0 -10
  204. package/dist/utils/preset.js +0 -41
  205. package/dist/utils/request.d.ts +0 -2
  206. package/dist/utils/request.js +0 -43
  207. package/dist/utils/response.d.ts +0 -6
  208. package/dist/utils/response.js +0 -55
  209. package/dist/utils/stream.d.ts +0 -9
  210. package/dist/utils/stream.js +0 -100
  211. package/dist/utils/url.d.ts +0 -4
  212. package/dist/utils/url.js +0 -21
@@ -1,345 +0,0 @@
1
- import type { CatalogModel } from "../types";
2
- export declare const novaMicro: import("../../utils/preset").Preset<"amazon/nova-micro", CatalogModel, {
3
- name: string;
4
- created: string;
5
- knowledge: string;
6
- context: number;
7
- modalities: {
8
- input: readonly ["text"];
9
- output: readonly ["text"];
10
- };
11
- capabilities: readonly ["tool_call", "temperature"];
12
- providers: readonly ["bedrock"];
13
- }>;
14
- export declare const novaLite: import("../../utils/preset").Preset<"amazon/nova-lite", CatalogModel, {
15
- name: string;
16
- created: string;
17
- knowledge: string;
18
- context: number;
19
- modalities: {
20
- input: readonly ["text", "image", "video", "pdf"];
21
- output: readonly ["text"];
22
- };
23
- capabilities: readonly ["attachments", "tool_call", "temperature"];
24
- providers: readonly ["bedrock"];
25
- }>;
26
- export declare const novaPro: import("../../utils/preset").Preset<"amazon/nova-pro", CatalogModel, {
27
- name: string;
28
- created: string;
29
- knowledge: string;
30
- context: number;
31
- modalities: {
32
- input: readonly ["text", "image", "video", "pdf"];
33
- output: readonly ["text"];
34
- };
35
- capabilities: readonly ["attachments", "tool_call", "temperature"];
36
- providers: readonly ["bedrock"];
37
- }>;
38
- export declare const novaPremier: import("../../utils/preset").Preset<"amazon/nova-premier", CatalogModel, {
39
- name: string;
40
- created: string;
41
- knowledge: string;
42
- context: number;
43
- modalities: {
44
- input: readonly ["text", "image", "video", "pdf"];
45
- output: readonly ["text"];
46
- };
47
- capabilities: readonly ["attachments", "tool_call", "temperature"];
48
- providers: readonly ["bedrock"];
49
- }>;
50
- export declare const nova2Lite: import("../../utils/preset").Preset<"amazon/nova-2-lite", CatalogModel, {
51
- name: string;
52
- created: string;
53
- knowledge: string;
54
- context: number;
55
- modalities: {
56
- input: readonly ["text"];
57
- output: readonly ["text"];
58
- };
59
- capabilities: readonly ["tool_call", "temperature"];
60
- providers: readonly ["bedrock"];
61
- }>;
62
- export declare const nova2MultimodalEmbeddings: import("../../utils/preset").Preset<"amazon/nova-2-multimodal-embeddings", CatalogModel, {
63
- name: string;
64
- created: string;
65
- context: number;
66
- modalities: {
67
- input: readonly ["text", "image", "audio", "video", "pdf"];
68
- output: readonly ["embedding"];
69
- };
70
- providers: readonly ["bedrock"];
71
- }>;
72
- export declare const nova: {
73
- readonly latest: readonly [import("../../utils/preset").Preset<"amazon/nova-micro", CatalogModel, {
74
- name: string;
75
- created: string;
76
- knowledge: string;
77
- context: number;
78
- modalities: {
79
- input: readonly ["text"];
80
- output: readonly ["text"];
81
- };
82
- capabilities: readonly ["tool_call", "temperature"];
83
- providers: readonly ["bedrock"];
84
- }>, import("../../utils/preset").Preset<"amazon/nova-lite", CatalogModel, {
85
- name: string;
86
- created: string;
87
- knowledge: string;
88
- context: number;
89
- modalities: {
90
- input: readonly ["text", "image", "video", "pdf"];
91
- output: readonly ["text"];
92
- };
93
- capabilities: readonly ["attachments", "tool_call", "temperature"];
94
- providers: readonly ["bedrock"];
95
- }>, import("../../utils/preset").Preset<"amazon/nova-pro", CatalogModel, {
96
- name: string;
97
- created: string;
98
- knowledge: string;
99
- context: number;
100
- modalities: {
101
- input: readonly ["text", "image", "video", "pdf"];
102
- output: readonly ["text"];
103
- };
104
- capabilities: readonly ["attachments", "tool_call", "temperature"];
105
- providers: readonly ["bedrock"];
106
- }>, import("../../utils/preset").Preset<"amazon/nova-premier", CatalogModel, {
107
- name: string;
108
- created: string;
109
- knowledge: string;
110
- context: number;
111
- modalities: {
112
- input: readonly ["text", "image", "video", "pdf"];
113
- output: readonly ["text"];
114
- };
115
- capabilities: readonly ["attachments", "tool_call", "temperature"];
116
- providers: readonly ["bedrock"];
117
- }>, import("../../utils/preset").Preset<"amazon/nova-2-lite", CatalogModel, {
118
- name: string;
119
- created: string;
120
- knowledge: string;
121
- context: number;
122
- modalities: {
123
- input: readonly ["text"];
124
- output: readonly ["text"];
125
- };
126
- capabilities: readonly ["tool_call", "temperature"];
127
- providers: readonly ["bedrock"];
128
- }>, import("../../utils/preset").Preset<"amazon/nova-2-multimodal-embeddings", CatalogModel, {
129
- name: string;
130
- created: string;
131
- context: number;
132
- modalities: {
133
- input: readonly ["text", "image", "audio", "video", "pdf"];
134
- output: readonly ["embedding"];
135
- };
136
- providers: readonly ["bedrock"];
137
- }>];
138
- readonly embeddings: readonly [import("../../utils/preset").Preset<"amazon/nova-2-multimodal-embeddings", CatalogModel, {
139
- name: string;
140
- created: string;
141
- context: number;
142
- modalities: {
143
- input: readonly ["text", "image", "audio", "video", "pdf"];
144
- output: readonly ["embedding"];
145
- };
146
- providers: readonly ["bedrock"];
147
- }>];
148
- readonly all: (import("../../utils/preset").Preset<"amazon/nova-micro", CatalogModel, {
149
- name: string;
150
- created: string;
151
- knowledge: string;
152
- context: number;
153
- modalities: {
154
- input: readonly ["text"];
155
- output: readonly ["text"];
156
- };
157
- capabilities: readonly ["tool_call", "temperature"];
158
- providers: readonly ["bedrock"];
159
- }> | import("../../utils/preset").Preset<"amazon/nova-lite", CatalogModel, {
160
- name: string;
161
- created: string;
162
- knowledge: string;
163
- context: number;
164
- modalities: {
165
- input: readonly ["text", "image", "video", "pdf"];
166
- output: readonly ["text"];
167
- };
168
- capabilities: readonly ["attachments", "tool_call", "temperature"];
169
- providers: readonly ["bedrock"];
170
- }> | import("../../utils/preset").Preset<"amazon/nova-pro", CatalogModel, {
171
- name: string;
172
- created: string;
173
- knowledge: string;
174
- context: number;
175
- modalities: {
176
- input: readonly ["text", "image", "video", "pdf"];
177
- output: readonly ["text"];
178
- };
179
- capabilities: readonly ["attachments", "tool_call", "temperature"];
180
- providers: readonly ["bedrock"];
181
- }> | import("../../utils/preset").Preset<"amazon/nova-premier", CatalogModel, {
182
- name: string;
183
- created: string;
184
- knowledge: string;
185
- context: number;
186
- modalities: {
187
- input: readonly ["text", "image", "video", "pdf"];
188
- output: readonly ["text"];
189
- };
190
- capabilities: readonly ["attachments", "tool_call", "temperature"];
191
- providers: readonly ["bedrock"];
192
- }> | import("../../utils/preset").Preset<"amazon/nova-2-lite", CatalogModel, {
193
- name: string;
194
- created: string;
195
- knowledge: string;
196
- context: number;
197
- modalities: {
198
- input: readonly ["text"];
199
- output: readonly ["text"];
200
- };
201
- capabilities: readonly ["tool_call", "temperature"];
202
- providers: readonly ["bedrock"];
203
- }> | import("../../utils/preset").Preset<"amazon/nova-2-multimodal-embeddings", CatalogModel, {
204
- name: string;
205
- created: string;
206
- context: number;
207
- modalities: {
208
- input: readonly ["text", "image", "audio", "video", "pdf"];
209
- output: readonly ["embedding"];
210
- };
211
- providers: readonly ["bedrock"];
212
- }>)[];
213
- readonly "v1.x": readonly [import("../../utils/preset").Preset<"amazon/nova-micro", CatalogModel, {
214
- name: string;
215
- created: string;
216
- knowledge: string;
217
- context: number;
218
- modalities: {
219
- input: readonly ["text"];
220
- output: readonly ["text"];
221
- };
222
- capabilities: readonly ["tool_call", "temperature"];
223
- providers: readonly ["bedrock"];
224
- }>, import("../../utils/preset").Preset<"amazon/nova-lite", CatalogModel, {
225
- name: string;
226
- created: string;
227
- knowledge: string;
228
- context: number;
229
- modalities: {
230
- input: readonly ["text", "image", "video", "pdf"];
231
- output: readonly ["text"];
232
- };
233
- capabilities: readonly ["attachments", "tool_call", "temperature"];
234
- providers: readonly ["bedrock"];
235
- }>, import("../../utils/preset").Preset<"amazon/nova-pro", CatalogModel, {
236
- name: string;
237
- created: string;
238
- knowledge: string;
239
- context: number;
240
- modalities: {
241
- input: readonly ["text", "image", "video", "pdf"];
242
- output: readonly ["text"];
243
- };
244
- capabilities: readonly ["attachments", "tool_call", "temperature"];
245
- providers: readonly ["bedrock"];
246
- }>, import("../../utils/preset").Preset<"amazon/nova-premier", CatalogModel, {
247
- name: string;
248
- created: string;
249
- knowledge: string;
250
- context: number;
251
- modalities: {
252
- input: readonly ["text", "image", "video", "pdf"];
253
- output: readonly ["text"];
254
- };
255
- capabilities: readonly ["attachments", "tool_call", "temperature"];
256
- providers: readonly ["bedrock"];
257
- }>];
258
- readonly "v2.x": readonly [import("../../utils/preset").Preset<"amazon/nova-2-lite", CatalogModel, {
259
- name: string;
260
- created: string;
261
- knowledge: string;
262
- context: number;
263
- modalities: {
264
- input: readonly ["text"];
265
- output: readonly ["text"];
266
- };
267
- capabilities: readonly ["tool_call", "temperature"];
268
- providers: readonly ["bedrock"];
269
- }>, import("../../utils/preset").Preset<"amazon/nova-2-multimodal-embeddings", CatalogModel, {
270
- name: string;
271
- created: string;
272
- context: number;
273
- modalities: {
274
- input: readonly ["text", "image", "audio", "video", "pdf"];
275
- output: readonly ["embedding"];
276
- };
277
- providers: readonly ["bedrock"];
278
- }>];
279
- readonly v1: readonly [import("../../utils/preset").Preset<"amazon/nova-micro", CatalogModel, {
280
- name: string;
281
- created: string;
282
- knowledge: string;
283
- context: number;
284
- modalities: {
285
- input: readonly ["text"];
286
- output: readonly ["text"];
287
- };
288
- capabilities: readonly ["tool_call", "temperature"];
289
- providers: readonly ["bedrock"];
290
- }>, import("../../utils/preset").Preset<"amazon/nova-lite", CatalogModel, {
291
- name: string;
292
- created: string;
293
- knowledge: string;
294
- context: number;
295
- modalities: {
296
- input: readonly ["text", "image", "video", "pdf"];
297
- output: readonly ["text"];
298
- };
299
- capabilities: readonly ["attachments", "tool_call", "temperature"];
300
- providers: readonly ["bedrock"];
301
- }>, import("../../utils/preset").Preset<"amazon/nova-pro", CatalogModel, {
302
- name: string;
303
- created: string;
304
- knowledge: string;
305
- context: number;
306
- modalities: {
307
- input: readonly ["text", "image", "video", "pdf"];
308
- output: readonly ["text"];
309
- };
310
- capabilities: readonly ["attachments", "tool_call", "temperature"];
311
- providers: readonly ["bedrock"];
312
- }>, import("../../utils/preset").Preset<"amazon/nova-premier", CatalogModel, {
313
- name: string;
314
- created: string;
315
- knowledge: string;
316
- context: number;
317
- modalities: {
318
- input: readonly ["text", "image", "video", "pdf"];
319
- output: readonly ["text"];
320
- };
321
- capabilities: readonly ["attachments", "tool_call", "temperature"];
322
- providers: readonly ["bedrock"];
323
- }>];
324
- readonly v2: readonly [import("../../utils/preset").Preset<"amazon/nova-2-lite", CatalogModel, {
325
- name: string;
326
- created: string;
327
- knowledge: string;
328
- context: number;
329
- modalities: {
330
- input: readonly ["text"];
331
- output: readonly ["text"];
332
- };
333
- capabilities: readonly ["tool_call", "temperature"];
334
- providers: readonly ["bedrock"];
335
- }>, import("../../utils/preset").Preset<"amazon/nova-2-multimodal-embeddings", CatalogModel, {
336
- name: string;
337
- created: string;
338
- context: number;
339
- modalities: {
340
- input: readonly ["text", "image", "audio", "video", "pdf"];
341
- output: readonly ["embedding"];
342
- };
343
- providers: readonly ["bedrock"];
344
- }>];
345
- };
@@ -1,80 +0,0 @@
1
- import { presetFor } from "../../utils/preset";
2
- const NOVA_TEXT_BASE = {
3
- modalities: {
4
- input: ["text"],
5
- output: ["text"],
6
- },
7
- capabilities: ["tool_call", "temperature"],
8
- providers: ["bedrock"],
9
- };
10
- const NOVA_MULTIMODAL_BASE = {
11
- modalities: {
12
- input: ["text", "image", "video", "pdf"],
13
- output: ["text"],
14
- },
15
- capabilities: ["attachments", "tool_call", "temperature"],
16
- providers: ["bedrock"],
17
- };
18
- const NOVA_EMBEDDINGS_BASE = {
19
- modalities: {
20
- input: ["text", "image", "audio", "video", "pdf"],
21
- output: ["embedding"],
22
- },
23
- providers: ["bedrock"],
24
- };
25
- export const novaMicro = presetFor()("amazon/nova-micro", {
26
- ...NOVA_TEXT_BASE,
27
- name: "Nova Micro",
28
- created: "2024-12-03",
29
- knowledge: "2024-10",
30
- context: 128000,
31
- });
32
- export const novaLite = presetFor()("amazon/nova-lite", {
33
- ...NOVA_MULTIMODAL_BASE,
34
- name: "Nova Lite",
35
- created: "2024-12-03",
36
- knowledge: "2024-10",
37
- context: 300000,
38
- });
39
- export const novaPro = presetFor()("amazon/nova-pro", {
40
- ...NOVA_MULTIMODAL_BASE,
41
- name: "Nova Pro",
42
- created: "2024-12-03",
43
- knowledge: "2024-10",
44
- context: 300000,
45
- });
46
- export const novaPremier = presetFor()("amazon/nova-premier", {
47
- ...NOVA_MULTIMODAL_BASE,
48
- name: "Nova Premier",
49
- created: "2024-12-03",
50
- knowledge: "2024-10",
51
- context: 1000000,
52
- });
53
- export const nova2Lite = presetFor()("amazon/nova-2-lite", {
54
- ...NOVA_TEXT_BASE,
55
- name: "Nova 2 Lite",
56
- created: "2025-12-01",
57
- knowledge: "2024-10",
58
- context: 128000,
59
- });
60
- export const nova2MultimodalEmbeddings = presetFor()("amazon/nova-2-multimodal-embeddings", {
61
- ...NOVA_EMBEDDINGS_BASE,
62
- name: "Nova 2 Embeddings",
63
- created: "2025-10-28",
64
- context: 8000,
65
- });
66
- const novaAtomic = {
67
- v1: [novaMicro, novaLite, novaPro, novaPremier],
68
- v2: [nova2Lite, nova2MultimodalEmbeddings],
69
- };
70
- const novaGroups = {
71
- "v1.x": [...novaAtomic["v1"]],
72
- "v2.x": [...novaAtomic["v2"]],
73
- };
74
- export const nova = {
75
- ...novaAtomic,
76
- ...novaGroups,
77
- latest: [...novaAtomic["v1"], ...novaAtomic["v2"]],
78
- embeddings: [nova2MultimodalEmbeddings],
79
- all: Object.values(novaAtomic).flat(),
80
- };
@@ -1,2 +0,0 @@
1
- export * from "./presets";
2
- export * from "./middleware";
@@ -1,2 +0,0 @@
1
- export * from "./presets";
2
- export * from "./middleware";
@@ -1,5 +0,0 @@
1
- import type { LanguageModelMiddleware } from "ai";
2
- import type { ChatCompletionsReasoningEffort } from "../../endpoints/chat-completions/schema";
3
- export declare function mapClaudeReasoningEffort(effort: ChatCompletionsReasoningEffort, modelId: string): "low" | "medium" | "high" | "max";
4
- export declare const claudeReasoningMiddleware: LanguageModelMiddleware;
5
- export declare const claudePromptCachingMiddleware: LanguageModelMiddleware;
@@ -1,127 +0,0 @@
1
- import { modelMiddlewareMatcher } from "../../middleware/matcher";
2
- import { calculateReasoningBudgetFromEffort } from "../../middleware/utils";
3
- const isClaude = (family, version) => {
4
- const dashed = version.replace(".", "-");
5
- return (modelId) => modelId.includes(`claude-${family}-${version}`) ||
6
- modelId.includes(`claude-${family}-${dashed}`);
7
- };
8
- const isClaude4 = (modelId) => modelId.includes("claude-") && modelId.includes("-4");
9
- const isOpus46 = isClaude("opus", "4.6");
10
- const isOpus45 = isClaude("opus", "4.5");
11
- const isOpus4 = isClaude("opus", "4");
12
- const isSonnet46 = isClaude("sonnet", "4.6");
13
- export function mapClaudeReasoningEffort(effort, modelId) {
14
- if (isOpus46(modelId)) {
15
- switch (effort) {
16
- case "none":
17
- case "minimal":
18
- case "low":
19
- return "low";
20
- case "medium":
21
- return "medium";
22
- case "high":
23
- return "high";
24
- case "xhigh":
25
- return "max";
26
- }
27
- }
28
- switch (effort) {
29
- case "none":
30
- case "minimal":
31
- case "low":
32
- return "low";
33
- case "medium":
34
- return "medium";
35
- case "high":
36
- case "xhigh":
37
- return "high";
38
- }
39
- }
40
- function getMaxOutputTokens(modelId) {
41
- if (isOpus46(modelId))
42
- return 128_000;
43
- if (isOpus45(modelId))
44
- return 64_000;
45
- if (isOpus4(modelId))
46
- return 32_000;
47
- return 64_000;
48
- }
49
- // Documentation:
50
- // https://platform.claude.com/docs/en/build-with-claude/effort
51
- // https://platform.claude.com/docs/en/build-with-claude/extended-thinking
52
- // https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking
53
- export const claudeReasoningMiddleware = {
54
- specificationVersion: "v3",
55
- // oxlint-disable-next-line require-await
56
- transformParams: async ({ params, model }) => {
57
- const unknown = params.providerOptions?.["unknown"];
58
- if (!unknown)
59
- return params;
60
- const reasoning = unknown["reasoning"];
61
- if (!reasoning)
62
- return params;
63
- const target = (params.providerOptions["anthropic"] ??= {});
64
- const modelId = model.modelId;
65
- const clampedMaxTokens = reasoning.max_tokens && Math.min(reasoning.max_tokens, getMaxOutputTokens(modelId));
66
- if (!reasoning.enabled) {
67
- target.thinking = { type: "disabled" };
68
- }
69
- else if (reasoning.effort) {
70
- if (isClaude4(modelId)) {
71
- target.effort = mapClaudeReasoningEffort(reasoning.effort, modelId);
72
- }
73
- if (isOpus46(modelId)) {
74
- target.thinking = clampedMaxTokens
75
- ? // @ts-expect-error AI SDK type missing type:adaptive with budgetToken
76
- { type: "adaptive", budgetTokens: clampedMaxTokens }
77
- : { type: "adaptive" };
78
- }
79
- else if (isSonnet46(modelId)) {
80
- target.thinking = clampedMaxTokens
81
- ? { type: "enabled", budgetTokens: clampedMaxTokens }
82
- : { type: "adaptive" };
83
- }
84
- else {
85
- target.thinking = { type: "enabled" };
86
- if (clampedMaxTokens) {
87
- target.thinking.budgetTokens = clampedMaxTokens;
88
- }
89
- else {
90
- // FUTURE: warn that reasoning.max_tokens was computed
91
- target.thinking.budgetTokens = calculateReasoningBudgetFromEffort(reasoning.effort, params.maxOutputTokens ?? getMaxOutputTokens(modelId), 1024);
92
- }
93
- }
94
- }
95
- else if (clampedMaxTokens) {
96
- target.thinking = {
97
- type: "enabled",
98
- budgetTokens: clampedMaxTokens,
99
- };
100
- }
101
- else {
102
- target.thinking = { type: "enabled" };
103
- }
104
- delete unknown["reasoning"];
105
- return params;
106
- },
107
- };
108
- // https://platform.claude.com/docs/en/build-with-claude/prompt-caching
109
- export const claudePromptCachingMiddleware = {
110
- specificationVersion: "v3",
111
- // oxlint-disable-next-line require-await
112
- transformParams: async ({ params }) => {
113
- const unknown = params.providerOptions?.["unknown"];
114
- if (!unknown)
115
- return params;
116
- const cacheControl = unknown["cache_control"];
117
- if (cacheControl) {
118
- (params.providerOptions["anthropic"] ??= {}).cacheControl =
119
- cacheControl;
120
- }
121
- delete unknown["cache_control"];
122
- return params;
123
- },
124
- };
125
- modelMiddlewareMatcher.useForModel(["anthropic/claude-*3*7*", "anthropic/claude-*4*"], {
126
- language: [claudeReasoningMiddleware, claudePromptCachingMiddleware],
127
- });