@hebo-ai/gateway 0.1.2 → 0.2.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 +172 -67
- package/dist/config.js +2 -12
- package/dist/endpoints/chat-completions/converters.d.ts +28 -24
- package/dist/endpoints/chat-completions/converters.js +99 -73
- package/dist/endpoints/chat-completions/handler.js +36 -30
- package/dist/endpoints/chat-completions/schema.d.ts +394 -272
- package/dist/endpoints/chat-completions/schema.js +124 -57
- package/dist/endpoints/embeddings/converters.d.ts +4 -4
- package/dist/endpoints/embeddings/converters.js +8 -9
- package/dist/endpoints/embeddings/handler.js +32 -26
- package/dist/endpoints/embeddings/schema.d.ts +28 -38
- package/dist/endpoints/embeddings/schema.js +10 -10
- package/dist/endpoints/models/converters.d.ts +2 -2
- package/dist/endpoints/models/converters.js +9 -12
- package/dist/endpoints/models/handler.js +8 -9
- package/dist/endpoints/models/schema.d.ts +37 -31
- package/dist/endpoints/models/schema.js +23 -12
- package/dist/gateway.d.ts +8 -9
- package/dist/gateway.js +7 -10
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/lifecycle.d.ts +2 -0
- package/dist/{utils/hooks.js → lifecycle.js} +16 -8
- package/dist/middleware/common.d.ts +4 -0
- package/dist/middleware/common.js +44 -0
- package/dist/middleware/matcher.d.ts +18 -0
- package/dist/middleware/matcher.js +83 -0
- package/dist/models/amazon/index.d.ts +2 -0
- package/dist/models/amazon/index.js +2 -0
- package/dist/models/amazon/middleware.d.ts +2 -0
- package/dist/models/amazon/middleware.js +20 -0
- package/dist/models/amazon/presets.d.ts +2390 -0
- package/dist/models/amazon/presets.js +80 -0
- package/dist/models/anthropic/index.d.ts +2 -0
- package/dist/models/anthropic/index.js +2 -0
- package/dist/models/anthropic/middleware.d.ts +5 -0
- package/dist/models/anthropic/middleware.js +67 -0
- package/dist/models/anthropic/presets.d.ts +4106 -0
- package/dist/models/anthropic/presets.js +113 -0
- package/dist/models/catalog.d.ts +3 -1
- package/dist/models/catalog.js +3 -2
- package/dist/models/cohere/index.d.ts +2 -0
- package/dist/models/cohere/index.js +2 -0
- package/dist/models/cohere/middleware.d.ts +2 -0
- package/dist/models/cohere/middleware.js +18 -0
- package/dist/models/cohere/presets.d.ts +2918 -0
- package/dist/models/cohere/presets.js +129 -0
- package/dist/models/google/index.d.ts +2 -0
- package/dist/models/google/index.js +2 -0
- package/dist/models/google/middleware.d.ts +2 -0
- package/dist/models/google/middleware.js +20 -0
- package/dist/models/{presets/gemini.d.ts → google/presets.d.ts} +400 -174
- package/dist/models/{presets/gemini.js → google/presets.js} +20 -5
- package/dist/models/meta/index.d.ts +1 -0
- package/dist/models/meta/index.js +1 -0
- package/dist/models/meta/presets.d.ts +3254 -0
- package/dist/models/{presets/llama.js → meta/presets.js} +44 -7
- package/dist/models/openai/index.d.ts +2 -0
- package/dist/models/openai/index.js +2 -0
- package/dist/models/openai/middleware.d.ts +2 -0
- package/dist/models/openai/middleware.js +20 -0
- package/dist/models/openai/presets.d.ts +6252 -0
- package/dist/models/openai/presets.js +206 -0
- package/dist/models/types.d.ts +3 -3
- package/dist/models/types.js +27 -0
- package/dist/models/voyage/index.d.ts +2 -0
- package/dist/models/voyage/index.js +2 -0
- package/dist/models/voyage/middleware.d.ts +2 -0
- package/dist/models/voyage/middleware.js +18 -0
- package/dist/models/{presets/voyage.d.ts → voyage/presets.d.ts} +322 -323
- package/dist/providers/anthropic/canonical.d.ts +3 -0
- package/dist/providers/anthropic/canonical.js +9 -0
- package/dist/providers/anthropic/index.d.ts +1 -0
- package/dist/providers/anthropic/index.js +1 -0
- package/dist/providers/bedrock/canonical.d.ts +15 -0
- package/dist/providers/{canonical/bedrock.js → bedrock/canonical.js} +13 -15
- package/dist/providers/bedrock/index.d.ts +1 -0
- package/dist/providers/bedrock/index.js +1 -0
- package/dist/providers/cohere/canonical.d.ts +3 -0
- package/dist/providers/{canonical/cohere.js → cohere/canonical.js} +6 -6
- package/dist/providers/cohere/index.d.ts +1 -0
- package/dist/providers/cohere/index.js +1 -0
- package/dist/providers/groq/canonical.d.ts +3 -0
- package/dist/providers/groq/canonical.js +12 -0
- package/dist/providers/groq/index.d.ts +1 -0
- package/dist/providers/groq/index.js +1 -0
- package/dist/providers/openai/canonical.d.ts +3 -0
- package/dist/providers/openai/canonical.js +8 -0
- package/dist/providers/openai/index.d.ts +1 -0
- package/dist/providers/openai/index.js +1 -0
- package/dist/providers/registry.d.ts +16 -26
- package/dist/providers/registry.js +19 -26
- package/dist/providers/types.d.ts +1 -1
- package/dist/providers/types.js +1 -0
- package/dist/providers/vertex/canonical.d.ts +3 -0
- package/dist/providers/vertex/canonical.js +8 -0
- package/dist/providers/vertex/index.d.ts +1 -0
- package/dist/providers/vertex/index.js +1 -0
- package/dist/providers/voyage/canonical.d.ts +3 -0
- package/dist/providers/voyage/canonical.js +7 -0
- package/dist/providers/voyage/index.d.ts +1 -0
- package/dist/providers/voyage/index.js +1 -0
- package/dist/types.d.ts +60 -30
- package/dist/utils/errors.js +2 -0
- package/dist/utils/preset.d.ts +1 -7
- package/dist/utils/preset.js +1 -1
- package/dist/utils/response.d.ts +1 -0
- package/dist/utils/response.js +10 -0
- package/package.json +79 -70
- package/src/config.ts +2 -18
- package/src/endpoints/chat-completions/converters.test.ts +39 -0
- package/src/endpoints/chat-completions/converters.ts +191 -112
- package/src/endpoints/chat-completions/handler.test.ts +47 -18
- package/src/endpoints/chat-completions/handler.ts +40 -34
- package/src/endpoints/chat-completions/schema.ts +161 -88
- package/src/endpoints/embeddings/converters.ts +15 -11
- package/src/endpoints/embeddings/handler.test.ts +27 -30
- package/src/endpoints/embeddings/handler.ts +34 -28
- package/src/endpoints/embeddings/schema.ts +10 -10
- package/src/endpoints/models/converters.ts +22 -14
- package/src/endpoints/models/handler.test.ts +26 -29
- package/src/endpoints/models/handler.ts +10 -12
- package/src/endpoints/models/schema.ts +26 -20
- package/src/gateway.ts +10 -24
- package/src/index.ts +3 -0
- package/src/{utils/hooks.ts → lifecycle.ts} +21 -11
- package/src/middleware/common.ts +68 -0
- package/src/middleware/matcher.ts +117 -0
- package/src/models/amazon/index.ts +2 -0
- package/src/models/amazon/middleware.ts +25 -0
- package/src/models/amazon/presets.ts +104 -0
- package/src/models/anthropic/index.ts +2 -0
- package/src/models/anthropic/middleware.test.ts +184 -0
- package/src/models/anthropic/middleware.ts +75 -0
- package/src/models/anthropic/presets.ts +161 -0
- package/src/models/catalog.ts +10 -2
- package/src/models/cohere/index.ts +2 -0
- package/src/models/cohere/middleware.ts +23 -0
- package/src/models/cohere/presets.ts +181 -0
- package/src/models/google/index.ts +2 -0
- package/src/models/google/middleware.ts +25 -0
- package/src/models/{presets/gemini.ts → google/presets.ts} +25 -5
- package/src/models/meta/index.ts +1 -0
- package/src/models/{presets/llama.ts → meta/presets.ts} +68 -7
- package/src/models/openai/index.ts +2 -0
- package/src/models/openai/middleware.ts +25 -0
- package/src/models/openai/presets.ts +269 -0
- package/src/models/types.ts +29 -2
- package/src/models/voyage/index.ts +2 -0
- package/src/models/voyage/middleware.ts +23 -0
- package/src/providers/anthropic/canonical.ts +17 -0
- package/src/providers/anthropic/index.ts +1 -0
- package/src/providers/{canonical/bedrock.ts → bedrock/canonical.ts} +22 -32
- package/src/providers/bedrock/index.ts +1 -0
- package/src/providers/cohere/canonical.ts +26 -0
- package/src/providers/cohere/index.ts +1 -0
- package/src/providers/groq/canonical.ts +21 -0
- package/src/providers/groq/index.ts +1 -0
- package/src/providers/openai/canonical.ts +16 -0
- package/src/providers/openai/index.ts +1 -0
- package/src/providers/registry.test.ts +12 -10
- package/src/providers/registry.ts +43 -43
- package/src/providers/types.ts +1 -0
- package/src/providers/vertex/canonical.ts +17 -0
- package/src/providers/vertex/index.ts +1 -0
- package/src/providers/voyage/canonical.ts +16 -0
- package/src/providers/voyage/index.ts +1 -0
- package/src/types.ts +64 -28
- package/src/utils/errors.ts +2 -0
- package/src/utils/preset.ts +2 -6
- package/src/utils/response.ts +15 -0
- package/dist/models/presets/claude.d.ts +0 -1165
- package/dist/models/presets/claude.js +0 -40
- package/dist/models/presets/cohere.d.ts +0 -383
- package/dist/models/presets/cohere.js +0 -26
- package/dist/models/presets/gpt-oss.d.ts +0 -779
- package/dist/models/presets/gpt-oss.js +0 -40
- package/dist/models/presets/llama.d.ts +0 -1400
- package/dist/providers/canonical/anthropic.d.ts +0 -25
- package/dist/providers/canonical/anthropic.js +0 -14
- package/dist/providers/canonical/bedrock.d.ts +0 -26
- package/dist/providers/canonical/cohere.d.ts +0 -17
- package/dist/providers/canonical/groq.d.ts +0 -17
- package/dist/providers/canonical/groq.js +0 -10
- package/dist/providers/canonical/openai.d.ts +0 -17
- package/dist/providers/canonical/openai.js +0 -8
- package/dist/providers/canonical/vertex.d.ts +0 -17
- package/dist/providers/canonical/vertex.js +0 -10
- package/dist/providers/canonical/voyage.d.ts +0 -17
- package/dist/providers/canonical/voyage.js +0 -8
- package/dist/utils/hooks.d.ts +0 -2
- package/src/models/presets/claude.ts +0 -59
- package/src/models/presets/cohere.ts +0 -37
- package/src/models/presets/gpt-oss.ts +0 -55
- package/src/providers/canonical/anthropic.ts +0 -32
- package/src/providers/canonical/cohere.ts +0 -36
- package/src/providers/canonical/groq.ts +0 -25
- package/src/providers/canonical/openai.ts +0 -16
- package/src/providers/canonical/vertex.ts +0 -18
- package/src/providers/canonical/voyage.ts +0 -16
- package/dist/models/{presets/voyage.js → voyage/presets.js} +10 -10
- package/src/models/{presets/voyage.ts → voyage/presets.ts} +10 -10
|
@@ -1,334 +1,456 @@
|
|
|
1
|
-
import * as z from "zod
|
|
2
|
-
export declare const
|
|
3
|
-
type: z.
|
|
4
|
-
text: z.
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
export declare const ChatCompletionsContentPartTextSchema: z.ZodObject<{
|
|
3
|
+
type: z.ZodLiteral<"text">;
|
|
4
|
+
text: z.ZodString;
|
|
5
5
|
}, z.core.$strip>;
|
|
6
|
-
export declare const
|
|
7
|
-
type: z.
|
|
8
|
-
image_url: z.
|
|
9
|
-
url: z.
|
|
10
|
-
detail: z.
|
|
6
|
+
export declare const ChatCompletionsContentPartImageSchema: z.ZodObject<{
|
|
7
|
+
type: z.ZodLiteral<"image_url">;
|
|
8
|
+
image_url: z.ZodObject<{
|
|
9
|
+
url: z.ZodString;
|
|
10
|
+
detail: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"low">, z.ZodLiteral<"high">, z.ZodLiteral<"auto">]>>;
|
|
11
11
|
}, z.core.$strip>;
|
|
12
12
|
}, z.core.$strip>;
|
|
13
|
-
export declare const
|
|
14
|
-
type: z.
|
|
15
|
-
file: z.
|
|
16
|
-
data: z.
|
|
17
|
-
media_type: z.
|
|
18
|
-
filename: z.
|
|
13
|
+
export declare const ChatCompletionsContentPartFileSchema: z.ZodObject<{
|
|
14
|
+
type: z.ZodLiteral<"file">;
|
|
15
|
+
file: z.ZodObject<{
|
|
16
|
+
data: z.ZodString;
|
|
17
|
+
media_type: z.ZodString;
|
|
18
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
19
19
|
}, z.core.$strip>;
|
|
20
20
|
}, z.core.$strip>;
|
|
21
|
-
export type
|
|
22
|
-
export declare const
|
|
23
|
-
type: z.
|
|
24
|
-
id: z.
|
|
25
|
-
function: z.
|
|
26
|
-
arguments: z.
|
|
27
|
-
name: z.
|
|
21
|
+
export type ChatCompletionsContentPart = z.infer<typeof ChatCompletionsContentPartTextSchema> | z.infer<typeof ChatCompletionsContentPartImageSchema> | z.infer<typeof ChatCompletionsContentPartFileSchema>;
|
|
22
|
+
export declare const ChatCompletionsToolCallSchema: z.ZodObject<{
|
|
23
|
+
type: z.ZodLiteral<"function">;
|
|
24
|
+
id: z.ZodString;
|
|
25
|
+
function: z.ZodObject<{
|
|
26
|
+
arguments: z.ZodString;
|
|
27
|
+
name: z.ZodString;
|
|
28
28
|
}, z.core.$strip>;
|
|
29
29
|
}, z.core.$strip>;
|
|
30
|
-
export type
|
|
31
|
-
export declare const
|
|
32
|
-
role: z.
|
|
33
|
-
content: z.
|
|
30
|
+
export type ChatCompletionsToolCall = z.infer<typeof ChatCompletionsToolCallSchema>;
|
|
31
|
+
export declare const ChatCompletionsSystemMessageSchema: z.ZodObject<{
|
|
32
|
+
role: z.ZodLiteral<"system">;
|
|
33
|
+
content: z.ZodString;
|
|
34
|
+
name: z.ZodOptional<z.ZodString>;
|
|
34
35
|
}, z.core.$strip>;
|
|
35
|
-
export type
|
|
36
|
-
export declare const
|
|
37
|
-
role: z.
|
|
38
|
-
content: z.
|
|
39
|
-
type: z.
|
|
40
|
-
text: z.
|
|
41
|
-
}, z.core.$strip>, z.
|
|
42
|
-
type: z.
|
|
43
|
-
image_url: z.
|
|
44
|
-
url: z.
|
|
45
|
-
detail: z.
|
|
36
|
+
export type ChatCompletionsSystemMessage = z.infer<typeof ChatCompletionsSystemMessageSchema>;
|
|
37
|
+
export declare const ChatCompletionsUserMessageSchema: z.ZodObject<{
|
|
38
|
+
role: z.ZodLiteral<"user">;
|
|
39
|
+
content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
40
|
+
type: z.ZodLiteral<"text">;
|
|
41
|
+
text: z.ZodString;
|
|
42
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
43
|
+
type: z.ZodLiteral<"image_url">;
|
|
44
|
+
image_url: z.ZodObject<{
|
|
45
|
+
url: z.ZodString;
|
|
46
|
+
detail: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"low">, z.ZodLiteral<"high">, z.ZodLiteral<"auto">]>>;
|
|
46
47
|
}, z.core.$strip>;
|
|
47
|
-
}, z.core.$strip>, z.
|
|
48
|
-
type: z.
|
|
49
|
-
file: z.
|
|
50
|
-
data: z.
|
|
51
|
-
media_type: z.
|
|
52
|
-
filename: z.
|
|
48
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
49
|
+
type: z.ZodLiteral<"file">;
|
|
50
|
+
file: z.ZodObject<{
|
|
51
|
+
data: z.ZodString;
|
|
52
|
+
media_type: z.ZodString;
|
|
53
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
53
54
|
}, z.core.$strip>;
|
|
54
55
|
}, z.core.$strip>]>>]>;
|
|
56
|
+
name: z.ZodOptional<z.ZodString>;
|
|
55
57
|
}, z.core.$strip>;
|
|
56
|
-
export type
|
|
57
|
-
export declare const
|
|
58
|
-
role: z.
|
|
59
|
-
content: z.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
58
|
+
export type ChatCompletionsUserMessage = z.infer<typeof ChatCompletionsUserMessageSchema>;
|
|
59
|
+
export declare const ChatCompletionsAssistantMessageSchema: z.ZodObject<{
|
|
60
|
+
role: z.ZodLiteral<"assistant">;
|
|
61
|
+
content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
62
|
+
name: z.ZodOptional<z.ZodString>;
|
|
63
|
+
tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
64
|
+
type: z.ZodLiteral<"function">;
|
|
65
|
+
id: z.ZodString;
|
|
66
|
+
function: z.ZodObject<{
|
|
67
|
+
arguments: z.ZodString;
|
|
68
|
+
name: z.ZodString;
|
|
66
69
|
}, z.core.$strip>;
|
|
67
70
|
}, z.core.$strip>>>;
|
|
68
|
-
|
|
69
|
-
reasoning_content: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
71
|
+
reasoning_content: z.ZodOptional<z.ZodString>;
|
|
70
72
|
}, z.core.$strip>;
|
|
71
|
-
export type
|
|
72
|
-
export declare const
|
|
73
|
-
role: z.
|
|
74
|
-
content: z.
|
|
75
|
-
tool_call_id: z.
|
|
73
|
+
export type ChatCompletionsAssistantMessage = z.infer<typeof ChatCompletionsAssistantMessageSchema>;
|
|
74
|
+
export declare const ChatCompletionsToolMessageSchema: z.ZodObject<{
|
|
75
|
+
role: z.ZodLiteral<"tool">;
|
|
76
|
+
content: z.ZodString;
|
|
77
|
+
tool_call_id: z.ZodString;
|
|
76
78
|
}, z.core.$strip>;
|
|
77
|
-
export type
|
|
78
|
-
export declare const
|
|
79
|
-
role: z.
|
|
80
|
-
content: z.
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
79
|
+
export type ChatCompletionsToolMessage = z.infer<typeof ChatCompletionsToolMessageSchema>;
|
|
80
|
+
export declare const ChatCompletionsMessageSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
81
|
+
role: z.ZodLiteral<"system">;
|
|
82
|
+
content: z.ZodString;
|
|
83
|
+
name: z.ZodOptional<z.ZodString>;
|
|
84
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
85
|
+
role: z.ZodLiteral<"user">;
|
|
86
|
+
content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
87
|
+
type: z.ZodLiteral<"text">;
|
|
88
|
+
text: z.ZodString;
|
|
89
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
90
|
+
type: z.ZodLiteral<"image_url">;
|
|
91
|
+
image_url: z.ZodObject<{
|
|
92
|
+
url: z.ZodString;
|
|
93
|
+
detail: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"low">, z.ZodLiteral<"high">, z.ZodLiteral<"auto">]>>;
|
|
91
94
|
}, z.core.$strip>;
|
|
92
|
-
}, z.core.$strip>, z.
|
|
93
|
-
type: z.
|
|
94
|
-
file: z.
|
|
95
|
-
data: z.
|
|
96
|
-
media_type: z.
|
|
97
|
-
filename: z.
|
|
95
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
96
|
+
type: z.ZodLiteral<"file">;
|
|
97
|
+
file: z.ZodObject<{
|
|
98
|
+
data: z.ZodString;
|
|
99
|
+
media_type: z.ZodString;
|
|
100
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
98
101
|
}, z.core.$strip>;
|
|
99
102
|
}, z.core.$strip>]>>]>;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
103
|
+
name: z.ZodOptional<z.ZodString>;
|
|
104
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
105
|
+
role: z.ZodLiteral<"assistant">;
|
|
106
|
+
content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
107
|
+
name: z.ZodOptional<z.ZodString>;
|
|
108
|
+
tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
109
|
+
type: z.ZodLiteral<"function">;
|
|
110
|
+
id: z.ZodString;
|
|
111
|
+
function: z.ZodObject<{
|
|
112
|
+
arguments: z.ZodString;
|
|
113
|
+
name: z.ZodString;
|
|
109
114
|
}, z.core.$strip>;
|
|
110
115
|
}, z.core.$strip>>>;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
tool_call_id: z.ZodMiniString<string>;
|
|
116
|
+
reasoning_content: z.ZodOptional<z.ZodString>;
|
|
117
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
118
|
+
role: z.ZodLiteral<"tool">;
|
|
119
|
+
content: z.ZodString;
|
|
120
|
+
tool_call_id: z.ZodString;
|
|
117
121
|
}, z.core.$strip>]>;
|
|
118
|
-
export type
|
|
119
|
-
export declare const
|
|
120
|
-
type: z.
|
|
121
|
-
function: z.
|
|
122
|
-
name: z.
|
|
123
|
-
description: z.
|
|
124
|
-
parameters: z.
|
|
122
|
+
export type ChatCompletionsMessage = z.infer<typeof ChatCompletionsMessageSchema>;
|
|
123
|
+
export declare const ChatCompletionsToolSchema: z.ZodObject<{
|
|
124
|
+
type: z.ZodLiteral<"function">;
|
|
125
|
+
function: z.ZodObject<{
|
|
126
|
+
name: z.ZodString;
|
|
127
|
+
description: z.ZodOptional<z.ZodString>;
|
|
128
|
+
parameters: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
125
129
|
}, z.core.$strip>;
|
|
126
130
|
}, z.core.$strip>;
|
|
127
|
-
export type
|
|
128
|
-
export declare const
|
|
129
|
-
type: z.
|
|
130
|
-
function: z.
|
|
131
|
-
name: z.
|
|
131
|
+
export type ChatCompletionsTool = z.infer<typeof ChatCompletionsToolSchema>;
|
|
132
|
+
export declare const ChatCompletionsToolChoiceSchema: z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"auto">, z.ZodLiteral<"required">, z.ZodObject<{
|
|
133
|
+
type: z.ZodLiteral<"function">;
|
|
134
|
+
function: z.ZodObject<{
|
|
135
|
+
name: z.ZodString;
|
|
132
136
|
}, z.core.$strip>;
|
|
133
137
|
}, z.core.$strip>]>;
|
|
134
|
-
export type
|
|
135
|
-
export declare const
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
138
|
+
export type ChatCompletionsToolChoice = z.infer<typeof ChatCompletionsToolChoiceSchema>;
|
|
139
|
+
export declare const ChatCompletionsReasoningEffortSchema: z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"minimal">, z.ZodLiteral<"low">, z.ZodLiteral<"medium">, z.ZodLiteral<"high">, z.ZodLiteral<"xhigh">]>;
|
|
140
|
+
export type ChatCompletionsReasoningEffort = z.infer<typeof ChatCompletionsReasoningEffortSchema>;
|
|
141
|
+
export declare const ChatCompletionsReasoningConfigSchema: z.ZodObject<{
|
|
142
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
143
|
+
effort: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"minimal">, z.ZodLiteral<"low">, z.ZodLiteral<"medium">, z.ZodLiteral<"high">, z.ZodLiteral<"xhigh">]>>;
|
|
144
|
+
max_tokens: z.ZodOptional<z.ZodNumber>;
|
|
145
|
+
exclude: z.ZodOptional<z.ZodBoolean>;
|
|
146
|
+
}, z.core.$strip>;
|
|
147
|
+
export type ChatCompletionsReasoningConfig = z.infer<typeof ChatCompletionsReasoningConfigSchema>;
|
|
148
|
+
declare const ChatCompletionsInputsSchema: z.ZodObject<{
|
|
149
|
+
messages: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
150
|
+
role: z.ZodLiteral<"system">;
|
|
151
|
+
content: z.ZodString;
|
|
152
|
+
name: z.ZodOptional<z.ZodString>;
|
|
153
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
154
|
+
role: z.ZodLiteral<"user">;
|
|
155
|
+
content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
156
|
+
type: z.ZodLiteral<"text">;
|
|
157
|
+
text: z.ZodString;
|
|
158
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
159
|
+
type: z.ZodLiteral<"image_url">;
|
|
160
|
+
image_url: z.ZodObject<{
|
|
161
|
+
url: z.ZodString;
|
|
162
|
+
detail: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"low">, z.ZodLiteral<"high">, z.ZodLiteral<"auto">]>>;
|
|
149
163
|
}, z.core.$strip>;
|
|
150
|
-
}, z.core.$strip>, z.
|
|
151
|
-
type: z.
|
|
152
|
-
file: z.
|
|
153
|
-
data: z.
|
|
154
|
-
media_type: z.
|
|
155
|
-
filename: z.
|
|
164
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
165
|
+
type: z.ZodLiteral<"file">;
|
|
166
|
+
file: z.ZodObject<{
|
|
167
|
+
data: z.ZodString;
|
|
168
|
+
media_type: z.ZodString;
|
|
169
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
156
170
|
}, z.core.$strip>;
|
|
157
171
|
}, z.core.$strip>]>>]>;
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
172
|
+
name: z.ZodOptional<z.ZodString>;
|
|
173
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
174
|
+
role: z.ZodLiteral<"assistant">;
|
|
175
|
+
content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
176
|
+
name: z.ZodOptional<z.ZodString>;
|
|
177
|
+
tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
178
|
+
type: z.ZodLiteral<"function">;
|
|
179
|
+
id: z.ZodString;
|
|
180
|
+
function: z.ZodObject<{
|
|
181
|
+
arguments: z.ZodString;
|
|
182
|
+
name: z.ZodString;
|
|
167
183
|
}, z.core.$strip>;
|
|
168
184
|
}, z.core.$strip>>>;
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
tool_call_id: z.ZodMiniString<string>;
|
|
185
|
+
reasoning_content: z.ZodOptional<z.ZodString>;
|
|
186
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
187
|
+
role: z.ZodLiteral<"tool">;
|
|
188
|
+
content: z.ZodString;
|
|
189
|
+
tool_call_id: z.ZodString;
|
|
175
190
|
}, z.core.$strip>]>>;
|
|
176
|
-
tools: z.
|
|
177
|
-
type: z.
|
|
178
|
-
function: z.
|
|
179
|
-
name: z.
|
|
180
|
-
description: z.
|
|
181
|
-
parameters: z.
|
|
191
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
192
|
+
type: z.ZodLiteral<"function">;
|
|
193
|
+
function: z.ZodObject<{
|
|
194
|
+
name: z.ZodString;
|
|
195
|
+
description: z.ZodOptional<z.ZodString>;
|
|
196
|
+
parameters: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
182
197
|
}, z.core.$strip>;
|
|
183
198
|
}, z.core.$strip>>>;
|
|
184
|
-
tool_choice: z.
|
|
185
|
-
type: z.
|
|
186
|
-
function: z.
|
|
187
|
-
name: z.
|
|
199
|
+
tool_choice: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"auto">, z.ZodLiteral<"required">, z.ZodObject<{
|
|
200
|
+
type: z.ZodLiteral<"function">;
|
|
201
|
+
function: z.ZodObject<{
|
|
202
|
+
name: z.ZodString;
|
|
188
203
|
}, z.core.$strip>;
|
|
189
204
|
}, z.core.$strip>]>>;
|
|
190
|
-
temperature: z.
|
|
205
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
206
|
+
max_tokens: z.ZodOptional<z.ZodInt>;
|
|
207
|
+
max_completion_tokens: z.ZodOptional<z.ZodInt>;
|
|
208
|
+
frequency_penalty: z.ZodOptional<z.ZodNumber>;
|
|
209
|
+
presence_penalty: z.ZodOptional<z.ZodNumber>;
|
|
210
|
+
seed: z.ZodOptional<z.ZodInt>;
|
|
211
|
+
stop: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
212
|
+
top_p: z.ZodOptional<z.ZodNumber>;
|
|
213
|
+
reasoning_effort: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"minimal">, z.ZodLiteral<"low">, z.ZodLiteral<"medium">, z.ZodLiteral<"high">, z.ZodLiteral<"xhigh">]>>;
|
|
214
|
+
reasoning: z.ZodOptional<z.ZodObject<{
|
|
215
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
216
|
+
effort: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"minimal">, z.ZodLiteral<"low">, z.ZodLiteral<"medium">, z.ZodLiteral<"high">, z.ZodLiteral<"xhigh">]>>;
|
|
217
|
+
max_tokens: z.ZodOptional<z.ZodNumber>;
|
|
218
|
+
exclude: z.ZodOptional<z.ZodBoolean>;
|
|
219
|
+
}, z.core.$strip>>;
|
|
191
220
|
}, z.core.$strip>;
|
|
192
|
-
export type
|
|
193
|
-
export declare const
|
|
194
|
-
messages: z.
|
|
195
|
-
role: z.
|
|
196
|
-
content: z.
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
221
|
+
export type ChatCompletionsInputs = z.infer<typeof ChatCompletionsInputsSchema>;
|
|
222
|
+
export declare const ChatCompletionsBodySchema: z.ZodObject<{
|
|
223
|
+
messages: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
224
|
+
role: z.ZodLiteral<"system">;
|
|
225
|
+
content: z.ZodString;
|
|
226
|
+
name: z.ZodOptional<z.ZodString>;
|
|
227
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
228
|
+
role: z.ZodLiteral<"user">;
|
|
229
|
+
content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
230
|
+
type: z.ZodLiteral<"text">;
|
|
231
|
+
text: z.ZodString;
|
|
232
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
233
|
+
type: z.ZodLiteral<"image_url">;
|
|
234
|
+
image_url: z.ZodObject<{
|
|
235
|
+
url: z.ZodString;
|
|
236
|
+
detail: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"low">, z.ZodLiteral<"high">, z.ZodLiteral<"auto">]>>;
|
|
207
237
|
}, z.core.$strip>;
|
|
208
|
-
}, z.core.$strip>, z.
|
|
209
|
-
type: z.
|
|
210
|
-
file: z.
|
|
211
|
-
data: z.
|
|
212
|
-
media_type: z.
|
|
213
|
-
filename: z.
|
|
238
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
239
|
+
type: z.ZodLiteral<"file">;
|
|
240
|
+
file: z.ZodObject<{
|
|
241
|
+
data: z.ZodString;
|
|
242
|
+
media_type: z.ZodString;
|
|
243
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
214
244
|
}, z.core.$strip>;
|
|
215
245
|
}, z.core.$strip>]>>]>;
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
246
|
+
name: z.ZodOptional<z.ZodString>;
|
|
247
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
248
|
+
role: z.ZodLiteral<"assistant">;
|
|
249
|
+
content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
250
|
+
name: z.ZodOptional<z.ZodString>;
|
|
251
|
+
tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
252
|
+
type: z.ZodLiteral<"function">;
|
|
253
|
+
id: z.ZodString;
|
|
254
|
+
function: z.ZodObject<{
|
|
255
|
+
arguments: z.ZodString;
|
|
256
|
+
name: z.ZodString;
|
|
225
257
|
}, z.core.$strip>;
|
|
226
258
|
}, z.core.$strip>>>;
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
tool_call_id: z.ZodMiniString<string>;
|
|
259
|
+
reasoning_content: z.ZodOptional<z.ZodString>;
|
|
260
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
261
|
+
role: z.ZodLiteral<"tool">;
|
|
262
|
+
content: z.ZodString;
|
|
263
|
+
tool_call_id: z.ZodString;
|
|
233
264
|
}, z.core.$strip>]>>;
|
|
234
|
-
tools: z.
|
|
235
|
-
type: z.
|
|
236
|
-
function: z.
|
|
237
|
-
name: z.
|
|
238
|
-
description: z.
|
|
239
|
-
parameters: z.
|
|
265
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
266
|
+
type: z.ZodLiteral<"function">;
|
|
267
|
+
function: z.ZodObject<{
|
|
268
|
+
name: z.ZodString;
|
|
269
|
+
description: z.ZodOptional<z.ZodString>;
|
|
270
|
+
parameters: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
240
271
|
}, z.core.$strip>;
|
|
241
272
|
}, z.core.$strip>>>;
|
|
242
|
-
tool_choice: z.
|
|
243
|
-
type: z.
|
|
244
|
-
function: z.
|
|
245
|
-
name: z.
|
|
273
|
+
tool_choice: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"auto">, z.ZodLiteral<"required">, z.ZodObject<{
|
|
274
|
+
type: z.ZodLiteral<"function">;
|
|
275
|
+
function: z.ZodObject<{
|
|
276
|
+
name: z.ZodString;
|
|
246
277
|
}, z.core.$strip>;
|
|
247
278
|
}, z.core.$strip>]>>;
|
|
248
|
-
temperature: z.
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
279
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
280
|
+
max_tokens: z.ZodOptional<z.ZodInt>;
|
|
281
|
+
max_completion_tokens: z.ZodOptional<z.ZodInt>;
|
|
282
|
+
frequency_penalty: z.ZodOptional<z.ZodNumber>;
|
|
283
|
+
presence_penalty: z.ZodOptional<z.ZodNumber>;
|
|
284
|
+
seed: z.ZodOptional<z.ZodInt>;
|
|
285
|
+
stop: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
286
|
+
top_p: z.ZodOptional<z.ZodNumber>;
|
|
287
|
+
reasoning_effort: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"minimal">, z.ZodLiteral<"low">, z.ZodLiteral<"medium">, z.ZodLiteral<"high">, z.ZodLiteral<"xhigh">]>>;
|
|
288
|
+
reasoning: z.ZodOptional<z.ZodObject<{
|
|
289
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
290
|
+
effort: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"minimal">, z.ZodLiteral<"low">, z.ZodLiteral<"medium">, z.ZodLiteral<"high">, z.ZodLiteral<"xhigh">]>>;
|
|
291
|
+
max_tokens: z.ZodOptional<z.ZodNumber>;
|
|
292
|
+
exclude: z.ZodOptional<z.ZodBoolean>;
|
|
293
|
+
}, z.core.$strip>>;
|
|
294
|
+
model: z.ZodString;
|
|
295
|
+
stream: z.ZodOptional<z.ZodBoolean>;
|
|
296
|
+
}, z.core.$loose>;
|
|
297
|
+
export type ChatCompletionsBody = z.infer<typeof ChatCompletionsBodySchema>;
|
|
298
|
+
export declare const ChatCompletionsFinishReasonSchema: z.ZodUnion<readonly [z.ZodLiteral<"stop">, z.ZodLiteral<"length">, z.ZodLiteral<"content_filter">, z.ZodLiteral<"tool_calls">]>;
|
|
299
|
+
export type ChatCompletionsFinishReason = z.infer<typeof ChatCompletionsFinishReasonSchema>;
|
|
300
|
+
export declare const ChatCompletionsChoiceSchema: z.ZodObject<{
|
|
301
|
+
index: z.ZodInt;
|
|
302
|
+
message: z.ZodObject<{
|
|
303
|
+
role: z.ZodLiteral<"assistant">;
|
|
304
|
+
content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
305
|
+
name: z.ZodOptional<z.ZodString>;
|
|
306
|
+
tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
307
|
+
type: z.ZodLiteral<"function">;
|
|
308
|
+
id: z.ZodString;
|
|
309
|
+
function: z.ZodObject<{
|
|
310
|
+
arguments: z.ZodString;
|
|
311
|
+
name: z.ZodString;
|
|
266
312
|
}, z.core.$strip>;
|
|
267
313
|
}, z.core.$strip>>>;
|
|
268
|
-
|
|
269
|
-
reasoning_content: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
314
|
+
reasoning_content: z.ZodOptional<z.ZodString>;
|
|
270
315
|
}, z.core.$strip>;
|
|
271
|
-
finish_reason: z.
|
|
272
|
-
logprobs: z.
|
|
316
|
+
finish_reason: z.ZodUnion<readonly [z.ZodLiteral<"stop">, z.ZodLiteral<"length">, z.ZodLiteral<"content_filter">, z.ZodLiteral<"tool_calls">]>;
|
|
317
|
+
logprobs: z.ZodOptional<z.ZodAny>;
|
|
273
318
|
}, z.core.$strip>;
|
|
274
|
-
export type
|
|
275
|
-
export declare const
|
|
276
|
-
prompt_tokens: z.
|
|
277
|
-
completion_tokens: z.
|
|
278
|
-
total_tokens: z.
|
|
279
|
-
completion_tokens_details: z.
|
|
280
|
-
reasoning_tokens: z.
|
|
319
|
+
export type ChatCompletionsChoice = z.infer<typeof ChatCompletionsChoiceSchema>;
|
|
320
|
+
export declare const ChatCompletionsUsageSchema: z.ZodObject<{
|
|
321
|
+
prompt_tokens: z.ZodOptional<z.ZodInt>;
|
|
322
|
+
completion_tokens: z.ZodOptional<z.ZodInt>;
|
|
323
|
+
total_tokens: z.ZodOptional<z.ZodInt>;
|
|
324
|
+
completion_tokens_details: z.ZodOptional<z.ZodObject<{
|
|
325
|
+
reasoning_tokens: z.ZodOptional<z.ZodInt>;
|
|
281
326
|
}, z.core.$strip>>;
|
|
282
|
-
prompt_tokens_details: z.
|
|
283
|
-
cached_tokens: z.
|
|
327
|
+
prompt_tokens_details: z.ZodOptional<z.ZodObject<{
|
|
328
|
+
cached_tokens: z.ZodOptional<z.ZodInt>;
|
|
284
329
|
}, z.core.$strip>>;
|
|
285
330
|
}, z.core.$strip>;
|
|
286
|
-
export type
|
|
287
|
-
export declare const
|
|
288
|
-
id: z.
|
|
289
|
-
object: z.
|
|
290
|
-
created: z.
|
|
291
|
-
model: z.
|
|
292
|
-
choices: z.
|
|
293
|
-
index: z.
|
|
294
|
-
message: z.
|
|
295
|
-
role: z.
|
|
296
|
-
content: z.
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
331
|
+
export type ChatCompletionsUsage = z.infer<typeof ChatCompletionsUsageSchema>;
|
|
332
|
+
export declare const ChatCompletionsSchema: z.ZodObject<{
|
|
333
|
+
id: z.ZodString;
|
|
334
|
+
object: z.ZodLiteral<"chat.completion">;
|
|
335
|
+
created: z.ZodInt;
|
|
336
|
+
model: z.ZodString;
|
|
337
|
+
choices: z.ZodArray<z.ZodObject<{
|
|
338
|
+
index: z.ZodInt;
|
|
339
|
+
message: z.ZodObject<{
|
|
340
|
+
role: z.ZodLiteral<"assistant">;
|
|
341
|
+
content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
342
|
+
name: z.ZodOptional<z.ZodString>;
|
|
343
|
+
tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
344
|
+
type: z.ZodLiteral<"function">;
|
|
345
|
+
id: z.ZodString;
|
|
346
|
+
function: z.ZodObject<{
|
|
347
|
+
arguments: z.ZodString;
|
|
348
|
+
name: z.ZodString;
|
|
303
349
|
}, z.core.$strip>;
|
|
304
350
|
}, z.core.$strip>>>;
|
|
305
|
-
|
|
306
|
-
|
|
351
|
+
reasoning_content: z.ZodOptional<z.ZodString>;
|
|
352
|
+
}, z.core.$strip>;
|
|
353
|
+
finish_reason: z.ZodUnion<readonly [z.ZodLiteral<"stop">, z.ZodLiteral<"length">, z.ZodLiteral<"content_filter">, z.ZodLiteral<"tool_calls">]>;
|
|
354
|
+
logprobs: z.ZodOptional<z.ZodAny>;
|
|
355
|
+
}, z.core.$strip>>;
|
|
356
|
+
usage: z.ZodNullable<z.ZodObject<{
|
|
357
|
+
prompt_tokens: z.ZodOptional<z.ZodInt>;
|
|
358
|
+
completion_tokens: z.ZodOptional<z.ZodInt>;
|
|
359
|
+
total_tokens: z.ZodOptional<z.ZodInt>;
|
|
360
|
+
completion_tokens_details: z.ZodOptional<z.ZodObject<{
|
|
361
|
+
reasoning_tokens: z.ZodOptional<z.ZodInt>;
|
|
362
|
+
}, z.core.$strip>>;
|
|
363
|
+
prompt_tokens_details: z.ZodOptional<z.ZodObject<{
|
|
364
|
+
cached_tokens: z.ZodOptional<z.ZodInt>;
|
|
365
|
+
}, z.core.$strip>>;
|
|
366
|
+
}, z.core.$strip>>;
|
|
367
|
+
provider_metadata: z.ZodOptional<z.ZodAny>;
|
|
368
|
+
}, z.core.$strip>;
|
|
369
|
+
export type ChatCompletions = z.infer<typeof ChatCompletionsSchema>;
|
|
370
|
+
export declare const ChatCompletionsToolCallDeltaSchema: z.ZodObject<{
|
|
371
|
+
type: z.ZodOptional<z.ZodLiteral<"function">>;
|
|
372
|
+
id: z.ZodOptional<z.ZodString>;
|
|
373
|
+
function: z.ZodOptional<z.ZodObject<{
|
|
374
|
+
arguments: z.ZodString;
|
|
375
|
+
name: z.ZodString;
|
|
376
|
+
}, z.core.$strip>>;
|
|
377
|
+
index: z.ZodInt;
|
|
378
|
+
}, z.core.$strip>;
|
|
379
|
+
export type ChatCompletionsToolCallDelta = z.infer<typeof ChatCompletionsToolCallDeltaSchema>;
|
|
380
|
+
export declare const ChatCompletionsAssistantMessageDeltaSchema: z.ZodObject<{
|
|
381
|
+
role: z.ZodOptional<z.ZodLiteral<"assistant">>;
|
|
382
|
+
content: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>>;
|
|
383
|
+
name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
384
|
+
reasoning_content: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
385
|
+
tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
386
|
+
type: z.ZodOptional<z.ZodLiteral<"function">>;
|
|
387
|
+
id: z.ZodOptional<z.ZodString>;
|
|
388
|
+
function: z.ZodOptional<z.ZodObject<{
|
|
389
|
+
arguments: z.ZodString;
|
|
390
|
+
name: z.ZodString;
|
|
391
|
+
}, z.core.$strip>>;
|
|
392
|
+
index: z.ZodInt;
|
|
393
|
+
}, z.core.$strip>>>;
|
|
394
|
+
}, z.core.$strip>;
|
|
395
|
+
export type ChatCompletionsAssistantMessageDelta = z.infer<typeof ChatCompletionsAssistantMessageDeltaSchema>;
|
|
396
|
+
export declare const ChatCompletionsChoiceDeltaSchema: z.ZodObject<{
|
|
397
|
+
index: z.ZodInt;
|
|
398
|
+
delta: z.ZodObject<{
|
|
399
|
+
role: z.ZodOptional<z.ZodLiteral<"assistant">>;
|
|
400
|
+
content: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>>;
|
|
401
|
+
name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
402
|
+
reasoning_content: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
403
|
+
tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
404
|
+
type: z.ZodOptional<z.ZodLiteral<"function">>;
|
|
405
|
+
id: z.ZodOptional<z.ZodString>;
|
|
406
|
+
function: z.ZodOptional<z.ZodObject<{
|
|
407
|
+
arguments: z.ZodString;
|
|
408
|
+
name: z.ZodString;
|
|
409
|
+
}, z.core.$strip>>;
|
|
410
|
+
index: z.ZodInt;
|
|
411
|
+
}, z.core.$strip>>>;
|
|
412
|
+
}, z.core.$strip>;
|
|
413
|
+
finish_reason: z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<"stop">, z.ZodLiteral<"length">, z.ZodLiteral<"content_filter">, z.ZodLiteral<"tool_calls">]>>;
|
|
414
|
+
logprobs: z.ZodOptional<z.ZodAny>;
|
|
415
|
+
}, z.core.$strip>;
|
|
416
|
+
export type ChatCompletionsChoiceDelta = z.infer<typeof ChatCompletionsChoiceDeltaSchema>;
|
|
417
|
+
export declare const ChatCompletionsChunkSchema: z.ZodObject<{
|
|
418
|
+
id: z.ZodString;
|
|
419
|
+
object: z.ZodLiteral<"chat.completion.chunk">;
|
|
420
|
+
created: z.ZodInt;
|
|
421
|
+
model: z.ZodString;
|
|
422
|
+
choices: z.ZodArray<z.ZodObject<{
|
|
423
|
+
index: z.ZodInt;
|
|
424
|
+
delta: z.ZodObject<{
|
|
425
|
+
role: z.ZodOptional<z.ZodLiteral<"assistant">>;
|
|
426
|
+
content: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>>;
|
|
427
|
+
name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
428
|
+
reasoning_content: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
429
|
+
tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
430
|
+
type: z.ZodOptional<z.ZodLiteral<"function">>;
|
|
431
|
+
id: z.ZodOptional<z.ZodString>;
|
|
432
|
+
function: z.ZodOptional<z.ZodObject<{
|
|
433
|
+
arguments: z.ZodString;
|
|
434
|
+
name: z.ZodString;
|
|
435
|
+
}, z.core.$strip>>;
|
|
436
|
+
index: z.ZodInt;
|
|
437
|
+
}, z.core.$strip>>>;
|
|
307
438
|
}, z.core.$strip>;
|
|
308
|
-
finish_reason: z.
|
|
309
|
-
logprobs: z.
|
|
439
|
+
finish_reason: z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<"stop">, z.ZodLiteral<"length">, z.ZodLiteral<"content_filter">, z.ZodLiteral<"tool_calls">]>>;
|
|
440
|
+
logprobs: z.ZodOptional<z.ZodAny>;
|
|
310
441
|
}, z.core.$strip>>;
|
|
311
|
-
usage: z.
|
|
312
|
-
prompt_tokens: z.
|
|
313
|
-
completion_tokens: z.
|
|
314
|
-
total_tokens: z.
|
|
315
|
-
completion_tokens_details: z.
|
|
316
|
-
reasoning_tokens: z.
|
|
442
|
+
usage: z.ZodNullable<z.ZodObject<{
|
|
443
|
+
prompt_tokens: z.ZodOptional<z.ZodInt>;
|
|
444
|
+
completion_tokens: z.ZodOptional<z.ZodInt>;
|
|
445
|
+
total_tokens: z.ZodOptional<z.ZodInt>;
|
|
446
|
+
completion_tokens_details: z.ZodOptional<z.ZodObject<{
|
|
447
|
+
reasoning_tokens: z.ZodOptional<z.ZodInt>;
|
|
317
448
|
}, z.core.$strip>>;
|
|
318
|
-
prompt_tokens_details: z.
|
|
319
|
-
cached_tokens: z.
|
|
449
|
+
prompt_tokens_details: z.ZodOptional<z.ZodObject<{
|
|
450
|
+
cached_tokens: z.ZodOptional<z.ZodInt>;
|
|
320
451
|
}, z.core.$strip>>;
|
|
321
452
|
}, z.core.$strip>>;
|
|
322
|
-
|
|
323
|
-
providerMetadata: z.ZodMiniOptional<z.ZodMiniAny>;
|
|
453
|
+
provider_metadata: z.ZodOptional<z.ZodAny>;
|
|
324
454
|
}, z.core.$strip>;
|
|
325
|
-
export type
|
|
326
|
-
export
|
|
327
|
-
id: string;
|
|
328
|
-
index: number;
|
|
329
|
-
type: "function";
|
|
330
|
-
function: {
|
|
331
|
-
name: string;
|
|
332
|
-
arguments: string;
|
|
333
|
-
};
|
|
334
|
-
};
|
|
455
|
+
export type ChatCompletionsChunk = z.infer<typeof ChatCompletionsChunkSchema>;
|
|
456
|
+
export {};
|