@hebo-ai/gateway 0.9.4 → 0.10.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/README.md +23 -12
- package/dist/endpoints/chat-completions/schema.d.ts +289 -57
- package/dist/endpoints/conversations/schema.d.ts +200 -40
- package/dist/endpoints/messages/converters.d.ts +24 -0
- package/dist/endpoints/messages/converters.js +661 -0
- package/dist/endpoints/messages/handler.d.ts +2 -0
- package/dist/endpoints/messages/handler.js +142 -0
- package/dist/endpoints/messages/index.d.ts +4 -0
- package/dist/endpoints/messages/index.js +4 -0
- package/dist/endpoints/messages/otel.d.ts +6 -0
- package/dist/endpoints/messages/otel.js +171 -0
- package/dist/endpoints/messages/schema.d.ts +661 -0
- package/dist/endpoints/messages/schema.js +232 -0
- package/dist/endpoints/responses/schema.d.ts +237 -45
- package/dist/endpoints/shared/schema.d.ts +23 -2
- package/dist/endpoints/shared/schema.js +3 -1
- package/dist/errors/anthropic.d.ts +10 -0
- package/dist/errors/anthropic.js +46 -0
- package/dist/errors/openai.js +1 -10
- package/dist/errors/utils.d.ts +3 -1
- package/dist/errors/utils.js +9 -0
- package/dist/gateway.d.ts +1 -0
- package/dist/gateway.js +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/lifecycle.js +12 -3
- package/dist/models/anthropic/middleware.js +5 -0
- package/dist/providers/bedrock/middleware.js +16 -1
- package/dist/providers/registry.d.ts +1 -1
- package/dist/types.d.ts +6 -5
- package/dist/utils/response.d.ts +1 -0
- package/dist/utils/stream.d.ts +1 -0
- package/dist/utils/stream.js +10 -3
- package/package.json +14 -3
|
@@ -17,7 +17,11 @@ export declare const ConversationItemSchema: z.ZodIntersection<z.ZodObject<{
|
|
|
17
17
|
extra_content: z.ZodOptional<z.ZodType<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown>>>;
|
|
18
18
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
19
19
|
type: z.ZodLiteral<"ephemeral">;
|
|
20
|
-
ttl: z.ZodOptional<z.
|
|
20
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
21
|
+
"5m": "5m";
|
|
22
|
+
"1h": "1h";
|
|
23
|
+
"24h": "24h";
|
|
24
|
+
}>>;
|
|
21
25
|
}, z.core.$strip>>;
|
|
22
26
|
role: z.ZodLiteral<"user">;
|
|
23
27
|
content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -79,7 +83,11 @@ export declare const ConversationItemSchema: z.ZodIntersection<z.ZodObject<{
|
|
|
79
83
|
}, z.core.$strip>;
|
|
80
84
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
81
85
|
type: z.ZodLiteral<"ephemeral">;
|
|
82
|
-
ttl: z.ZodOptional<z.
|
|
86
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
87
|
+
"5m": "5m";
|
|
88
|
+
"1h": "1h";
|
|
89
|
+
"24h": "24h";
|
|
90
|
+
}>>;
|
|
83
91
|
}, z.core.$strip>>;
|
|
84
92
|
}, z.core.$strip>]>>]>;
|
|
85
93
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -93,7 +101,11 @@ export declare const ConversationItemSchema: z.ZodIntersection<z.ZodObject<{
|
|
|
93
101
|
extra_content: z.ZodOptional<z.ZodType<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown>>>;
|
|
94
102
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
95
103
|
type: z.ZodLiteral<"ephemeral">;
|
|
96
|
-
ttl: z.ZodOptional<z.
|
|
104
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
105
|
+
"5m": "5m";
|
|
106
|
+
"1h": "1h";
|
|
107
|
+
"24h": "24h";
|
|
108
|
+
}>>;
|
|
97
109
|
}, z.core.$strip>>;
|
|
98
110
|
role: z.ZodLiteral<"assistant">;
|
|
99
111
|
content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodObject<{
|
|
@@ -112,7 +124,11 @@ export declare const ConversationItemSchema: z.ZodIntersection<z.ZodObject<{
|
|
|
112
124
|
extra_content: z.ZodOptional<z.ZodType<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown>>>;
|
|
113
125
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
114
126
|
type: z.ZodLiteral<"ephemeral">;
|
|
115
|
-
ttl: z.ZodOptional<z.
|
|
127
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
128
|
+
"5m": "5m";
|
|
129
|
+
"1h": "1h";
|
|
130
|
+
"24h": "24h";
|
|
131
|
+
}>>;
|
|
116
132
|
}, z.core.$strip>>;
|
|
117
133
|
role: z.ZodLiteral<"system">;
|
|
118
134
|
content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -174,7 +190,11 @@ export declare const ConversationItemSchema: z.ZodIntersection<z.ZodObject<{
|
|
|
174
190
|
}, z.core.$strip>;
|
|
175
191
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
176
192
|
type: z.ZodLiteral<"ephemeral">;
|
|
177
|
-
ttl: z.ZodOptional<z.
|
|
193
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
194
|
+
"5m": "5m";
|
|
195
|
+
"1h": "1h";
|
|
196
|
+
"24h": "24h";
|
|
197
|
+
}>>;
|
|
178
198
|
}, z.core.$strip>>;
|
|
179
199
|
}, z.core.$strip>]>>]>;
|
|
180
200
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -188,7 +208,11 @@ export declare const ConversationItemSchema: z.ZodIntersection<z.ZodObject<{
|
|
|
188
208
|
extra_content: z.ZodOptional<z.ZodType<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown>>>;
|
|
189
209
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
190
210
|
type: z.ZodLiteral<"ephemeral">;
|
|
191
|
-
ttl: z.ZodOptional<z.
|
|
211
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
212
|
+
"5m": "5m";
|
|
213
|
+
"1h": "1h";
|
|
214
|
+
"24h": "24h";
|
|
215
|
+
}>>;
|
|
192
216
|
}, z.core.$strip>>;
|
|
193
217
|
role: z.ZodLiteral<"developer">;
|
|
194
218
|
content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -250,7 +274,11 @@ export declare const ConversationItemSchema: z.ZodIntersection<z.ZodObject<{
|
|
|
250
274
|
}, z.core.$strip>;
|
|
251
275
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
252
276
|
type: z.ZodLiteral<"ephemeral">;
|
|
253
|
-
ttl: z.ZodOptional<z.
|
|
277
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
278
|
+
"5m": "5m";
|
|
279
|
+
"1h": "1h";
|
|
280
|
+
"24h": "24h";
|
|
281
|
+
}>>;
|
|
254
282
|
}, z.core.$strip>>;
|
|
255
283
|
}, z.core.$strip>]>>]>;
|
|
256
284
|
}, z.core.$strip>], "role">, z.ZodObject<{
|
|
@@ -267,7 +295,11 @@ export declare const ConversationItemSchema: z.ZodIntersection<z.ZodObject<{
|
|
|
267
295
|
extra_content: z.ZodOptional<z.ZodType<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown>>>;
|
|
268
296
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
269
297
|
type: z.ZodLiteral<"ephemeral">;
|
|
270
|
-
ttl: z.ZodOptional<z.
|
|
298
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
299
|
+
"5m": "5m";
|
|
300
|
+
"1h": "1h";
|
|
301
|
+
"24h": "24h";
|
|
302
|
+
}>>;
|
|
271
303
|
}, z.core.$strip>>;
|
|
272
304
|
}, z.core.$strip>, z.ZodObject<{
|
|
273
305
|
type: z.ZodLiteral<"function_call_output">;
|
|
@@ -332,7 +364,11 @@ export declare const ConversationItemSchema: z.ZodIntersection<z.ZodObject<{
|
|
|
332
364
|
}, z.core.$strip>;
|
|
333
365
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
334
366
|
type: z.ZodLiteral<"ephemeral">;
|
|
335
|
-
ttl: z.ZodOptional<z.
|
|
367
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
368
|
+
"5m": "5m";
|
|
369
|
+
"1h": "1h";
|
|
370
|
+
"24h": "24h";
|
|
371
|
+
}>>;
|
|
336
372
|
}, z.core.$strip>>;
|
|
337
373
|
}, z.core.$strip>]>>]>;
|
|
338
374
|
status: z.ZodOptional<z.ZodEnum<{
|
|
@@ -343,7 +379,11 @@ export declare const ConversationItemSchema: z.ZodIntersection<z.ZodObject<{
|
|
|
343
379
|
extra_content: z.ZodOptional<z.ZodType<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown>>>;
|
|
344
380
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
345
381
|
type: z.ZodLiteral<"ephemeral">;
|
|
346
|
-
ttl: z.ZodOptional<z.
|
|
382
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
383
|
+
"5m": "5m";
|
|
384
|
+
"1h": "1h";
|
|
385
|
+
"24h": "24h";
|
|
386
|
+
}>>;
|
|
347
387
|
}, z.core.$strip>>;
|
|
348
388
|
}, z.core.$strip>, z.ZodObject<{
|
|
349
389
|
type: z.ZodLiteral<"reasoning">;
|
|
@@ -393,7 +433,11 @@ export declare const ConversationCreateParamsSchema: z.ZodObject<{
|
|
|
393
433
|
extra_content: z.ZodOptional<z.ZodType<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown>>>;
|
|
394
434
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
395
435
|
type: z.ZodLiteral<"ephemeral">;
|
|
396
|
-
ttl: z.ZodOptional<z.
|
|
436
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
437
|
+
"5m": "5m";
|
|
438
|
+
"1h": "1h";
|
|
439
|
+
"24h": "24h";
|
|
440
|
+
}>>;
|
|
397
441
|
}, z.core.$strip>>;
|
|
398
442
|
role: z.ZodLiteral<"user">;
|
|
399
443
|
content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -455,7 +499,11 @@ export declare const ConversationCreateParamsSchema: z.ZodObject<{
|
|
|
455
499
|
}, z.core.$strip>;
|
|
456
500
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
457
501
|
type: z.ZodLiteral<"ephemeral">;
|
|
458
|
-
ttl: z.ZodOptional<z.
|
|
502
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
503
|
+
"5m": "5m";
|
|
504
|
+
"1h": "1h";
|
|
505
|
+
"24h": "24h";
|
|
506
|
+
}>>;
|
|
459
507
|
}, z.core.$strip>>;
|
|
460
508
|
}, z.core.$strip>]>>]>;
|
|
461
509
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -469,7 +517,11 @@ export declare const ConversationCreateParamsSchema: z.ZodObject<{
|
|
|
469
517
|
extra_content: z.ZodOptional<z.ZodType<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown>>>;
|
|
470
518
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
471
519
|
type: z.ZodLiteral<"ephemeral">;
|
|
472
|
-
ttl: z.ZodOptional<z.
|
|
520
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
521
|
+
"5m": "5m";
|
|
522
|
+
"1h": "1h";
|
|
523
|
+
"24h": "24h";
|
|
524
|
+
}>>;
|
|
473
525
|
}, z.core.$strip>>;
|
|
474
526
|
role: z.ZodLiteral<"assistant">;
|
|
475
527
|
content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodObject<{
|
|
@@ -488,7 +540,11 @@ export declare const ConversationCreateParamsSchema: z.ZodObject<{
|
|
|
488
540
|
extra_content: z.ZodOptional<z.ZodType<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown>>>;
|
|
489
541
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
490
542
|
type: z.ZodLiteral<"ephemeral">;
|
|
491
|
-
ttl: z.ZodOptional<z.
|
|
543
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
544
|
+
"5m": "5m";
|
|
545
|
+
"1h": "1h";
|
|
546
|
+
"24h": "24h";
|
|
547
|
+
}>>;
|
|
492
548
|
}, z.core.$strip>>;
|
|
493
549
|
role: z.ZodLiteral<"system">;
|
|
494
550
|
content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -550,7 +606,11 @@ export declare const ConversationCreateParamsSchema: z.ZodObject<{
|
|
|
550
606
|
}, z.core.$strip>;
|
|
551
607
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
552
608
|
type: z.ZodLiteral<"ephemeral">;
|
|
553
|
-
ttl: z.ZodOptional<z.
|
|
609
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
610
|
+
"5m": "5m";
|
|
611
|
+
"1h": "1h";
|
|
612
|
+
"24h": "24h";
|
|
613
|
+
}>>;
|
|
554
614
|
}, z.core.$strip>>;
|
|
555
615
|
}, z.core.$strip>]>>]>;
|
|
556
616
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -564,7 +624,11 @@ export declare const ConversationCreateParamsSchema: z.ZodObject<{
|
|
|
564
624
|
extra_content: z.ZodOptional<z.ZodType<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown>>>;
|
|
565
625
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
566
626
|
type: z.ZodLiteral<"ephemeral">;
|
|
567
|
-
ttl: z.ZodOptional<z.
|
|
627
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
628
|
+
"5m": "5m";
|
|
629
|
+
"1h": "1h";
|
|
630
|
+
"24h": "24h";
|
|
631
|
+
}>>;
|
|
568
632
|
}, z.core.$strip>>;
|
|
569
633
|
role: z.ZodLiteral<"developer">;
|
|
570
634
|
content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -626,7 +690,11 @@ export declare const ConversationCreateParamsSchema: z.ZodObject<{
|
|
|
626
690
|
}, z.core.$strip>;
|
|
627
691
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
628
692
|
type: z.ZodLiteral<"ephemeral">;
|
|
629
|
-
ttl: z.ZodOptional<z.
|
|
693
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
694
|
+
"5m": "5m";
|
|
695
|
+
"1h": "1h";
|
|
696
|
+
"24h": "24h";
|
|
697
|
+
}>>;
|
|
630
698
|
}, z.core.$strip>>;
|
|
631
699
|
}, z.core.$strip>]>>]>;
|
|
632
700
|
}, z.core.$strip>], "role">, z.ZodObject<{
|
|
@@ -643,7 +711,11 @@ export declare const ConversationCreateParamsSchema: z.ZodObject<{
|
|
|
643
711
|
extra_content: z.ZodOptional<z.ZodType<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown>>>;
|
|
644
712
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
645
713
|
type: z.ZodLiteral<"ephemeral">;
|
|
646
|
-
ttl: z.ZodOptional<z.
|
|
714
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
715
|
+
"5m": "5m";
|
|
716
|
+
"1h": "1h";
|
|
717
|
+
"24h": "24h";
|
|
718
|
+
}>>;
|
|
647
719
|
}, z.core.$strip>>;
|
|
648
720
|
}, z.core.$strip>, z.ZodObject<{
|
|
649
721
|
type: z.ZodLiteral<"function_call_output">;
|
|
@@ -708,7 +780,11 @@ export declare const ConversationCreateParamsSchema: z.ZodObject<{
|
|
|
708
780
|
}, z.core.$strip>;
|
|
709
781
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
710
782
|
type: z.ZodLiteral<"ephemeral">;
|
|
711
|
-
ttl: z.ZodOptional<z.
|
|
783
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
784
|
+
"5m": "5m";
|
|
785
|
+
"1h": "1h";
|
|
786
|
+
"24h": "24h";
|
|
787
|
+
}>>;
|
|
712
788
|
}, z.core.$strip>>;
|
|
713
789
|
}, z.core.$strip>]>>]>;
|
|
714
790
|
status: z.ZodOptional<z.ZodEnum<{
|
|
@@ -719,7 +795,11 @@ export declare const ConversationCreateParamsSchema: z.ZodObject<{
|
|
|
719
795
|
extra_content: z.ZodOptional<z.ZodType<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown>>>;
|
|
720
796
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
721
797
|
type: z.ZodLiteral<"ephemeral">;
|
|
722
|
-
ttl: z.ZodOptional<z.
|
|
798
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
799
|
+
"5m": "5m";
|
|
800
|
+
"1h": "1h";
|
|
801
|
+
"24h": "24h";
|
|
802
|
+
}>>;
|
|
723
803
|
}, z.core.$strip>>;
|
|
724
804
|
}, z.core.$strip>, z.ZodObject<{
|
|
725
805
|
type: z.ZodLiteral<"reasoning">;
|
|
@@ -759,7 +839,11 @@ export declare const ConversationItemsAddBodySchema: z.ZodObject<{
|
|
|
759
839
|
extra_content: z.ZodOptional<z.ZodType<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown>>>;
|
|
760
840
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
761
841
|
type: z.ZodLiteral<"ephemeral">;
|
|
762
|
-
ttl: z.ZodOptional<z.
|
|
842
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
843
|
+
"5m": "5m";
|
|
844
|
+
"1h": "1h";
|
|
845
|
+
"24h": "24h";
|
|
846
|
+
}>>;
|
|
763
847
|
}, z.core.$strip>>;
|
|
764
848
|
role: z.ZodLiteral<"user">;
|
|
765
849
|
content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -821,7 +905,11 @@ export declare const ConversationItemsAddBodySchema: z.ZodObject<{
|
|
|
821
905
|
}, z.core.$strip>;
|
|
822
906
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
823
907
|
type: z.ZodLiteral<"ephemeral">;
|
|
824
|
-
ttl: z.ZodOptional<z.
|
|
908
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
909
|
+
"5m": "5m";
|
|
910
|
+
"1h": "1h";
|
|
911
|
+
"24h": "24h";
|
|
912
|
+
}>>;
|
|
825
913
|
}, z.core.$strip>>;
|
|
826
914
|
}, z.core.$strip>]>>]>;
|
|
827
915
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -835,7 +923,11 @@ export declare const ConversationItemsAddBodySchema: z.ZodObject<{
|
|
|
835
923
|
extra_content: z.ZodOptional<z.ZodType<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown>>>;
|
|
836
924
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
837
925
|
type: z.ZodLiteral<"ephemeral">;
|
|
838
|
-
ttl: z.ZodOptional<z.
|
|
926
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
927
|
+
"5m": "5m";
|
|
928
|
+
"1h": "1h";
|
|
929
|
+
"24h": "24h";
|
|
930
|
+
}>>;
|
|
839
931
|
}, z.core.$strip>>;
|
|
840
932
|
role: z.ZodLiteral<"assistant">;
|
|
841
933
|
content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodObject<{
|
|
@@ -854,7 +946,11 @@ export declare const ConversationItemsAddBodySchema: z.ZodObject<{
|
|
|
854
946
|
extra_content: z.ZodOptional<z.ZodType<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown>>>;
|
|
855
947
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
856
948
|
type: z.ZodLiteral<"ephemeral">;
|
|
857
|
-
ttl: z.ZodOptional<z.
|
|
949
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
950
|
+
"5m": "5m";
|
|
951
|
+
"1h": "1h";
|
|
952
|
+
"24h": "24h";
|
|
953
|
+
}>>;
|
|
858
954
|
}, z.core.$strip>>;
|
|
859
955
|
role: z.ZodLiteral<"system">;
|
|
860
956
|
content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -916,7 +1012,11 @@ export declare const ConversationItemsAddBodySchema: z.ZodObject<{
|
|
|
916
1012
|
}, z.core.$strip>;
|
|
917
1013
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
918
1014
|
type: z.ZodLiteral<"ephemeral">;
|
|
919
|
-
ttl: z.ZodOptional<z.
|
|
1015
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
1016
|
+
"5m": "5m";
|
|
1017
|
+
"1h": "1h";
|
|
1018
|
+
"24h": "24h";
|
|
1019
|
+
}>>;
|
|
920
1020
|
}, z.core.$strip>>;
|
|
921
1021
|
}, z.core.$strip>]>>]>;
|
|
922
1022
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -930,7 +1030,11 @@ export declare const ConversationItemsAddBodySchema: z.ZodObject<{
|
|
|
930
1030
|
extra_content: z.ZodOptional<z.ZodType<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown>>>;
|
|
931
1031
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
932
1032
|
type: z.ZodLiteral<"ephemeral">;
|
|
933
|
-
ttl: z.ZodOptional<z.
|
|
1033
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
1034
|
+
"5m": "5m";
|
|
1035
|
+
"1h": "1h";
|
|
1036
|
+
"24h": "24h";
|
|
1037
|
+
}>>;
|
|
934
1038
|
}, z.core.$strip>>;
|
|
935
1039
|
role: z.ZodLiteral<"developer">;
|
|
936
1040
|
content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -992,7 +1096,11 @@ export declare const ConversationItemsAddBodySchema: z.ZodObject<{
|
|
|
992
1096
|
}, z.core.$strip>;
|
|
993
1097
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
994
1098
|
type: z.ZodLiteral<"ephemeral">;
|
|
995
|
-
ttl: z.ZodOptional<z.
|
|
1099
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
1100
|
+
"5m": "5m";
|
|
1101
|
+
"1h": "1h";
|
|
1102
|
+
"24h": "24h";
|
|
1103
|
+
}>>;
|
|
996
1104
|
}, z.core.$strip>>;
|
|
997
1105
|
}, z.core.$strip>]>>]>;
|
|
998
1106
|
}, z.core.$strip>], "role">, z.ZodObject<{
|
|
@@ -1009,7 +1117,11 @@ export declare const ConversationItemsAddBodySchema: z.ZodObject<{
|
|
|
1009
1117
|
extra_content: z.ZodOptional<z.ZodType<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown>>>;
|
|
1010
1118
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
1011
1119
|
type: z.ZodLiteral<"ephemeral">;
|
|
1012
|
-
ttl: z.ZodOptional<z.
|
|
1120
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
1121
|
+
"5m": "5m";
|
|
1122
|
+
"1h": "1h";
|
|
1123
|
+
"24h": "24h";
|
|
1124
|
+
}>>;
|
|
1013
1125
|
}, z.core.$strip>>;
|
|
1014
1126
|
}, z.core.$strip>, z.ZodObject<{
|
|
1015
1127
|
type: z.ZodLiteral<"function_call_output">;
|
|
@@ -1074,7 +1186,11 @@ export declare const ConversationItemsAddBodySchema: z.ZodObject<{
|
|
|
1074
1186
|
}, z.core.$strip>;
|
|
1075
1187
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
1076
1188
|
type: z.ZodLiteral<"ephemeral">;
|
|
1077
|
-
ttl: z.ZodOptional<z.
|
|
1189
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
1190
|
+
"5m": "5m";
|
|
1191
|
+
"1h": "1h";
|
|
1192
|
+
"24h": "24h";
|
|
1193
|
+
}>>;
|
|
1078
1194
|
}, z.core.$strip>>;
|
|
1079
1195
|
}, z.core.$strip>]>>]>;
|
|
1080
1196
|
status: z.ZodOptional<z.ZodEnum<{
|
|
@@ -1085,7 +1201,11 @@ export declare const ConversationItemsAddBodySchema: z.ZodObject<{
|
|
|
1085
1201
|
extra_content: z.ZodOptional<z.ZodType<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown>>>;
|
|
1086
1202
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
1087
1203
|
type: z.ZodLiteral<"ephemeral">;
|
|
1088
|
-
ttl: z.ZodOptional<z.
|
|
1204
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
1205
|
+
"5m": "5m";
|
|
1206
|
+
"1h": "1h";
|
|
1207
|
+
"24h": "24h";
|
|
1208
|
+
}>>;
|
|
1089
1209
|
}, z.core.$strip>>;
|
|
1090
1210
|
}, z.core.$strip>, z.ZodObject<{
|
|
1091
1211
|
type: z.ZodLiteral<"reasoning">;
|
|
@@ -1125,7 +1245,11 @@ export declare const ConversationItemListSchema: z.ZodObject<{
|
|
|
1125
1245
|
extra_content: z.ZodOptional<z.ZodType<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown>>>;
|
|
1126
1246
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
1127
1247
|
type: z.ZodLiteral<"ephemeral">;
|
|
1128
|
-
ttl: z.ZodOptional<z.
|
|
1248
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
1249
|
+
"5m": "5m";
|
|
1250
|
+
"1h": "1h";
|
|
1251
|
+
"24h": "24h";
|
|
1252
|
+
}>>;
|
|
1129
1253
|
}, z.core.$strip>>;
|
|
1130
1254
|
role: z.ZodLiteral<"user">;
|
|
1131
1255
|
content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -1187,7 +1311,11 @@ export declare const ConversationItemListSchema: z.ZodObject<{
|
|
|
1187
1311
|
}, z.core.$strip>;
|
|
1188
1312
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
1189
1313
|
type: z.ZodLiteral<"ephemeral">;
|
|
1190
|
-
ttl: z.ZodOptional<z.
|
|
1314
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
1315
|
+
"5m": "5m";
|
|
1316
|
+
"1h": "1h";
|
|
1317
|
+
"24h": "24h";
|
|
1318
|
+
}>>;
|
|
1191
1319
|
}, z.core.$strip>>;
|
|
1192
1320
|
}, z.core.$strip>]>>]>;
|
|
1193
1321
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -1201,7 +1329,11 @@ export declare const ConversationItemListSchema: z.ZodObject<{
|
|
|
1201
1329
|
extra_content: z.ZodOptional<z.ZodType<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown>>>;
|
|
1202
1330
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
1203
1331
|
type: z.ZodLiteral<"ephemeral">;
|
|
1204
|
-
ttl: z.ZodOptional<z.
|
|
1332
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
1333
|
+
"5m": "5m";
|
|
1334
|
+
"1h": "1h";
|
|
1335
|
+
"24h": "24h";
|
|
1336
|
+
}>>;
|
|
1205
1337
|
}, z.core.$strip>>;
|
|
1206
1338
|
role: z.ZodLiteral<"assistant">;
|
|
1207
1339
|
content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodObject<{
|
|
@@ -1220,7 +1352,11 @@ export declare const ConversationItemListSchema: z.ZodObject<{
|
|
|
1220
1352
|
extra_content: z.ZodOptional<z.ZodType<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown>>>;
|
|
1221
1353
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
1222
1354
|
type: z.ZodLiteral<"ephemeral">;
|
|
1223
|
-
ttl: z.ZodOptional<z.
|
|
1355
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
1356
|
+
"5m": "5m";
|
|
1357
|
+
"1h": "1h";
|
|
1358
|
+
"24h": "24h";
|
|
1359
|
+
}>>;
|
|
1224
1360
|
}, z.core.$strip>>;
|
|
1225
1361
|
role: z.ZodLiteral<"system">;
|
|
1226
1362
|
content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -1282,7 +1418,11 @@ export declare const ConversationItemListSchema: z.ZodObject<{
|
|
|
1282
1418
|
}, z.core.$strip>;
|
|
1283
1419
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
1284
1420
|
type: z.ZodLiteral<"ephemeral">;
|
|
1285
|
-
ttl: z.ZodOptional<z.
|
|
1421
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
1422
|
+
"5m": "5m";
|
|
1423
|
+
"1h": "1h";
|
|
1424
|
+
"24h": "24h";
|
|
1425
|
+
}>>;
|
|
1286
1426
|
}, z.core.$strip>>;
|
|
1287
1427
|
}, z.core.$strip>]>>]>;
|
|
1288
1428
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -1296,7 +1436,11 @@ export declare const ConversationItemListSchema: z.ZodObject<{
|
|
|
1296
1436
|
extra_content: z.ZodOptional<z.ZodType<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown>>>;
|
|
1297
1437
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
1298
1438
|
type: z.ZodLiteral<"ephemeral">;
|
|
1299
|
-
ttl: z.ZodOptional<z.
|
|
1439
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
1440
|
+
"5m": "5m";
|
|
1441
|
+
"1h": "1h";
|
|
1442
|
+
"24h": "24h";
|
|
1443
|
+
}>>;
|
|
1300
1444
|
}, z.core.$strip>>;
|
|
1301
1445
|
role: z.ZodLiteral<"developer">;
|
|
1302
1446
|
content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -1358,7 +1502,11 @@ export declare const ConversationItemListSchema: z.ZodObject<{
|
|
|
1358
1502
|
}, z.core.$strip>;
|
|
1359
1503
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
1360
1504
|
type: z.ZodLiteral<"ephemeral">;
|
|
1361
|
-
ttl: z.ZodOptional<z.
|
|
1505
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
1506
|
+
"5m": "5m";
|
|
1507
|
+
"1h": "1h";
|
|
1508
|
+
"24h": "24h";
|
|
1509
|
+
}>>;
|
|
1362
1510
|
}, z.core.$strip>>;
|
|
1363
1511
|
}, z.core.$strip>]>>]>;
|
|
1364
1512
|
}, z.core.$strip>], "role">, z.ZodObject<{
|
|
@@ -1375,7 +1523,11 @@ export declare const ConversationItemListSchema: z.ZodObject<{
|
|
|
1375
1523
|
extra_content: z.ZodOptional<z.ZodType<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown>>>;
|
|
1376
1524
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
1377
1525
|
type: z.ZodLiteral<"ephemeral">;
|
|
1378
|
-
ttl: z.ZodOptional<z.
|
|
1526
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
1527
|
+
"5m": "5m";
|
|
1528
|
+
"1h": "1h";
|
|
1529
|
+
"24h": "24h";
|
|
1530
|
+
}>>;
|
|
1379
1531
|
}, z.core.$strip>>;
|
|
1380
1532
|
}, z.core.$strip>, z.ZodObject<{
|
|
1381
1533
|
type: z.ZodLiteral<"function_call_output">;
|
|
@@ -1440,7 +1592,11 @@ export declare const ConversationItemListSchema: z.ZodObject<{
|
|
|
1440
1592
|
}, z.core.$strip>;
|
|
1441
1593
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
1442
1594
|
type: z.ZodLiteral<"ephemeral">;
|
|
1443
|
-
ttl: z.ZodOptional<z.
|
|
1595
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
1596
|
+
"5m": "5m";
|
|
1597
|
+
"1h": "1h";
|
|
1598
|
+
"24h": "24h";
|
|
1599
|
+
}>>;
|
|
1444
1600
|
}, z.core.$strip>>;
|
|
1445
1601
|
}, z.core.$strip>]>>]>;
|
|
1446
1602
|
status: z.ZodOptional<z.ZodEnum<{
|
|
@@ -1451,7 +1607,11 @@ export declare const ConversationItemListSchema: z.ZodObject<{
|
|
|
1451
1607
|
extra_content: z.ZodOptional<z.ZodType<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<import("@ai-sdk/provider").SharedV3ProviderMetadata, unknown>>>;
|
|
1452
1608
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
1453
1609
|
type: z.ZodLiteral<"ephemeral">;
|
|
1454
|
-
ttl: z.ZodOptional<z.
|
|
1610
|
+
ttl: z.ZodOptional<z.ZodEnum<{
|
|
1611
|
+
"5m": "5m";
|
|
1612
|
+
"1h": "1h";
|
|
1613
|
+
"24h": "24h";
|
|
1614
|
+
}>>;
|
|
1455
1615
|
}, z.core.$strip>>;
|
|
1456
1616
|
}, z.core.$strip>, z.ZodObject<{
|
|
1457
1617
|
type: z.ZodLiteral<"reasoning">;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { GenerateTextResult, StreamTextResult, FinishReason, ToolSet, ModelMessage, LanguageModelUsage, TextStreamPart } from "ai";
|
|
2
|
+
import { Output } from "ai";
|
|
3
|
+
import { type TextCallOptions } from "../shared/converters";
|
|
4
|
+
import type { ReasoningConfig, CacheControl } from "../shared/schema";
|
|
5
|
+
import type { MessagesInputs, MessagesMessage, MessagesTool, MessagesToolChoice, MessagesThinkingConfig, MessagesOutputConfig, Messages, MessagesStopReason, MessagesUsage, MessagesStream, MessagesStreamEvent } from "./schema";
|
|
6
|
+
export declare function convertToTextCallOptions(inputs: MessagesInputs): TextCallOptions;
|
|
7
|
+
export declare function convertThinkingToReasoning(thinking?: MessagesThinkingConfig, outputConfig?: MessagesOutputConfig): {
|
|
8
|
+
reasoning: ReasoningConfig;
|
|
9
|
+
reasoning_effort?: ReasoningConfig["effort"];
|
|
10
|
+
} | undefined;
|
|
11
|
+
export declare function convertToModelMessages(messages: MessagesMessage[], system?: string | Array<{
|
|
12
|
+
type: "text";
|
|
13
|
+
text: string;
|
|
14
|
+
cache_control?: CacheControl;
|
|
15
|
+
}>): ModelMessage[];
|
|
16
|
+
export declare function convertToToolSet(tools: MessagesTool[] | undefined): ToolSet | undefined;
|
|
17
|
+
export declare function convertToToolChoiceOptions(toolChoice: MessagesToolChoice | undefined): TextCallOptions["toolChoice"] | undefined;
|
|
18
|
+
export declare function toMessages(result: GenerateTextResult<ToolSet, Output.Output>, modelId: string): Messages;
|
|
19
|
+
export declare function mapStopReason(reason: FinishReason): MessagesStopReason;
|
|
20
|
+
export declare function mapUsage(usage?: LanguageModelUsage): MessagesUsage;
|
|
21
|
+
export declare function toMessagesStream(result: StreamTextResult<ToolSet, Output.Output>, modelId: string): MessagesStream;
|
|
22
|
+
export declare class MessagesTransformStream extends TransformStream<TextStreamPart<ToolSet>, MessagesStreamEvent> {
|
|
23
|
+
constructor(modelId: string);
|
|
24
|
+
}
|