@assistant-ui/react 0.5.48 → 0.5.50

Sign up to get free protection for your applications and to get access to all the features.
package/dist/edge.d.mts CHANGED
@@ -2,55 +2,6 @@ import { LanguageModelV1LogProbs, LanguageModelV1, LanguageModelV1ToolChoice } f
2
2
  import { JSONSchema7 } from 'json-schema';
3
3
  import { z } from 'zod';
4
4
 
5
- declare const LanguageModelV1CallSettingsSchema: z.ZodObject<{
6
- maxTokens: z.ZodOptional<z.ZodNumber>;
7
- temperature: z.ZodOptional<z.ZodNumber>;
8
- topP: z.ZodOptional<z.ZodNumber>;
9
- presencePenalty: z.ZodOptional<z.ZodNumber>;
10
- frequencyPenalty: z.ZodOptional<z.ZodNumber>;
11
- seed: z.ZodOptional<z.ZodNumber>;
12
- headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>>;
13
- }, "strip", z.ZodTypeAny, {
14
- maxTokens?: number | undefined;
15
- temperature?: number | undefined;
16
- topP?: number | undefined;
17
- presencePenalty?: number | undefined;
18
- frequencyPenalty?: number | undefined;
19
- seed?: number | undefined;
20
- headers?: Record<string, string | undefined> | undefined;
21
- }, {
22
- maxTokens?: number | undefined;
23
- temperature?: number | undefined;
24
- topP?: number | undefined;
25
- presencePenalty?: number | undefined;
26
- frequencyPenalty?: number | undefined;
27
- seed?: number | undefined;
28
- headers?: Record<string, string | undefined> | undefined;
29
- }>;
30
- type LanguageModelV1CallSettings = z.infer<typeof LanguageModelV1CallSettingsSchema>;
31
- declare const LanguageModelConfigSchema: z.ZodObject<{
32
- apiKey: z.ZodOptional<z.ZodString>;
33
- baseUrl: z.ZodOptional<z.ZodString>;
34
- modelName: z.ZodOptional<z.ZodString>;
35
- }, "strip", z.ZodTypeAny, {
36
- apiKey?: string | undefined;
37
- baseUrl?: string | undefined;
38
- modelName?: string | undefined;
39
- }, {
40
- apiKey?: string | undefined;
41
- baseUrl?: string | undefined;
42
- modelName?: string | undefined;
43
- }>;
44
- type LanguageModelConfig = z.infer<typeof LanguageModelConfigSchema>;
45
- type ToolExecuteFunction<TArgs, TResult> = (args: TArgs, context: {
46
- abortSignal: AbortSignal;
47
- }) => TResult | Promise<TResult>;
48
- type Tool<TArgs extends Record<string, unknown> = Record<string | number, unknown>, TResult = unknown> = {
49
- description?: string | undefined;
50
- parameters: z.ZodSchema<TArgs> | JSONSchema7;
51
- execute?: ToolExecuteFunction<TArgs, TResult>;
52
- };
53
-
54
5
  type TextContentPart = {
55
6
  type: "text";
56
7
  text: string;
@@ -99,23 +50,23 @@ declare const EdgeRuntimeRequestOptionsSchema: z.ZodObject<z.objectUtil.extendSh
99
50
  type: z.ZodLiteral<"text">;
100
51
  text: z.ZodString;
101
52
  }, "strip", z.ZodTypeAny, {
102
- type: "text";
103
53
  text: string;
104
- }, {
105
54
  type: "text";
55
+ }, {
106
56
  text: string;
57
+ type: "text";
107
58
  }>], null>;
108
59
  }, "strip", z.ZodTypeAny, {
109
60
  role: "system";
110
61
  content: [{
111
- type: "text";
112
62
  text: string;
63
+ type: "text";
113
64
  }];
114
65
  }, {
115
66
  role: "system";
116
67
  content: [{
117
- type: "text";
118
68
  text: string;
69
+ type: "text";
119
70
  }];
120
71
  }>, z.ZodObject<{
121
72
  role: z.ZodLiteral<"user">;
@@ -123,38 +74,38 @@ declare const EdgeRuntimeRequestOptionsSchema: z.ZodObject<z.objectUtil.extendSh
123
74
  type: z.ZodLiteral<"text">;
124
75
  text: z.ZodString;
125
76
  }, "strip", z.ZodTypeAny, {
126
- type: "text";
127
77
  text: string;
128
- }, {
129
78
  type: "text";
79
+ }, {
130
80
  text: string;
81
+ type: "text";
131
82
  }>, z.ZodObject<{
132
83
  type: z.ZodLiteral<"image">;
133
84
  image: z.ZodString;
134
85
  }, "strip", z.ZodTypeAny, {
135
- type: "image";
136
86
  image: string;
137
- }, {
138
87
  type: "image";
88
+ }, {
139
89
  image: string;
90
+ type: "image";
140
91
  }>]>, "many">;
141
92
  }, "strip", z.ZodTypeAny, {
142
93
  role: "user";
143
94
  content: ({
144
- type: "text";
145
95
  text: string;
96
+ type: "text";
146
97
  } | {
147
- type: "image";
148
98
  image: string;
99
+ type: "image";
149
100
  })[];
150
101
  }, {
151
102
  role: "user";
152
103
  content: ({
153
- type: "text";
154
104
  text: string;
105
+ type: "text";
155
106
  } | {
156
- type: "image";
157
107
  image: string;
108
+ type: "image";
158
109
  })[];
159
110
  }>, z.ZodObject<{
160
111
  role: z.ZodLiteral<"assistant">;
@@ -162,11 +113,11 @@ declare const EdgeRuntimeRequestOptionsSchema: z.ZodObject<z.objectUtil.extendSh
162
113
  type: z.ZodLiteral<"text">;
163
114
  text: z.ZodString;
164
115
  }, "strip", z.ZodTypeAny, {
165
- type: "text";
166
116
  text: string;
167
- }, {
168
117
  type: "text";
118
+ }, {
169
119
  text: string;
120
+ type: "text";
170
121
  }>, z.ZodObject<{
171
122
  type: z.ZodLiteral<"tool-call">;
172
123
  toolCallId: z.ZodString;
@@ -192,8 +143,8 @@ declare const EdgeRuntimeRequestOptionsSchema: z.ZodObject<z.objectUtil.extendSh
192
143
  }, "strip", z.ZodTypeAny, {
193
144
  role: "assistant";
194
145
  content: ({
195
- type: "text";
196
146
  text: string;
147
+ type: "text";
197
148
  } | {
198
149
  type: "tool-call";
199
150
  toolCallId: string;
@@ -205,8 +156,8 @@ declare const EdgeRuntimeRequestOptionsSchema: z.ZodObject<z.objectUtil.extendSh
205
156
  }, {
206
157
  role: "assistant";
207
158
  content: ({
208
- type: "text";
209
159
  text: string;
160
+ type: "text";
210
161
  } | {
211
162
  type: "tool-call";
212
163
  toolCallId: string;
@@ -248,17 +199,17 @@ declare const EdgeRuntimeRequestOptionsSchema: z.ZodObject<z.objectUtil.extendSh
248
199
  messages: ({
249
200
  role: "user";
250
201
  content: ({
251
- type: "text";
252
202
  text: string;
203
+ type: "text";
253
204
  } | {
254
- type: "image";
255
205
  image: string;
206
+ type: "image";
256
207
  })[];
257
208
  } | {
258
209
  role: "assistant";
259
210
  content: ({
260
- type: "text";
261
211
  text: string;
212
+ type: "text";
262
213
  } | {
263
214
  type: "tool-call";
264
215
  toolCallId: string;
@@ -270,10 +221,11 @@ declare const EdgeRuntimeRequestOptionsSchema: z.ZodObject<z.objectUtil.extendSh
270
221
  } | {
271
222
  role: "system";
272
223
  content: [{
273
- type: "text";
274
224
  text: string;
225
+ type: "text";
275
226
  }];
276
227
  })[];
228
+ system?: string | undefined;
277
229
  maxTokens?: number | undefined;
278
230
  temperature?: number | undefined;
279
231
  topP?: number | undefined;
@@ -284,7 +236,6 @@ declare const EdgeRuntimeRequestOptionsSchema: z.ZodObject<z.objectUtil.extendSh
284
236
  apiKey?: string | undefined;
285
237
  baseUrl?: string | undefined;
286
238
  modelName?: string | undefined;
287
- system?: string | undefined;
288
239
  tools?: {
289
240
  type: "function";
290
241
  name: string;
@@ -295,17 +246,17 @@ declare const EdgeRuntimeRequestOptionsSchema: z.ZodObject<z.objectUtil.extendSh
295
246
  messages: ({
296
247
  role: "user";
297
248
  content: ({
298
- type: "text";
299
249
  text: string;
250
+ type: "text";
300
251
  } | {
301
- type: "image";
302
252
  image: string;
253
+ type: "image";
303
254
  })[];
304
255
  } | {
305
256
  role: "assistant";
306
257
  content: ({
307
- type: "text";
308
258
  text: string;
259
+ type: "text";
309
260
  } | {
310
261
  type: "tool-call";
311
262
  toolCallId: string;
@@ -317,10 +268,11 @@ declare const EdgeRuntimeRequestOptionsSchema: z.ZodObject<z.objectUtil.extendSh
317
268
  } | {
318
269
  role: "system";
319
270
  content: [{
320
- type: "text";
321
271
  text: string;
272
+ type: "text";
322
273
  }];
323
274
  })[];
275
+ system?: string | undefined;
324
276
  maxTokens?: number | undefined;
325
277
  temperature?: number | undefined;
326
278
  topP?: number | undefined;
@@ -331,7 +283,6 @@ declare const EdgeRuntimeRequestOptionsSchema: z.ZodObject<z.objectUtil.extendSh
331
283
  apiKey?: string | undefined;
332
284
  baseUrl?: string | undefined;
333
285
  modelName?: string | undefined;
334
- system?: string | undefined;
335
286
  tools?: {
336
287
  type: "function";
337
288
  name: string;
@@ -340,6 +291,55 @@ declare const EdgeRuntimeRequestOptionsSchema: z.ZodObject<z.objectUtil.extendSh
340
291
  }[] | undefined;
341
292
  }>;
342
293
 
294
+ declare const LanguageModelV1CallSettingsSchema: z.ZodObject<{
295
+ maxTokens: z.ZodOptional<z.ZodNumber>;
296
+ temperature: z.ZodOptional<z.ZodNumber>;
297
+ topP: z.ZodOptional<z.ZodNumber>;
298
+ presencePenalty: z.ZodOptional<z.ZodNumber>;
299
+ frequencyPenalty: z.ZodOptional<z.ZodNumber>;
300
+ seed: z.ZodOptional<z.ZodNumber>;
301
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>>;
302
+ }, "strip", z.ZodTypeAny, {
303
+ maxTokens?: number | undefined;
304
+ temperature?: number | undefined;
305
+ topP?: number | undefined;
306
+ presencePenalty?: number | undefined;
307
+ frequencyPenalty?: number | undefined;
308
+ seed?: number | undefined;
309
+ headers?: Record<string, string | undefined> | undefined;
310
+ }, {
311
+ maxTokens?: number | undefined;
312
+ temperature?: number | undefined;
313
+ topP?: number | undefined;
314
+ presencePenalty?: number | undefined;
315
+ frequencyPenalty?: number | undefined;
316
+ seed?: number | undefined;
317
+ headers?: Record<string, string | undefined> | undefined;
318
+ }>;
319
+ type LanguageModelV1CallSettings = z.infer<typeof LanguageModelV1CallSettingsSchema>;
320
+ declare const LanguageModelConfigSchema: z.ZodObject<{
321
+ apiKey: z.ZodOptional<z.ZodString>;
322
+ baseUrl: z.ZodOptional<z.ZodString>;
323
+ modelName: z.ZodOptional<z.ZodString>;
324
+ }, "strip", z.ZodTypeAny, {
325
+ apiKey?: string | undefined;
326
+ baseUrl?: string | undefined;
327
+ modelName?: string | undefined;
328
+ }, {
329
+ apiKey?: string | undefined;
330
+ baseUrl?: string | undefined;
331
+ modelName?: string | undefined;
332
+ }>;
333
+ type LanguageModelConfig = z.infer<typeof LanguageModelConfigSchema>;
334
+ type ToolExecuteFunction<TArgs, TResult> = (args: TArgs, context: {
335
+ abortSignal: AbortSignal;
336
+ }) => TResult | Promise<TResult>;
337
+ type Tool<TArgs extends Record<string, unknown> = Record<string | number, unknown>, TResult = unknown> = {
338
+ description?: string | undefined;
339
+ parameters: z.ZodSchema<TArgs> | JSONSchema7;
340
+ execute?: ToolExecuteFunction<TArgs, TResult>;
341
+ };
342
+
343
343
  type FinishResult = {
344
344
  messages: CoreMessage[];
345
345
  metadata: {
package/dist/edge.d.ts CHANGED
@@ -2,55 +2,6 @@ import { LanguageModelV1LogProbs, LanguageModelV1, LanguageModelV1ToolChoice } f
2
2
  import { JSONSchema7 } from 'json-schema';
3
3
  import { z } from 'zod';
4
4
 
5
- declare const LanguageModelV1CallSettingsSchema: z.ZodObject<{
6
- maxTokens: z.ZodOptional<z.ZodNumber>;
7
- temperature: z.ZodOptional<z.ZodNumber>;
8
- topP: z.ZodOptional<z.ZodNumber>;
9
- presencePenalty: z.ZodOptional<z.ZodNumber>;
10
- frequencyPenalty: z.ZodOptional<z.ZodNumber>;
11
- seed: z.ZodOptional<z.ZodNumber>;
12
- headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>>;
13
- }, "strip", z.ZodTypeAny, {
14
- maxTokens?: number | undefined;
15
- temperature?: number | undefined;
16
- topP?: number | undefined;
17
- presencePenalty?: number | undefined;
18
- frequencyPenalty?: number | undefined;
19
- seed?: number | undefined;
20
- headers?: Record<string, string | undefined> | undefined;
21
- }, {
22
- maxTokens?: number | undefined;
23
- temperature?: number | undefined;
24
- topP?: number | undefined;
25
- presencePenalty?: number | undefined;
26
- frequencyPenalty?: number | undefined;
27
- seed?: number | undefined;
28
- headers?: Record<string, string | undefined> | undefined;
29
- }>;
30
- type LanguageModelV1CallSettings = z.infer<typeof LanguageModelV1CallSettingsSchema>;
31
- declare const LanguageModelConfigSchema: z.ZodObject<{
32
- apiKey: z.ZodOptional<z.ZodString>;
33
- baseUrl: z.ZodOptional<z.ZodString>;
34
- modelName: z.ZodOptional<z.ZodString>;
35
- }, "strip", z.ZodTypeAny, {
36
- apiKey?: string | undefined;
37
- baseUrl?: string | undefined;
38
- modelName?: string | undefined;
39
- }, {
40
- apiKey?: string | undefined;
41
- baseUrl?: string | undefined;
42
- modelName?: string | undefined;
43
- }>;
44
- type LanguageModelConfig = z.infer<typeof LanguageModelConfigSchema>;
45
- type ToolExecuteFunction<TArgs, TResult> = (args: TArgs, context: {
46
- abortSignal: AbortSignal;
47
- }) => TResult | Promise<TResult>;
48
- type Tool<TArgs extends Record<string, unknown> = Record<string | number, unknown>, TResult = unknown> = {
49
- description?: string | undefined;
50
- parameters: z.ZodSchema<TArgs> | JSONSchema7;
51
- execute?: ToolExecuteFunction<TArgs, TResult>;
52
- };
53
-
54
5
  type TextContentPart = {
55
6
  type: "text";
56
7
  text: string;
@@ -99,23 +50,23 @@ declare const EdgeRuntimeRequestOptionsSchema: z.ZodObject<z.objectUtil.extendSh
99
50
  type: z.ZodLiteral<"text">;
100
51
  text: z.ZodString;
101
52
  }, "strip", z.ZodTypeAny, {
102
- type: "text";
103
53
  text: string;
104
- }, {
105
54
  type: "text";
55
+ }, {
106
56
  text: string;
57
+ type: "text";
107
58
  }>], null>;
108
59
  }, "strip", z.ZodTypeAny, {
109
60
  role: "system";
110
61
  content: [{
111
- type: "text";
112
62
  text: string;
63
+ type: "text";
113
64
  }];
114
65
  }, {
115
66
  role: "system";
116
67
  content: [{
117
- type: "text";
118
68
  text: string;
69
+ type: "text";
119
70
  }];
120
71
  }>, z.ZodObject<{
121
72
  role: z.ZodLiteral<"user">;
@@ -123,38 +74,38 @@ declare const EdgeRuntimeRequestOptionsSchema: z.ZodObject<z.objectUtil.extendSh
123
74
  type: z.ZodLiteral<"text">;
124
75
  text: z.ZodString;
125
76
  }, "strip", z.ZodTypeAny, {
126
- type: "text";
127
77
  text: string;
128
- }, {
129
78
  type: "text";
79
+ }, {
130
80
  text: string;
81
+ type: "text";
131
82
  }>, z.ZodObject<{
132
83
  type: z.ZodLiteral<"image">;
133
84
  image: z.ZodString;
134
85
  }, "strip", z.ZodTypeAny, {
135
- type: "image";
136
86
  image: string;
137
- }, {
138
87
  type: "image";
88
+ }, {
139
89
  image: string;
90
+ type: "image";
140
91
  }>]>, "many">;
141
92
  }, "strip", z.ZodTypeAny, {
142
93
  role: "user";
143
94
  content: ({
144
- type: "text";
145
95
  text: string;
96
+ type: "text";
146
97
  } | {
147
- type: "image";
148
98
  image: string;
99
+ type: "image";
149
100
  })[];
150
101
  }, {
151
102
  role: "user";
152
103
  content: ({
153
- type: "text";
154
104
  text: string;
105
+ type: "text";
155
106
  } | {
156
- type: "image";
157
107
  image: string;
108
+ type: "image";
158
109
  })[];
159
110
  }>, z.ZodObject<{
160
111
  role: z.ZodLiteral<"assistant">;
@@ -162,11 +113,11 @@ declare const EdgeRuntimeRequestOptionsSchema: z.ZodObject<z.objectUtil.extendSh
162
113
  type: z.ZodLiteral<"text">;
163
114
  text: z.ZodString;
164
115
  }, "strip", z.ZodTypeAny, {
165
- type: "text";
166
116
  text: string;
167
- }, {
168
117
  type: "text";
118
+ }, {
169
119
  text: string;
120
+ type: "text";
170
121
  }>, z.ZodObject<{
171
122
  type: z.ZodLiteral<"tool-call">;
172
123
  toolCallId: z.ZodString;
@@ -192,8 +143,8 @@ declare const EdgeRuntimeRequestOptionsSchema: z.ZodObject<z.objectUtil.extendSh
192
143
  }, "strip", z.ZodTypeAny, {
193
144
  role: "assistant";
194
145
  content: ({
195
- type: "text";
196
146
  text: string;
147
+ type: "text";
197
148
  } | {
198
149
  type: "tool-call";
199
150
  toolCallId: string;
@@ -205,8 +156,8 @@ declare const EdgeRuntimeRequestOptionsSchema: z.ZodObject<z.objectUtil.extendSh
205
156
  }, {
206
157
  role: "assistant";
207
158
  content: ({
208
- type: "text";
209
159
  text: string;
160
+ type: "text";
210
161
  } | {
211
162
  type: "tool-call";
212
163
  toolCallId: string;
@@ -248,17 +199,17 @@ declare const EdgeRuntimeRequestOptionsSchema: z.ZodObject<z.objectUtil.extendSh
248
199
  messages: ({
249
200
  role: "user";
250
201
  content: ({
251
- type: "text";
252
202
  text: string;
203
+ type: "text";
253
204
  } | {
254
- type: "image";
255
205
  image: string;
206
+ type: "image";
256
207
  })[];
257
208
  } | {
258
209
  role: "assistant";
259
210
  content: ({
260
- type: "text";
261
211
  text: string;
212
+ type: "text";
262
213
  } | {
263
214
  type: "tool-call";
264
215
  toolCallId: string;
@@ -270,10 +221,11 @@ declare const EdgeRuntimeRequestOptionsSchema: z.ZodObject<z.objectUtil.extendSh
270
221
  } | {
271
222
  role: "system";
272
223
  content: [{
273
- type: "text";
274
224
  text: string;
225
+ type: "text";
275
226
  }];
276
227
  })[];
228
+ system?: string | undefined;
277
229
  maxTokens?: number | undefined;
278
230
  temperature?: number | undefined;
279
231
  topP?: number | undefined;
@@ -284,7 +236,6 @@ declare const EdgeRuntimeRequestOptionsSchema: z.ZodObject<z.objectUtil.extendSh
284
236
  apiKey?: string | undefined;
285
237
  baseUrl?: string | undefined;
286
238
  modelName?: string | undefined;
287
- system?: string | undefined;
288
239
  tools?: {
289
240
  type: "function";
290
241
  name: string;
@@ -295,17 +246,17 @@ declare const EdgeRuntimeRequestOptionsSchema: z.ZodObject<z.objectUtil.extendSh
295
246
  messages: ({
296
247
  role: "user";
297
248
  content: ({
298
- type: "text";
299
249
  text: string;
250
+ type: "text";
300
251
  } | {
301
- type: "image";
302
252
  image: string;
253
+ type: "image";
303
254
  })[];
304
255
  } | {
305
256
  role: "assistant";
306
257
  content: ({
307
- type: "text";
308
258
  text: string;
259
+ type: "text";
309
260
  } | {
310
261
  type: "tool-call";
311
262
  toolCallId: string;
@@ -317,10 +268,11 @@ declare const EdgeRuntimeRequestOptionsSchema: z.ZodObject<z.objectUtil.extendSh
317
268
  } | {
318
269
  role: "system";
319
270
  content: [{
320
- type: "text";
321
271
  text: string;
272
+ type: "text";
322
273
  }];
323
274
  })[];
275
+ system?: string | undefined;
324
276
  maxTokens?: number | undefined;
325
277
  temperature?: number | undefined;
326
278
  topP?: number | undefined;
@@ -331,7 +283,6 @@ declare const EdgeRuntimeRequestOptionsSchema: z.ZodObject<z.objectUtil.extendSh
331
283
  apiKey?: string | undefined;
332
284
  baseUrl?: string | undefined;
333
285
  modelName?: string | undefined;
334
- system?: string | undefined;
335
286
  tools?: {
336
287
  type: "function";
337
288
  name: string;
@@ -340,6 +291,55 @@ declare const EdgeRuntimeRequestOptionsSchema: z.ZodObject<z.objectUtil.extendSh
340
291
  }[] | undefined;
341
292
  }>;
342
293
 
294
+ declare const LanguageModelV1CallSettingsSchema: z.ZodObject<{
295
+ maxTokens: z.ZodOptional<z.ZodNumber>;
296
+ temperature: z.ZodOptional<z.ZodNumber>;
297
+ topP: z.ZodOptional<z.ZodNumber>;
298
+ presencePenalty: z.ZodOptional<z.ZodNumber>;
299
+ frequencyPenalty: z.ZodOptional<z.ZodNumber>;
300
+ seed: z.ZodOptional<z.ZodNumber>;
301
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>>;
302
+ }, "strip", z.ZodTypeAny, {
303
+ maxTokens?: number | undefined;
304
+ temperature?: number | undefined;
305
+ topP?: number | undefined;
306
+ presencePenalty?: number | undefined;
307
+ frequencyPenalty?: number | undefined;
308
+ seed?: number | undefined;
309
+ headers?: Record<string, string | undefined> | undefined;
310
+ }, {
311
+ maxTokens?: number | undefined;
312
+ temperature?: number | undefined;
313
+ topP?: number | undefined;
314
+ presencePenalty?: number | undefined;
315
+ frequencyPenalty?: number | undefined;
316
+ seed?: number | undefined;
317
+ headers?: Record<string, string | undefined> | undefined;
318
+ }>;
319
+ type LanguageModelV1CallSettings = z.infer<typeof LanguageModelV1CallSettingsSchema>;
320
+ declare const LanguageModelConfigSchema: z.ZodObject<{
321
+ apiKey: z.ZodOptional<z.ZodString>;
322
+ baseUrl: z.ZodOptional<z.ZodString>;
323
+ modelName: z.ZodOptional<z.ZodString>;
324
+ }, "strip", z.ZodTypeAny, {
325
+ apiKey?: string | undefined;
326
+ baseUrl?: string | undefined;
327
+ modelName?: string | undefined;
328
+ }, {
329
+ apiKey?: string | undefined;
330
+ baseUrl?: string | undefined;
331
+ modelName?: string | undefined;
332
+ }>;
333
+ type LanguageModelConfig = z.infer<typeof LanguageModelConfigSchema>;
334
+ type ToolExecuteFunction<TArgs, TResult> = (args: TArgs, context: {
335
+ abortSignal: AbortSignal;
336
+ }) => TResult | Promise<TResult>;
337
+ type Tool<TArgs extends Record<string, unknown> = Record<string | number, unknown>, TResult = unknown> = {
338
+ description?: string | undefined;
339
+ parameters: z.ZodSchema<TArgs> | JSONSchema7;
340
+ execute?: ToolExecuteFunction<TArgs, TResult>;
341
+ };
342
+
343
343
  type FinishResult = {
344
344
  messages: CoreMessage[];
345
345
  metadata: {
package/dist/edge.js CHANGED
@@ -68,6 +68,7 @@ function assistantEncoderStream() {
68
68
  }
69
69
  // ignore
70
70
  case "tool-call":
71
+ case "response-metadata":
71
72
  break;
72
73
  case "tool-result": {
73
74
  controller.enqueue({
@@ -370,6 +371,7 @@ function toolResultStream(tools, abortSignal) {
370
371
  case "tool-result":
371
372
  case "finish":
372
373
  case "error":
374
+ case "response-metadata":
373
375
  break;
374
376
  default: {
375
377
  const unhandledType = chunkType;
@@ -750,9 +752,9 @@ function runResultStream() {
750
752
  controller.enqueue(message);
751
753
  break;
752
754
  }
753
- case "tool-call": {
755
+ case "tool-call":
756
+ case "response-metadata":
754
757
  break;
755
- }
756
758
  case "tool-result": {
757
759
  message = appendOrUpdateToolResult(
758
760
  message,