@spenceriam/impulse 0.15.0 → 0.15.3

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 (242) hide show
  1. package/bin/impulse +95 -0
  2. package/package.json +17 -51
  3. package/postinstall.mjs +115 -0
  4. package/README.md +0 -194
  5. package/dist/api/client.d.ts +0 -53
  6. package/dist/api/client.d.ts.map +0 -1
  7. package/dist/api/client.js +0 -271
  8. package/dist/api/client.js.map +0 -1
  9. package/dist/api/index.d.ts +0 -6
  10. package/dist/api/index.d.ts.map +0 -1
  11. package/dist/api/index.js +0 -7
  12. package/dist/api/index.js.map +0 -1
  13. package/dist/api/stream.d.ts +0 -98
  14. package/dist/api/stream.d.ts.map +0 -1
  15. package/dist/api/stream.js +0 -202
  16. package/dist/api/stream.js.map +0 -1
  17. package/dist/api/types.d.ts +0 -1353
  18. package/dist/api/types.d.ts.map +0 -1
  19. package/dist/api/types.js +0 -143
  20. package/dist/api/types.js.map +0 -1
  21. package/dist/bash.txt +0 -28
  22. package/dist/bus/bus.d.ts +0 -21
  23. package/dist/bus/bus.d.ts.map +0 -1
  24. package/dist/bus/bus.js +0 -22
  25. package/dist/bus/bus.js.map +0 -1
  26. package/dist/bus/events.d.ts +0 -100
  27. package/dist/bus/events.d.ts.map +0 -1
  28. package/dist/bus/events.js +0 -45
  29. package/dist/bus/events.js.map +0 -1
  30. package/dist/bus/index.d.ts +0 -3
  31. package/dist/bus/index.d.ts.map +0 -1
  32. package/dist/bus/index.js +0 -3
  33. package/dist/bus/index.js.map +0 -1
  34. package/dist/file-edit.txt +0 -21
  35. package/dist/file-read.txt +0 -18
  36. package/dist/file-write.txt +0 -16
  37. package/dist/glob.txt +0 -19
  38. package/dist/global.d.ts +0 -8
  39. package/dist/global.d.ts.map +0 -1
  40. package/dist/global.js +0 -14
  41. package/dist/global.js.map +0 -1
  42. package/dist/grep.txt +0 -20
  43. package/dist/highlights-eq9cgrbb.scm +0 -604
  44. package/dist/highlights-ghv9g403.scm +0 -205
  45. package/dist/highlights-hk7bwhj4.scm +0 -284
  46. package/dist/highlights-r812a2qc.scm +0 -150
  47. package/dist/highlights-x6tmsnaa.scm +0 -115
  48. package/dist/index.d.ts +0 -2
  49. package/dist/index.d.ts.map +0 -1
  50. package/dist/index.js +0 -62122
  51. package/dist/index.js.map +0 -1
  52. package/dist/index.jsx +0 -5
  53. package/dist/index.jsx.map +0 -1
  54. package/dist/injections-73j83es3.scm +0 -27
  55. package/dist/input/at-refs.d.ts +0 -42
  56. package/dist/input/at-refs.d.ts.map +0 -1
  57. package/dist/input/at-refs.js +0 -154
  58. package/dist/input/at-refs.js.map +0 -1
  59. package/dist/input/history.d.ts +0 -26
  60. package/dist/input/history.d.ts.map +0 -1
  61. package/dist/input/history.js +0 -109
  62. package/dist/input/history.js.map +0 -1
  63. package/dist/input/index.d.ts +0 -5
  64. package/dist/input/index.d.ts.map +0 -1
  65. package/dist/input/index.js +0 -5
  66. package/dist/input/index.js.map +0 -1
  67. package/dist/input/paste.d.ts +0 -19
  68. package/dist/input/paste.d.ts.map +0 -1
  69. package/dist/input/paste.js +0 -75
  70. package/dist/input/paste.js.map +0 -1
  71. package/dist/input/shortcuts.d.ts +0 -6
  72. package/dist/input/shortcuts.d.ts.map +0 -1
  73. package/dist/input/shortcuts.js +0 -84
  74. package/dist/input/shortcuts.js.map +0 -1
  75. package/dist/mcp/index.d.ts +0 -3
  76. package/dist/mcp/index.d.ts.map +0 -1
  77. package/dist/mcp/index.js +0 -3
  78. package/dist/mcp/index.js.map +0 -1
  79. package/dist/mcp/manager.d.ts +0 -51
  80. package/dist/mcp/manager.d.ts.map +0 -1
  81. package/dist/mcp/manager.js +0 -158
  82. package/dist/mcp/manager.js.map +0 -1
  83. package/dist/mcp/types.d.ts +0 -18
  84. package/dist/mcp/types.d.ts.map +0 -1
  85. package/dist/mcp/types.js +0 -5
  86. package/dist/mcp/types.js.map +0 -1
  87. package/dist/session/todo.d.ts +0 -24
  88. package/dist/session/todo.d.ts.map +0 -1
  89. package/dist/session/todo.js +0 -39
  90. package/dist/session/todo.js.map +0 -1
  91. package/dist/storage/index.d.ts +0 -2
  92. package/dist/storage/index.d.ts.map +0 -1
  93. package/dist/storage/index.js +0 -2
  94. package/dist/storage/index.js.map +0 -1
  95. package/dist/storage/storage.d.ts +0 -13
  96. package/dist/storage/storage.d.ts.map +0 -1
  97. package/dist/storage/storage.js +0 -84
  98. package/dist/storage/storage.js.map +0 -1
  99. package/dist/task.txt +0 -26
  100. package/dist/todo-read.txt +0 -14
  101. package/dist/todo-write.txt +0 -166
  102. package/dist/tools/bash.d.ts +0 -22
  103. package/dist/tools/bash.d.ts.map +0 -1
  104. package/dist/tools/bash.js +0 -70
  105. package/dist/tools/bash.js.map +0 -1
  106. package/dist/tools/file-edit.d.ts +0 -22
  107. package/dist/tools/file-edit.d.ts.map +0 -1
  108. package/dist/tools/file-edit.js +0 -67
  109. package/dist/tools/file-edit.js.map +0 -1
  110. package/dist/tools/file-read.d.ts +0 -19
  111. package/dist/tools/file-read.d.ts.map +0 -1
  112. package/dist/tools/file-read.js +0 -70
  113. package/dist/tools/file-read.js.map +0 -1
  114. package/dist/tools/file-write.d.ts +0 -16
  115. package/dist/tools/file-write.d.ts.map +0 -1
  116. package/dist/tools/file-write.js +0 -45
  117. package/dist/tools/file-write.js.map +0 -1
  118. package/dist/tools/glob.d.ts +0 -16
  119. package/dist/tools/glob.d.ts.map +0 -1
  120. package/dist/tools/glob.js +0 -45
  121. package/dist/tools/glob.js.map +0 -1
  122. package/dist/tools/grep.d.ts +0 -19
  123. package/dist/tools/grep.d.ts.map +0 -1
  124. package/dist/tools/grep.js +0 -65
  125. package/dist/tools/grep.js.map +0 -1
  126. package/dist/tools/index.d.ts +0 -11
  127. package/dist/tools/index.d.ts.map +0 -1
  128. package/dist/tools/index.js +0 -11
  129. package/dist/tools/index.js.map +0 -1
  130. package/dist/tools/registry.d.ts +0 -22
  131. package/dist/tools/registry.d.ts.map +0 -1
  132. package/dist/tools/registry.js +0 -75
  133. package/dist/tools/registry.js.map +0 -1
  134. package/dist/tools/task.d.ts +0 -19
  135. package/dist/tools/task.d.ts.map +0 -1
  136. package/dist/tools/task.js +0 -51
  137. package/dist/tools/task.js.map +0 -1
  138. package/dist/tools/todo-read.d.ts +0 -7
  139. package/dist/tools/todo-read.d.ts.map +0 -1
  140. package/dist/tools/todo-read.js +0 -56
  141. package/dist/tools/todo-read.js.map +0 -1
  142. package/dist/tools/todo-write.d.ts +0 -38
  143. package/dist/tools/todo-write.d.ts.map +0 -1
  144. package/dist/tools/todo-write.js +0 -40
  145. package/dist/tools/todo-write.js.map +0 -1
  146. package/dist/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
  147. package/dist/tree-sitter-markdown-411r6y9b.wasm +0 -0
  148. package/dist/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
  149. package/dist/tree-sitter-typescript-zxjzwt75.wasm +0 -0
  150. package/dist/tree-sitter-zig-e78zbjpm.wasm +0 -0
  151. package/dist/ui/App.d.ts +0 -6
  152. package/dist/ui/App.d.ts.map +0 -1
  153. package/dist/ui/App.jsx +0 -37
  154. package/dist/ui/App.jsx.map +0 -1
  155. package/dist/ui/components/Autocomplete.d.ts +0 -24
  156. package/dist/ui/components/Autocomplete.d.ts.map +0 -1
  157. package/dist/ui/components/Autocomplete.jsx +0 -67
  158. package/dist/ui/components/Autocomplete.jsx.map +0 -1
  159. package/dist/ui/components/ChatView.d.ts +0 -14
  160. package/dist/ui/components/ChatView.d.ts.map +0 -1
  161. package/dist/ui/components/ChatView.jsx +0 -11
  162. package/dist/ui/components/ChatView.jsx.map +0 -1
  163. package/dist/ui/components/InputArea.d.ts +0 -18
  164. package/dist/ui/components/InputArea.d.ts.map +0 -1
  165. package/dist/ui/components/InputArea.jsx +0 -35
  166. package/dist/ui/components/InputArea.jsx.map +0 -1
  167. package/dist/ui/components/MessageBlock.d.ts +0 -21
  168. package/dist/ui/components/MessageBlock.d.ts.map +0 -1
  169. package/dist/ui/components/MessageBlock.jsx +0 -94
  170. package/dist/ui/components/MessageBlock.jsx.map +0 -1
  171. package/dist/ui/components/Overlay.d.ts +0 -28
  172. package/dist/ui/components/Overlay.d.ts.map +0 -1
  173. package/dist/ui/components/Overlay.jsx +0 -102
  174. package/dist/ui/components/Overlay.jsx.map +0 -1
  175. package/dist/ui/components/ProgressBar.d.ts +0 -9
  176. package/dist/ui/components/ProgressBar.d.ts.map +0 -1
  177. package/dist/ui/components/ProgressBar.jsx +0 -17
  178. package/dist/ui/components/ProgressBar.jsx.map +0 -1
  179. package/dist/ui/components/Sidebar.d.ts +0 -22
  180. package/dist/ui/components/Sidebar.d.ts.map +0 -1
  181. package/dist/ui/components/Sidebar.jsx +0 -96
  182. package/dist/ui/components/Sidebar.jsx.map +0 -1
  183. package/dist/ui/components/StatusLine.d.ts +0 -6
  184. package/dist/ui/components/StatusLine.d.ts.map +0 -1
  185. package/dist/ui/components/StatusLine.jsx +0 -32
  186. package/dist/ui/components/StatusLine.jsx.map +0 -1
  187. package/dist/ui/components/ThinkingBlock.d.ts +0 -15
  188. package/dist/ui/components/ThinkingBlock.d.ts.map +0 -1
  189. package/dist/ui/components/ThinkingBlock.jsx +0 -33
  190. package/dist/ui/components/ThinkingBlock.jsx.map +0 -1
  191. package/dist/ui/components/TodoItem.d.ts +0 -22
  192. package/dist/ui/components/TodoItem.d.ts.map +0 -1
  193. package/dist/ui/components/TodoItem.jsx +0 -11
  194. package/dist/ui/components/TodoItem.jsx.map +0 -1
  195. package/dist/ui/components/ToolBlock.d.ts +0 -27
  196. package/dist/ui/components/ToolBlock.d.ts.map +0 -1
  197. package/dist/ui/components/ToolBlock.jsx +0 -76
  198. package/dist/ui/components/ToolBlock.jsx.map +0 -1
  199. package/dist/ui/components/index.d.ts +0 -12
  200. package/dist/ui/components/index.d.ts.map +0 -1
  201. package/dist/ui/components/index.js +0 -12
  202. package/dist/ui/components/index.js.map +0 -1
  203. package/dist/ui/context/index.d.ts +0 -4
  204. package/dist/ui/context/index.d.ts.map +0 -1
  205. package/dist/ui/context/index.js +0 -4
  206. package/dist/ui/context/index.js.map +0 -1
  207. package/dist/ui/context/mode.d.ts +0 -24
  208. package/dist/ui/context/mode.d.ts.map +0 -1
  209. package/dist/ui/context/mode.jsx +0 -53
  210. package/dist/ui/context/mode.jsx.map +0 -1
  211. package/dist/ui/context/session.d.ts +0 -43
  212. package/dist/ui/context/session.d.ts.map +0 -1
  213. package/dist/ui/context/session.jsx +0 -63
  214. package/dist/ui/context/session.jsx.map +0 -1
  215. package/dist/ui/context/todo.d.ts +0 -32
  216. package/dist/ui/context/todo.d.ts.map +0 -1
  217. package/dist/ui/context/todo.jsx +0 -75
  218. package/dist/ui/context/todo.jsx.map +0 -1
  219. package/dist/ui/design.d.ts +0 -182
  220. package/dist/ui/design.d.ts.map +0 -1
  221. package/dist/ui/design.js +0 -189
  222. package/dist/ui/design.js.map +0 -1
  223. package/dist/ui/index.d.ts +0 -4
  224. package/dist/ui/index.d.ts.map +0 -1
  225. package/dist/ui/index.js +0 -3
  226. package/dist/ui/index.js.map +0 -1
  227. package/dist/util/config.d.ts +0 -22
  228. package/dist/util/config.d.ts.map +0 -1
  229. package/dist/util/config.js +0 -55
  230. package/dist/util/config.js.map +0 -1
  231. package/dist/util/instructions.d.ts +0 -39
  232. package/dist/util/instructions.d.ts.map +0 -1
  233. package/dist/util/instructions.js +0 -96
  234. package/dist/util/instructions.js.map +0 -1
  235. package/dist/util/lock.d.ts +0 -18
  236. package/dist/util/lock.d.ts.map +0 -1
  237. package/dist/util/lock.js +0 -65
  238. package/dist/util/lock.js.map +0 -1
  239. package/dist/util/logger.d.ts +0 -8
  240. package/dist/util/logger.d.ts.map +0 -1
  241. package/dist/util/logger.js +0 -81
  242. package/dist/util/logger.js.map +0 -1
@@ -1,1353 +0,0 @@
1
- import z from "zod";
2
- /**
3
- * GLM API Types
4
- * OpenAI-compatible types for Z.AI Coding Plan API
5
- */
6
- export declare const GLMModel: z.ZodEnum<["glm-4.7", "glm-4.7-flash", "glm-4.6", "glm-4.6v", "glm-4.5", "glm-4.5-air", "glm-4.5-flash", "glm-4.5v"]>;
7
- export type GLMModel = z.infer<typeof GLMModel>;
8
- export declare const MessageRole: z.ZodEnum<["system", "user", "assistant", "tool"]>;
9
- export type MessageRole = z.infer<typeof MessageRole>;
10
- export declare const ToolCall: z.ZodObject<{
11
- id: z.ZodString;
12
- type: z.ZodLiteral<"function">;
13
- function: z.ZodObject<{
14
- name: z.ZodString;
15
- arguments: z.ZodString;
16
- }, "strip", z.ZodTypeAny, {
17
- name: string;
18
- arguments: string;
19
- }, {
20
- name: string;
21
- arguments: string;
22
- }>;
23
- }, "strip", z.ZodTypeAny, {
24
- function: {
25
- name: string;
26
- arguments: string;
27
- };
28
- type: "function";
29
- id: string;
30
- }, {
31
- function: {
32
- name: string;
33
- arguments: string;
34
- };
35
- type: "function";
36
- id: string;
37
- }>;
38
- export type ToolCall = z.infer<typeof ToolCall>;
39
- export declare const TextContent: z.ZodObject<{
40
- type: z.ZodLiteral<"text">;
41
- text: z.ZodString;
42
- }, "strip", z.ZodTypeAny, {
43
- type: "text";
44
- text: string;
45
- }, {
46
- type: "text";
47
- text: string;
48
- }>;
49
- export declare const ImageUrlContent: z.ZodObject<{
50
- type: z.ZodLiteral<"image_url">;
51
- image_url: z.ZodObject<{
52
- url: z.ZodString;
53
- detail: z.ZodOptional<z.ZodEnum<["auto", "low", "high"]>>;
54
- }, "strip", z.ZodTypeAny, {
55
- url: string;
56
- detail?: "auto" | "low" | "high" | undefined;
57
- }, {
58
- url: string;
59
- detail?: "auto" | "low" | "high" | undefined;
60
- }>;
61
- }, "strip", z.ZodTypeAny, {
62
- type: "image_url";
63
- image_url: {
64
- url: string;
65
- detail?: "auto" | "low" | "high" | undefined;
66
- };
67
- }, {
68
- type: "image_url";
69
- image_url: {
70
- url: string;
71
- detail?: "auto" | "low" | "high" | undefined;
72
- };
73
- }>;
74
- export declare const MessageContent: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
75
- type: z.ZodLiteral<"text">;
76
- text: z.ZodString;
77
- }, "strip", z.ZodTypeAny, {
78
- type: "text";
79
- text: string;
80
- }, {
81
- type: "text";
82
- text: string;
83
- }>, z.ZodObject<{
84
- type: z.ZodLiteral<"image_url">;
85
- image_url: z.ZodObject<{
86
- url: z.ZodString;
87
- detail: z.ZodOptional<z.ZodEnum<["auto", "low", "high"]>>;
88
- }, "strip", z.ZodTypeAny, {
89
- url: string;
90
- detail?: "auto" | "low" | "high" | undefined;
91
- }, {
92
- url: string;
93
- detail?: "auto" | "low" | "high" | undefined;
94
- }>;
95
- }, "strip", z.ZodTypeAny, {
96
- type: "image_url";
97
- image_url: {
98
- url: string;
99
- detail?: "auto" | "low" | "high" | undefined;
100
- };
101
- }, {
102
- type: "image_url";
103
- image_url: {
104
- url: string;
105
- detail?: "auto" | "low" | "high" | undefined;
106
- };
107
- }>]>, "many">]>;
108
- export type MessageContent = z.infer<typeof MessageContent>;
109
- export declare const ChatMessage: z.ZodObject<{
110
- role: z.ZodEnum<["system", "user", "assistant", "tool"]>;
111
- content: z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
112
- type: z.ZodLiteral<"text">;
113
- text: z.ZodString;
114
- }, "strip", z.ZodTypeAny, {
115
- type: "text";
116
- text: string;
117
- }, {
118
- type: "text";
119
- text: string;
120
- }>, z.ZodObject<{
121
- type: z.ZodLiteral<"image_url">;
122
- image_url: z.ZodObject<{
123
- url: z.ZodString;
124
- detail: z.ZodOptional<z.ZodEnum<["auto", "low", "high"]>>;
125
- }, "strip", z.ZodTypeAny, {
126
- url: string;
127
- detail?: "auto" | "low" | "high" | undefined;
128
- }, {
129
- url: string;
130
- detail?: "auto" | "low" | "high" | undefined;
131
- }>;
132
- }, "strip", z.ZodTypeAny, {
133
- type: "image_url";
134
- image_url: {
135
- url: string;
136
- detail?: "auto" | "low" | "high" | undefined;
137
- };
138
- }, {
139
- type: "image_url";
140
- image_url: {
141
- url: string;
142
- detail?: "auto" | "low" | "high" | undefined;
143
- };
144
- }>]>, "many">]>>;
145
- name: z.ZodOptional<z.ZodString>;
146
- tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
147
- id: z.ZodString;
148
- type: z.ZodLiteral<"function">;
149
- function: z.ZodObject<{
150
- name: z.ZodString;
151
- arguments: z.ZodString;
152
- }, "strip", z.ZodTypeAny, {
153
- name: string;
154
- arguments: string;
155
- }, {
156
- name: string;
157
- arguments: string;
158
- }>;
159
- }, "strip", z.ZodTypeAny, {
160
- function: {
161
- name: string;
162
- arguments: string;
163
- };
164
- type: "function";
165
- id: string;
166
- }, {
167
- function: {
168
- name: string;
169
- arguments: string;
170
- };
171
- type: "function";
172
- id: string;
173
- }>, "many">>;
174
- tool_call_id: z.ZodOptional<z.ZodString>;
175
- reasoning_content: z.ZodOptional<z.ZodString>;
176
- }, "strip", z.ZodTypeAny, {
177
- role: "system" | "user" | "assistant" | "tool";
178
- content: string | ({
179
- type: "text";
180
- text: string;
181
- } | {
182
- type: "image_url";
183
- image_url: {
184
- url: string;
185
- detail?: "auto" | "low" | "high" | undefined;
186
- };
187
- })[] | null;
188
- name?: string | undefined;
189
- tool_calls?: {
190
- function: {
191
- name: string;
192
- arguments: string;
193
- };
194
- type: "function";
195
- id: string;
196
- }[] | undefined;
197
- tool_call_id?: string | undefined;
198
- reasoning_content?: string | undefined;
199
- }, {
200
- role: "system" | "user" | "assistant" | "tool";
201
- content: string | ({
202
- type: "text";
203
- text: string;
204
- } | {
205
- type: "image_url";
206
- image_url: {
207
- url: string;
208
- detail?: "auto" | "low" | "high" | undefined;
209
- };
210
- })[] | null;
211
- name?: string | undefined;
212
- tool_calls?: {
213
- function: {
214
- name: string;
215
- arguments: string;
216
- };
217
- type: "function";
218
- id: string;
219
- }[] | undefined;
220
- tool_call_id?: string | undefined;
221
- reasoning_content?: string | undefined;
222
- }>;
223
- export type ChatMessage = z.infer<typeof ChatMessage>;
224
- export declare const ToolDefinition: z.ZodObject<{
225
- type: z.ZodLiteral<"function">;
226
- function: z.ZodObject<{
227
- name: z.ZodString;
228
- description: z.ZodOptional<z.ZodString>;
229
- parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
230
- strict: z.ZodOptional<z.ZodBoolean>;
231
- }, "strip", z.ZodTypeAny, {
232
- name: string;
233
- description?: string | undefined;
234
- parameters?: Record<string, unknown> | undefined;
235
- strict?: boolean | undefined;
236
- }, {
237
- name: string;
238
- description?: string | undefined;
239
- parameters?: Record<string, unknown> | undefined;
240
- strict?: boolean | undefined;
241
- }>;
242
- }, "strip", z.ZodTypeAny, {
243
- function: {
244
- name: string;
245
- description?: string | undefined;
246
- parameters?: Record<string, unknown> | undefined;
247
- strict?: boolean | undefined;
248
- };
249
- type: "function";
250
- }, {
251
- function: {
252
- name: string;
253
- description?: string | undefined;
254
- parameters?: Record<string, unknown> | undefined;
255
- strict?: boolean | undefined;
256
- };
257
- type: "function";
258
- }>;
259
- export type ToolDefinition = z.infer<typeof ToolDefinition>;
260
- export declare const ChatCompletionRequest: z.ZodObject<{
261
- model: z.ZodEnum<["glm-4.7", "glm-4.7-flash", "glm-4.6", "glm-4.6v", "glm-4.5", "glm-4.5-air", "glm-4.5-flash", "glm-4.5v"]>;
262
- messages: z.ZodArray<z.ZodObject<{
263
- role: z.ZodEnum<["system", "user", "assistant", "tool"]>;
264
- content: z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
265
- type: z.ZodLiteral<"text">;
266
- text: z.ZodString;
267
- }, "strip", z.ZodTypeAny, {
268
- type: "text";
269
- text: string;
270
- }, {
271
- type: "text";
272
- text: string;
273
- }>, z.ZodObject<{
274
- type: z.ZodLiteral<"image_url">;
275
- image_url: z.ZodObject<{
276
- url: z.ZodString;
277
- detail: z.ZodOptional<z.ZodEnum<["auto", "low", "high"]>>;
278
- }, "strip", z.ZodTypeAny, {
279
- url: string;
280
- detail?: "auto" | "low" | "high" | undefined;
281
- }, {
282
- url: string;
283
- detail?: "auto" | "low" | "high" | undefined;
284
- }>;
285
- }, "strip", z.ZodTypeAny, {
286
- type: "image_url";
287
- image_url: {
288
- url: string;
289
- detail?: "auto" | "low" | "high" | undefined;
290
- };
291
- }, {
292
- type: "image_url";
293
- image_url: {
294
- url: string;
295
- detail?: "auto" | "low" | "high" | undefined;
296
- };
297
- }>]>, "many">]>>;
298
- name: z.ZodOptional<z.ZodString>;
299
- tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
300
- id: z.ZodString;
301
- type: z.ZodLiteral<"function">;
302
- function: z.ZodObject<{
303
- name: z.ZodString;
304
- arguments: z.ZodString;
305
- }, "strip", z.ZodTypeAny, {
306
- name: string;
307
- arguments: string;
308
- }, {
309
- name: string;
310
- arguments: string;
311
- }>;
312
- }, "strip", z.ZodTypeAny, {
313
- function: {
314
- name: string;
315
- arguments: string;
316
- };
317
- type: "function";
318
- id: string;
319
- }, {
320
- function: {
321
- name: string;
322
- arguments: string;
323
- };
324
- type: "function";
325
- id: string;
326
- }>, "many">>;
327
- tool_call_id: z.ZodOptional<z.ZodString>;
328
- reasoning_content: z.ZodOptional<z.ZodString>;
329
- }, "strip", z.ZodTypeAny, {
330
- role: "system" | "user" | "assistant" | "tool";
331
- content: string | ({
332
- type: "text";
333
- text: string;
334
- } | {
335
- type: "image_url";
336
- image_url: {
337
- url: string;
338
- detail?: "auto" | "low" | "high" | undefined;
339
- };
340
- })[] | null;
341
- name?: string | undefined;
342
- tool_calls?: {
343
- function: {
344
- name: string;
345
- arguments: string;
346
- };
347
- type: "function";
348
- id: string;
349
- }[] | undefined;
350
- tool_call_id?: string | undefined;
351
- reasoning_content?: string | undefined;
352
- }, {
353
- role: "system" | "user" | "assistant" | "tool";
354
- content: string | ({
355
- type: "text";
356
- text: string;
357
- } | {
358
- type: "image_url";
359
- image_url: {
360
- url: string;
361
- detail?: "auto" | "low" | "high" | undefined;
362
- };
363
- })[] | null;
364
- name?: string | undefined;
365
- tool_calls?: {
366
- function: {
367
- name: string;
368
- arguments: string;
369
- };
370
- type: "function";
371
- id: string;
372
- }[] | undefined;
373
- tool_call_id?: string | undefined;
374
- reasoning_content?: string | undefined;
375
- }>, "many">;
376
- temperature: z.ZodOptional<z.ZodNumber>;
377
- top_p: z.ZodOptional<z.ZodNumber>;
378
- max_tokens: z.ZodOptional<z.ZodNumber>;
379
- stream: z.ZodOptional<z.ZodBoolean>;
380
- stop: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
381
- tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
382
- type: z.ZodLiteral<"function">;
383
- function: z.ZodObject<{
384
- name: z.ZodString;
385
- description: z.ZodOptional<z.ZodString>;
386
- parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
387
- strict: z.ZodOptional<z.ZodBoolean>;
388
- }, "strip", z.ZodTypeAny, {
389
- name: string;
390
- description?: string | undefined;
391
- parameters?: Record<string, unknown> | undefined;
392
- strict?: boolean | undefined;
393
- }, {
394
- name: string;
395
- description?: string | undefined;
396
- parameters?: Record<string, unknown> | undefined;
397
- strict?: boolean | undefined;
398
- }>;
399
- }, "strip", z.ZodTypeAny, {
400
- function: {
401
- name: string;
402
- description?: string | undefined;
403
- parameters?: Record<string, unknown> | undefined;
404
- strict?: boolean | undefined;
405
- };
406
- type: "function";
407
- }, {
408
- function: {
409
- name: string;
410
- description?: string | undefined;
411
- parameters?: Record<string, unknown> | undefined;
412
- strict?: boolean | undefined;
413
- };
414
- type: "function";
415
- }>, "many">>;
416
- tool_choice: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"none">, z.ZodLiteral<"required">, z.ZodObject<{
417
- type: z.ZodLiteral<"function">;
418
- function: z.ZodObject<{
419
- name: z.ZodString;
420
- }, "strip", z.ZodTypeAny, {
421
- name: string;
422
- }, {
423
- name: string;
424
- }>;
425
- }, "strip", z.ZodTypeAny, {
426
- function: {
427
- name: string;
428
- };
429
- type: "function";
430
- }, {
431
- function: {
432
- name: string;
433
- };
434
- type: "function";
435
- }>]>>;
436
- }, "strip", z.ZodTypeAny, {
437
- model: "glm-4.7" | "glm-4.7-flash" | "glm-4.6" | "glm-4.6v" | "glm-4.5" | "glm-4.5-air" | "glm-4.5-flash" | "glm-4.5v";
438
- messages: {
439
- role: "system" | "user" | "assistant" | "tool";
440
- content: string | ({
441
- type: "text";
442
- text: string;
443
- } | {
444
- type: "image_url";
445
- image_url: {
446
- url: string;
447
- detail?: "auto" | "low" | "high" | undefined;
448
- };
449
- })[] | null;
450
- name?: string | undefined;
451
- tool_calls?: {
452
- function: {
453
- name: string;
454
- arguments: string;
455
- };
456
- type: "function";
457
- id: string;
458
- }[] | undefined;
459
- tool_call_id?: string | undefined;
460
- reasoning_content?: string | undefined;
461
- }[];
462
- temperature?: number | undefined;
463
- top_p?: number | undefined;
464
- max_tokens?: number | undefined;
465
- stream?: boolean | undefined;
466
- stop?: string | string[] | undefined;
467
- tools?: {
468
- function: {
469
- name: string;
470
- description?: string | undefined;
471
- parameters?: Record<string, unknown> | undefined;
472
- strict?: boolean | undefined;
473
- };
474
- type: "function";
475
- }[] | undefined;
476
- tool_choice?: "auto" | "none" | "required" | {
477
- function: {
478
- name: string;
479
- };
480
- type: "function";
481
- } | undefined;
482
- }, {
483
- model: "glm-4.7" | "glm-4.7-flash" | "glm-4.6" | "glm-4.6v" | "glm-4.5" | "glm-4.5-air" | "glm-4.5-flash" | "glm-4.5v";
484
- messages: {
485
- role: "system" | "user" | "assistant" | "tool";
486
- content: string | ({
487
- type: "text";
488
- text: string;
489
- } | {
490
- type: "image_url";
491
- image_url: {
492
- url: string;
493
- detail?: "auto" | "low" | "high" | undefined;
494
- };
495
- })[] | null;
496
- name?: string | undefined;
497
- tool_calls?: {
498
- function: {
499
- name: string;
500
- arguments: string;
501
- };
502
- type: "function";
503
- id: string;
504
- }[] | undefined;
505
- tool_call_id?: string | undefined;
506
- reasoning_content?: string | undefined;
507
- }[];
508
- temperature?: number | undefined;
509
- top_p?: number | undefined;
510
- max_tokens?: number | undefined;
511
- stream?: boolean | undefined;
512
- stop?: string | string[] | undefined;
513
- tools?: {
514
- function: {
515
- name: string;
516
- description?: string | undefined;
517
- parameters?: Record<string, unknown> | undefined;
518
- strict?: boolean | undefined;
519
- };
520
- type: "function";
521
- }[] | undefined;
522
- tool_choice?: "auto" | "none" | "required" | {
523
- function: {
524
- name: string;
525
- };
526
- type: "function";
527
- } | undefined;
528
- }>;
529
- export type ChatCompletionRequest = z.infer<typeof ChatCompletionRequest>;
530
- export declare const Usage: z.ZodObject<{
531
- prompt_tokens: z.ZodNumber;
532
- completion_tokens: z.ZodNumber;
533
- total_tokens: z.ZodNumber;
534
- }, "strip", z.ZodTypeAny, {
535
- prompt_tokens: number;
536
- completion_tokens: number;
537
- total_tokens: number;
538
- }, {
539
- prompt_tokens: number;
540
- completion_tokens: number;
541
- total_tokens: number;
542
- }>;
543
- export type Usage = z.infer<typeof Usage>;
544
- export declare const ChatCompletionChoice: z.ZodObject<{
545
- index: z.ZodNumber;
546
- message: z.ZodObject<{
547
- role: z.ZodEnum<["system", "user", "assistant", "tool"]>;
548
- content: z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
549
- type: z.ZodLiteral<"text">;
550
- text: z.ZodString;
551
- }, "strip", z.ZodTypeAny, {
552
- type: "text";
553
- text: string;
554
- }, {
555
- type: "text";
556
- text: string;
557
- }>, z.ZodObject<{
558
- type: z.ZodLiteral<"image_url">;
559
- image_url: z.ZodObject<{
560
- url: z.ZodString;
561
- detail: z.ZodOptional<z.ZodEnum<["auto", "low", "high"]>>;
562
- }, "strip", z.ZodTypeAny, {
563
- url: string;
564
- detail?: "auto" | "low" | "high" | undefined;
565
- }, {
566
- url: string;
567
- detail?: "auto" | "low" | "high" | undefined;
568
- }>;
569
- }, "strip", z.ZodTypeAny, {
570
- type: "image_url";
571
- image_url: {
572
- url: string;
573
- detail?: "auto" | "low" | "high" | undefined;
574
- };
575
- }, {
576
- type: "image_url";
577
- image_url: {
578
- url: string;
579
- detail?: "auto" | "low" | "high" | undefined;
580
- };
581
- }>]>, "many">]>>;
582
- name: z.ZodOptional<z.ZodString>;
583
- tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
584
- id: z.ZodString;
585
- type: z.ZodLiteral<"function">;
586
- function: z.ZodObject<{
587
- name: z.ZodString;
588
- arguments: z.ZodString;
589
- }, "strip", z.ZodTypeAny, {
590
- name: string;
591
- arguments: string;
592
- }, {
593
- name: string;
594
- arguments: string;
595
- }>;
596
- }, "strip", z.ZodTypeAny, {
597
- function: {
598
- name: string;
599
- arguments: string;
600
- };
601
- type: "function";
602
- id: string;
603
- }, {
604
- function: {
605
- name: string;
606
- arguments: string;
607
- };
608
- type: "function";
609
- id: string;
610
- }>, "many">>;
611
- tool_call_id: z.ZodOptional<z.ZodString>;
612
- reasoning_content: z.ZodOptional<z.ZodString>;
613
- }, "strip", z.ZodTypeAny, {
614
- role: "system" | "user" | "assistant" | "tool";
615
- content: string | ({
616
- type: "text";
617
- text: string;
618
- } | {
619
- type: "image_url";
620
- image_url: {
621
- url: string;
622
- detail?: "auto" | "low" | "high" | undefined;
623
- };
624
- })[] | null;
625
- name?: string | undefined;
626
- tool_calls?: {
627
- function: {
628
- name: string;
629
- arguments: string;
630
- };
631
- type: "function";
632
- id: string;
633
- }[] | undefined;
634
- tool_call_id?: string | undefined;
635
- reasoning_content?: string | undefined;
636
- }, {
637
- role: "system" | "user" | "assistant" | "tool";
638
- content: string | ({
639
- type: "text";
640
- text: string;
641
- } | {
642
- type: "image_url";
643
- image_url: {
644
- url: string;
645
- detail?: "auto" | "low" | "high" | undefined;
646
- };
647
- })[] | null;
648
- name?: string | undefined;
649
- tool_calls?: {
650
- function: {
651
- name: string;
652
- arguments: string;
653
- };
654
- type: "function";
655
- id: string;
656
- }[] | undefined;
657
- tool_call_id?: string | undefined;
658
- reasoning_content?: string | undefined;
659
- }>;
660
- finish_reason: z.ZodNullable<z.ZodEnum<["stop", "length", "tool_calls", "content_filter"]>>;
661
- }, "strip", z.ZodTypeAny, {
662
- message: {
663
- role: "system" | "user" | "assistant" | "tool";
664
- content: string | ({
665
- type: "text";
666
- text: string;
667
- } | {
668
- type: "image_url";
669
- image_url: {
670
- url: string;
671
- detail?: "auto" | "low" | "high" | undefined;
672
- };
673
- })[] | null;
674
- name?: string | undefined;
675
- tool_calls?: {
676
- function: {
677
- name: string;
678
- arguments: string;
679
- };
680
- type: "function";
681
- id: string;
682
- }[] | undefined;
683
- tool_call_id?: string | undefined;
684
- reasoning_content?: string | undefined;
685
- };
686
- index: number;
687
- finish_reason: "length" | "tool_calls" | "stop" | "content_filter" | null;
688
- }, {
689
- message: {
690
- role: "system" | "user" | "assistant" | "tool";
691
- content: string | ({
692
- type: "text";
693
- text: string;
694
- } | {
695
- type: "image_url";
696
- image_url: {
697
- url: string;
698
- detail?: "auto" | "low" | "high" | undefined;
699
- };
700
- })[] | null;
701
- name?: string | undefined;
702
- tool_calls?: {
703
- function: {
704
- name: string;
705
- arguments: string;
706
- };
707
- type: "function";
708
- id: string;
709
- }[] | undefined;
710
- tool_call_id?: string | undefined;
711
- reasoning_content?: string | undefined;
712
- };
713
- index: number;
714
- finish_reason: "length" | "tool_calls" | "stop" | "content_filter" | null;
715
- }>;
716
- export type ChatCompletionChoice = z.infer<typeof ChatCompletionChoice>;
717
- export declare const ChatCompletionResponse: z.ZodObject<{
718
- id: z.ZodString;
719
- object: z.ZodLiteral<"chat.completion">;
720
- created: z.ZodNumber;
721
- model: z.ZodString;
722
- choices: z.ZodArray<z.ZodObject<{
723
- index: z.ZodNumber;
724
- message: z.ZodObject<{
725
- role: z.ZodEnum<["system", "user", "assistant", "tool"]>;
726
- content: z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
727
- type: z.ZodLiteral<"text">;
728
- text: z.ZodString;
729
- }, "strip", z.ZodTypeAny, {
730
- type: "text";
731
- text: string;
732
- }, {
733
- type: "text";
734
- text: string;
735
- }>, z.ZodObject<{
736
- type: z.ZodLiteral<"image_url">;
737
- image_url: z.ZodObject<{
738
- url: z.ZodString;
739
- detail: z.ZodOptional<z.ZodEnum<["auto", "low", "high"]>>;
740
- }, "strip", z.ZodTypeAny, {
741
- url: string;
742
- detail?: "auto" | "low" | "high" | undefined;
743
- }, {
744
- url: string;
745
- detail?: "auto" | "low" | "high" | undefined;
746
- }>;
747
- }, "strip", z.ZodTypeAny, {
748
- type: "image_url";
749
- image_url: {
750
- url: string;
751
- detail?: "auto" | "low" | "high" | undefined;
752
- };
753
- }, {
754
- type: "image_url";
755
- image_url: {
756
- url: string;
757
- detail?: "auto" | "low" | "high" | undefined;
758
- };
759
- }>]>, "many">]>>;
760
- name: z.ZodOptional<z.ZodString>;
761
- tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
762
- id: z.ZodString;
763
- type: z.ZodLiteral<"function">;
764
- function: z.ZodObject<{
765
- name: z.ZodString;
766
- arguments: z.ZodString;
767
- }, "strip", z.ZodTypeAny, {
768
- name: string;
769
- arguments: string;
770
- }, {
771
- name: string;
772
- arguments: string;
773
- }>;
774
- }, "strip", z.ZodTypeAny, {
775
- function: {
776
- name: string;
777
- arguments: string;
778
- };
779
- type: "function";
780
- id: string;
781
- }, {
782
- function: {
783
- name: string;
784
- arguments: string;
785
- };
786
- type: "function";
787
- id: string;
788
- }>, "many">>;
789
- tool_call_id: z.ZodOptional<z.ZodString>;
790
- reasoning_content: z.ZodOptional<z.ZodString>;
791
- }, "strip", z.ZodTypeAny, {
792
- role: "system" | "user" | "assistant" | "tool";
793
- content: string | ({
794
- type: "text";
795
- text: string;
796
- } | {
797
- type: "image_url";
798
- image_url: {
799
- url: string;
800
- detail?: "auto" | "low" | "high" | undefined;
801
- };
802
- })[] | null;
803
- name?: string | undefined;
804
- tool_calls?: {
805
- function: {
806
- name: string;
807
- arguments: string;
808
- };
809
- type: "function";
810
- id: string;
811
- }[] | undefined;
812
- tool_call_id?: string | undefined;
813
- reasoning_content?: string | undefined;
814
- }, {
815
- role: "system" | "user" | "assistant" | "tool";
816
- content: string | ({
817
- type: "text";
818
- text: string;
819
- } | {
820
- type: "image_url";
821
- image_url: {
822
- url: string;
823
- detail?: "auto" | "low" | "high" | undefined;
824
- };
825
- })[] | null;
826
- name?: string | undefined;
827
- tool_calls?: {
828
- function: {
829
- name: string;
830
- arguments: string;
831
- };
832
- type: "function";
833
- id: string;
834
- }[] | undefined;
835
- tool_call_id?: string | undefined;
836
- reasoning_content?: string | undefined;
837
- }>;
838
- finish_reason: z.ZodNullable<z.ZodEnum<["stop", "length", "tool_calls", "content_filter"]>>;
839
- }, "strip", z.ZodTypeAny, {
840
- message: {
841
- role: "system" | "user" | "assistant" | "tool";
842
- content: string | ({
843
- type: "text";
844
- text: string;
845
- } | {
846
- type: "image_url";
847
- image_url: {
848
- url: string;
849
- detail?: "auto" | "low" | "high" | undefined;
850
- };
851
- })[] | null;
852
- name?: string | undefined;
853
- tool_calls?: {
854
- function: {
855
- name: string;
856
- arguments: string;
857
- };
858
- type: "function";
859
- id: string;
860
- }[] | undefined;
861
- tool_call_id?: string | undefined;
862
- reasoning_content?: string | undefined;
863
- };
864
- index: number;
865
- finish_reason: "length" | "tool_calls" | "stop" | "content_filter" | null;
866
- }, {
867
- message: {
868
- role: "system" | "user" | "assistant" | "tool";
869
- content: string | ({
870
- type: "text";
871
- text: string;
872
- } | {
873
- type: "image_url";
874
- image_url: {
875
- url: string;
876
- detail?: "auto" | "low" | "high" | undefined;
877
- };
878
- })[] | null;
879
- name?: string | undefined;
880
- tool_calls?: {
881
- function: {
882
- name: string;
883
- arguments: string;
884
- };
885
- type: "function";
886
- id: string;
887
- }[] | undefined;
888
- tool_call_id?: string | undefined;
889
- reasoning_content?: string | undefined;
890
- };
891
- index: number;
892
- finish_reason: "length" | "tool_calls" | "stop" | "content_filter" | null;
893
- }>, "many">;
894
- usage: z.ZodOptional<z.ZodObject<{
895
- prompt_tokens: z.ZodNumber;
896
- completion_tokens: z.ZodNumber;
897
- total_tokens: z.ZodNumber;
898
- }, "strip", z.ZodTypeAny, {
899
- prompt_tokens: number;
900
- completion_tokens: number;
901
- total_tokens: number;
902
- }, {
903
- prompt_tokens: number;
904
- completion_tokens: number;
905
- total_tokens: number;
906
- }>>;
907
- }, "strip", z.ZodTypeAny, {
908
- object: "chat.completion";
909
- id: string;
910
- model: string;
911
- created: number;
912
- choices: {
913
- message: {
914
- role: "system" | "user" | "assistant" | "tool";
915
- content: string | ({
916
- type: "text";
917
- text: string;
918
- } | {
919
- type: "image_url";
920
- image_url: {
921
- url: string;
922
- detail?: "auto" | "low" | "high" | undefined;
923
- };
924
- })[] | null;
925
- name?: string | undefined;
926
- tool_calls?: {
927
- function: {
928
- name: string;
929
- arguments: string;
930
- };
931
- type: "function";
932
- id: string;
933
- }[] | undefined;
934
- tool_call_id?: string | undefined;
935
- reasoning_content?: string | undefined;
936
- };
937
- index: number;
938
- finish_reason: "length" | "tool_calls" | "stop" | "content_filter" | null;
939
- }[];
940
- usage?: {
941
- prompt_tokens: number;
942
- completion_tokens: number;
943
- total_tokens: number;
944
- } | undefined;
945
- }, {
946
- object: "chat.completion";
947
- id: string;
948
- model: string;
949
- created: number;
950
- choices: {
951
- message: {
952
- role: "system" | "user" | "assistant" | "tool";
953
- content: string | ({
954
- type: "text";
955
- text: string;
956
- } | {
957
- type: "image_url";
958
- image_url: {
959
- url: string;
960
- detail?: "auto" | "low" | "high" | undefined;
961
- };
962
- })[] | null;
963
- name?: string | undefined;
964
- tool_calls?: {
965
- function: {
966
- name: string;
967
- arguments: string;
968
- };
969
- type: "function";
970
- id: string;
971
- }[] | undefined;
972
- tool_call_id?: string | undefined;
973
- reasoning_content?: string | undefined;
974
- };
975
- index: number;
976
- finish_reason: "length" | "tool_calls" | "stop" | "content_filter" | null;
977
- }[];
978
- usage?: {
979
- prompt_tokens: number;
980
- completion_tokens: number;
981
- total_tokens: number;
982
- } | undefined;
983
- }>;
984
- export type ChatCompletionResponse = z.infer<typeof ChatCompletionResponse>;
985
- export declare const StreamDelta: z.ZodObject<{
986
- role: z.ZodOptional<z.ZodEnum<["system", "user", "assistant", "tool"]>>;
987
- content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
988
- reasoning_content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
989
- tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
990
- index: z.ZodNumber;
991
- id: z.ZodOptional<z.ZodString>;
992
- type: z.ZodOptional<z.ZodLiteral<"function">>;
993
- function: z.ZodOptional<z.ZodObject<{
994
- name: z.ZodOptional<z.ZodString>;
995
- arguments: z.ZodOptional<z.ZodString>;
996
- }, "strip", z.ZodTypeAny, {
997
- name?: string | undefined;
998
- arguments?: string | undefined;
999
- }, {
1000
- name?: string | undefined;
1001
- arguments?: string | undefined;
1002
- }>>;
1003
- }, "strip", z.ZodTypeAny, {
1004
- index: number;
1005
- function?: {
1006
- name?: string | undefined;
1007
- arguments?: string | undefined;
1008
- } | undefined;
1009
- type?: "function" | undefined;
1010
- id?: string | undefined;
1011
- }, {
1012
- index: number;
1013
- function?: {
1014
- name?: string | undefined;
1015
- arguments?: string | undefined;
1016
- } | undefined;
1017
- type?: "function" | undefined;
1018
- id?: string | undefined;
1019
- }>, "many">>;
1020
- }, "strip", z.ZodTypeAny, {
1021
- role?: "system" | "user" | "assistant" | "tool" | undefined;
1022
- content?: string | null | undefined;
1023
- tool_calls?: {
1024
- index: number;
1025
- function?: {
1026
- name?: string | undefined;
1027
- arguments?: string | undefined;
1028
- } | undefined;
1029
- type?: "function" | undefined;
1030
- id?: string | undefined;
1031
- }[] | undefined;
1032
- reasoning_content?: string | null | undefined;
1033
- }, {
1034
- role?: "system" | "user" | "assistant" | "tool" | undefined;
1035
- content?: string | null | undefined;
1036
- tool_calls?: {
1037
- index: number;
1038
- function?: {
1039
- name?: string | undefined;
1040
- arguments?: string | undefined;
1041
- } | undefined;
1042
- type?: "function" | undefined;
1043
- id?: string | undefined;
1044
- }[] | undefined;
1045
- reasoning_content?: string | null | undefined;
1046
- }>;
1047
- export type StreamDelta = z.infer<typeof StreamDelta>;
1048
- export declare const StreamChoice: z.ZodObject<{
1049
- index: z.ZodNumber;
1050
- delta: z.ZodObject<{
1051
- role: z.ZodOptional<z.ZodEnum<["system", "user", "assistant", "tool"]>>;
1052
- content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1053
- reasoning_content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1054
- tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
1055
- index: z.ZodNumber;
1056
- id: z.ZodOptional<z.ZodString>;
1057
- type: z.ZodOptional<z.ZodLiteral<"function">>;
1058
- function: z.ZodOptional<z.ZodObject<{
1059
- name: z.ZodOptional<z.ZodString>;
1060
- arguments: z.ZodOptional<z.ZodString>;
1061
- }, "strip", z.ZodTypeAny, {
1062
- name?: string | undefined;
1063
- arguments?: string | undefined;
1064
- }, {
1065
- name?: string | undefined;
1066
- arguments?: string | undefined;
1067
- }>>;
1068
- }, "strip", z.ZodTypeAny, {
1069
- index: number;
1070
- function?: {
1071
- name?: string | undefined;
1072
- arguments?: string | undefined;
1073
- } | undefined;
1074
- type?: "function" | undefined;
1075
- id?: string | undefined;
1076
- }, {
1077
- index: number;
1078
- function?: {
1079
- name?: string | undefined;
1080
- arguments?: string | undefined;
1081
- } | undefined;
1082
- type?: "function" | undefined;
1083
- id?: string | undefined;
1084
- }>, "many">>;
1085
- }, "strip", z.ZodTypeAny, {
1086
- role?: "system" | "user" | "assistant" | "tool" | undefined;
1087
- content?: string | null | undefined;
1088
- tool_calls?: {
1089
- index: number;
1090
- function?: {
1091
- name?: string | undefined;
1092
- arguments?: string | undefined;
1093
- } | undefined;
1094
- type?: "function" | undefined;
1095
- id?: string | undefined;
1096
- }[] | undefined;
1097
- reasoning_content?: string | null | undefined;
1098
- }, {
1099
- role?: "system" | "user" | "assistant" | "tool" | undefined;
1100
- content?: string | null | undefined;
1101
- tool_calls?: {
1102
- index: number;
1103
- function?: {
1104
- name?: string | undefined;
1105
- arguments?: string | undefined;
1106
- } | undefined;
1107
- type?: "function" | undefined;
1108
- id?: string | undefined;
1109
- }[] | undefined;
1110
- reasoning_content?: string | null | undefined;
1111
- }>;
1112
- finish_reason: z.ZodNullable<z.ZodEnum<["stop", "length", "tool_calls", "content_filter"]>>;
1113
- }, "strip", z.ZodTypeAny, {
1114
- index: number;
1115
- finish_reason: "length" | "tool_calls" | "stop" | "content_filter" | null;
1116
- delta: {
1117
- role?: "system" | "user" | "assistant" | "tool" | undefined;
1118
- content?: string | null | undefined;
1119
- tool_calls?: {
1120
- index: number;
1121
- function?: {
1122
- name?: string | undefined;
1123
- arguments?: string | undefined;
1124
- } | undefined;
1125
- type?: "function" | undefined;
1126
- id?: string | undefined;
1127
- }[] | undefined;
1128
- reasoning_content?: string | null | undefined;
1129
- };
1130
- }, {
1131
- index: number;
1132
- finish_reason: "length" | "tool_calls" | "stop" | "content_filter" | null;
1133
- delta: {
1134
- role?: "system" | "user" | "assistant" | "tool" | undefined;
1135
- content?: string | null | undefined;
1136
- tool_calls?: {
1137
- index: number;
1138
- function?: {
1139
- name?: string | undefined;
1140
- arguments?: string | undefined;
1141
- } | undefined;
1142
- type?: "function" | undefined;
1143
- id?: string | undefined;
1144
- }[] | undefined;
1145
- reasoning_content?: string | null | undefined;
1146
- };
1147
- }>;
1148
- export type StreamChoice = z.infer<typeof StreamChoice>;
1149
- export declare const ChatCompletionChunk: z.ZodObject<{
1150
- id: z.ZodString;
1151
- object: z.ZodLiteral<"chat.completion.chunk">;
1152
- created: z.ZodNumber;
1153
- model: z.ZodString;
1154
- choices: z.ZodArray<z.ZodObject<{
1155
- index: z.ZodNumber;
1156
- delta: z.ZodObject<{
1157
- role: z.ZodOptional<z.ZodEnum<["system", "user", "assistant", "tool"]>>;
1158
- content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1159
- reasoning_content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1160
- tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
1161
- index: z.ZodNumber;
1162
- id: z.ZodOptional<z.ZodString>;
1163
- type: z.ZodOptional<z.ZodLiteral<"function">>;
1164
- function: z.ZodOptional<z.ZodObject<{
1165
- name: z.ZodOptional<z.ZodString>;
1166
- arguments: z.ZodOptional<z.ZodString>;
1167
- }, "strip", z.ZodTypeAny, {
1168
- name?: string | undefined;
1169
- arguments?: string | undefined;
1170
- }, {
1171
- name?: string | undefined;
1172
- arguments?: string | undefined;
1173
- }>>;
1174
- }, "strip", z.ZodTypeAny, {
1175
- index: number;
1176
- function?: {
1177
- name?: string | undefined;
1178
- arguments?: string | undefined;
1179
- } | undefined;
1180
- type?: "function" | undefined;
1181
- id?: string | undefined;
1182
- }, {
1183
- index: number;
1184
- function?: {
1185
- name?: string | undefined;
1186
- arguments?: string | undefined;
1187
- } | undefined;
1188
- type?: "function" | undefined;
1189
- id?: string | undefined;
1190
- }>, "many">>;
1191
- }, "strip", z.ZodTypeAny, {
1192
- role?: "system" | "user" | "assistant" | "tool" | undefined;
1193
- content?: string | null | undefined;
1194
- tool_calls?: {
1195
- index: number;
1196
- function?: {
1197
- name?: string | undefined;
1198
- arguments?: string | undefined;
1199
- } | undefined;
1200
- type?: "function" | undefined;
1201
- id?: string | undefined;
1202
- }[] | undefined;
1203
- reasoning_content?: string | null | undefined;
1204
- }, {
1205
- role?: "system" | "user" | "assistant" | "tool" | undefined;
1206
- content?: string | null | undefined;
1207
- tool_calls?: {
1208
- index: number;
1209
- function?: {
1210
- name?: string | undefined;
1211
- arguments?: string | undefined;
1212
- } | undefined;
1213
- type?: "function" | undefined;
1214
- id?: string | undefined;
1215
- }[] | undefined;
1216
- reasoning_content?: string | null | undefined;
1217
- }>;
1218
- finish_reason: z.ZodNullable<z.ZodEnum<["stop", "length", "tool_calls", "content_filter"]>>;
1219
- }, "strip", z.ZodTypeAny, {
1220
- index: number;
1221
- finish_reason: "length" | "tool_calls" | "stop" | "content_filter" | null;
1222
- delta: {
1223
- role?: "system" | "user" | "assistant" | "tool" | undefined;
1224
- content?: string | null | undefined;
1225
- tool_calls?: {
1226
- index: number;
1227
- function?: {
1228
- name?: string | undefined;
1229
- arguments?: string | undefined;
1230
- } | undefined;
1231
- type?: "function" | undefined;
1232
- id?: string | undefined;
1233
- }[] | undefined;
1234
- reasoning_content?: string | null | undefined;
1235
- };
1236
- }, {
1237
- index: number;
1238
- finish_reason: "length" | "tool_calls" | "stop" | "content_filter" | null;
1239
- delta: {
1240
- role?: "system" | "user" | "assistant" | "tool" | undefined;
1241
- content?: string | null | undefined;
1242
- tool_calls?: {
1243
- index: number;
1244
- function?: {
1245
- name?: string | undefined;
1246
- arguments?: string | undefined;
1247
- } | undefined;
1248
- type?: "function" | undefined;
1249
- id?: string | undefined;
1250
- }[] | undefined;
1251
- reasoning_content?: string | null | undefined;
1252
- };
1253
- }>, "many">;
1254
- usage: z.ZodNullable<z.ZodOptional<z.ZodObject<{
1255
- prompt_tokens: z.ZodNumber;
1256
- completion_tokens: z.ZodNumber;
1257
- total_tokens: z.ZodNumber;
1258
- }, "strip", z.ZodTypeAny, {
1259
- prompt_tokens: number;
1260
- completion_tokens: number;
1261
- total_tokens: number;
1262
- }, {
1263
- prompt_tokens: number;
1264
- completion_tokens: number;
1265
- total_tokens: number;
1266
- }>>>;
1267
- }, "strip", z.ZodTypeAny, {
1268
- object: "chat.completion.chunk";
1269
- id: string;
1270
- model: string;
1271
- created: number;
1272
- choices: {
1273
- index: number;
1274
- finish_reason: "length" | "tool_calls" | "stop" | "content_filter" | null;
1275
- delta: {
1276
- role?: "system" | "user" | "assistant" | "tool" | undefined;
1277
- content?: string | null | undefined;
1278
- tool_calls?: {
1279
- index: number;
1280
- function?: {
1281
- name?: string | undefined;
1282
- arguments?: string | undefined;
1283
- } | undefined;
1284
- type?: "function" | undefined;
1285
- id?: string | undefined;
1286
- }[] | undefined;
1287
- reasoning_content?: string | null | undefined;
1288
- };
1289
- }[];
1290
- usage?: {
1291
- prompt_tokens: number;
1292
- completion_tokens: number;
1293
- total_tokens: number;
1294
- } | null | undefined;
1295
- }, {
1296
- object: "chat.completion.chunk";
1297
- id: string;
1298
- model: string;
1299
- created: number;
1300
- choices: {
1301
- index: number;
1302
- finish_reason: "length" | "tool_calls" | "stop" | "content_filter" | null;
1303
- delta: {
1304
- role?: "system" | "user" | "assistant" | "tool" | undefined;
1305
- content?: string | null | undefined;
1306
- tool_calls?: {
1307
- index: number;
1308
- function?: {
1309
- name?: string | undefined;
1310
- arguments?: string | undefined;
1311
- } | undefined;
1312
- type?: "function" | undefined;
1313
- id?: string | undefined;
1314
- }[] | undefined;
1315
- reasoning_content?: string | null | undefined;
1316
- };
1317
- }[];
1318
- usage?: {
1319
- prompt_tokens: number;
1320
- completion_tokens: number;
1321
- total_tokens: number;
1322
- } | null | undefined;
1323
- }>;
1324
- export type ChatCompletionChunk = z.infer<typeof ChatCompletionChunk>;
1325
- export declare const APIError: z.ZodObject<{
1326
- error: z.ZodObject<{
1327
- message: z.ZodString;
1328
- type: z.ZodOptional<z.ZodString>;
1329
- code: z.ZodOptional<z.ZodString>;
1330
- }, "strip", z.ZodTypeAny, {
1331
- message: string;
1332
- code?: string | undefined;
1333
- type?: string | undefined;
1334
- }, {
1335
- message: string;
1336
- code?: string | undefined;
1337
- type?: string | undefined;
1338
- }>;
1339
- }, "strip", z.ZodTypeAny, {
1340
- error: {
1341
- message: string;
1342
- code?: string | undefined;
1343
- type?: string | undefined;
1344
- };
1345
- }, {
1346
- error: {
1347
- message: string;
1348
- code?: string | undefined;
1349
- type?: string | undefined;
1350
- };
1351
- }>;
1352
- export type APIError = z.infer<typeof APIError>;
1353
- //# sourceMappingURL=types.d.ts.map