ai 3.0.19 → 3.0.21

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 (67) hide show
  1. package/anthropic/dist/index.d.mts +1 -319
  2. package/anthropic/dist/index.d.ts +1 -319
  3. package/anthropic/dist/index.js +44 -216
  4. package/anthropic/dist/index.js.map +1 -1
  5. package/anthropic/dist/index.mjs +32 -200
  6. package/anthropic/dist/index.mjs.map +1 -1
  7. package/dist/index.d.mts +60 -333
  8. package/dist/index.d.ts +60 -333
  9. package/dist/index.js +152 -441
  10. package/dist/index.js.map +1 -1
  11. package/dist/index.mjs +127 -412
  12. package/dist/index.mjs.map +1 -1
  13. package/google/dist/index.d.mts +1 -319
  14. package/google/dist/index.d.ts +1 -319
  15. package/google/dist/index.js +75 -229
  16. package/google/dist/index.js.map +1 -1
  17. package/google/dist/index.mjs +63 -213
  18. package/google/dist/index.mjs.map +1 -1
  19. package/mistral/dist/index.d.mts +1 -319
  20. package/mistral/dist/index.d.ts +1 -319
  21. package/mistral/dist/index.js +32 -205
  22. package/mistral/dist/index.js.map +1 -1
  23. package/mistral/dist/index.mjs +20 -189
  24. package/mistral/dist/index.mjs.map +1 -1
  25. package/openai/dist/index.d.mts +2 -320
  26. package/openai/dist/index.d.ts +2 -320
  27. package/openai/dist/index.js +69 -280
  28. package/openai/dist/index.js.map +1 -1
  29. package/openai/dist/index.mjs +57 -260
  30. package/openai/dist/index.mjs.map +1 -1
  31. package/package.json +4 -10
  32. package/react/dist/index.d.mts +8 -4
  33. package/react/dist/index.d.ts +12 -6
  34. package/react/dist/index.js +23 -105
  35. package/react/dist/index.js.map +1 -1
  36. package/react/dist/index.mjs +22 -105
  37. package/react/dist/index.mjs.map +1 -1
  38. package/react/dist/index.server.d.mts +4 -2
  39. package/react/dist/index.server.d.ts +4 -2
  40. package/react/dist/index.server.js.map +1 -1
  41. package/react/dist/index.server.mjs.map +1 -1
  42. package/rsc/dist/rsc-server.mjs +6 -16
  43. package/rsc/dist/rsc-server.mjs.map +1 -1
  44. package/solid/dist/index.d.mts +1 -1
  45. package/solid/dist/index.d.ts +1 -1
  46. package/solid/dist/index.js +19 -104
  47. package/solid/dist/index.js.map +1 -1
  48. package/solid/dist/index.mjs +19 -104
  49. package/solid/dist/index.mjs.map +1 -1
  50. package/svelte/dist/index.d.mts +1 -1
  51. package/svelte/dist/index.d.ts +1 -1
  52. package/svelte/dist/index.js +19 -104
  53. package/svelte/dist/index.js.map +1 -1
  54. package/svelte/dist/index.mjs +19 -104
  55. package/svelte/dist/index.mjs.map +1 -1
  56. package/vue/dist/index.d.mts +1 -1
  57. package/vue/dist/index.d.ts +1 -1
  58. package/vue/dist/index.js +19 -104
  59. package/vue/dist/index.js.map +1 -1
  60. package/vue/dist/index.mjs +19 -104
  61. package/vue/dist/index.mjs.map +1 -1
  62. package/spec/dist/index.d.mts +0 -752
  63. package/spec/dist/index.d.ts +0 -752
  64. package/spec/dist/index.js +0 -873
  65. package/spec/dist/index.js.map +0 -1
  66. package/spec/dist/index.mjs +0 -807
  67. package/spec/dist/index.mjs.map +0 -1
@@ -1,322 +1,4 @@
1
- import { JSONSchema7 } from 'json-schema';
2
-
3
- /**
4
- A tool has a name, a description, and a set of parameters.
5
-
6
- Note: this is **not** the user-facing tool definition. The AI SDK methods will
7
- map the user-facing tool definitions to this format.
8
- */
9
- type LanguageModelV1FunctionTool = {
10
- /**
11
- The type of the tool. Only functions for now, but this gives us room to
12
- add more specific tool types in the future and use a discriminated union.
13
- */
14
- type: 'function';
15
- /**
16
- The name of the tool. Unique within this model call.
17
- */
18
- name: string;
19
- description?: string;
20
- parameters: JSONSchema7;
21
- };
22
-
23
- type LanguageModelV1CallSettings = {
24
- /**
25
- * Maximum number of tokens to generate.
26
- */
27
- maxTokens?: number;
28
- /**
29
- * Temperature setting. This is a number between 0 (almost no randomness) and
30
- * 1 (very random).
31
- *
32
- * Different LLM providers have different temperature
33
- * scales, so they'd need to map it (without mapping, the same temperature has
34
- * different effects on different models). The provider can also chose to map
35
- * this to topP, potentially even using a custom setting on their model.
36
- *
37
- * Note: This is an example of a setting that requires a clear specification of
38
- * the semantics.
39
- */
40
- temperature?: number;
41
- /**
42
- * Nucleus sampling. This is a number between 0 and 1.
43
- *
44
- * E.g. 0.1 would mean that only tokens with the top 10% probability mass
45
- * are considered.
46
- *
47
- * It is recommended to set either `temperature` or `topP`, but not both.
48
- */
49
- topP?: number;
50
- /**
51
- * Presence penalty setting. It affects the likelihood of the model to
52
- * repeat information that is already in the prompt.
53
- *
54
- * The presence penalty is a number between -1 (increase repetition)
55
- * and 1 (maximum penalty, decrease repetition). 0 means no penalty.
56
- */
57
- presencePenalty?: number;
58
- /**
59
- * Frequency penalty setting. It affects the likelihood of the model
60
- * to repeatedly use the same words or phrases.
61
- *
62
- * The frequency penalty is a number between -1 (increase repetition)
63
- * and 1 (maximum penalty, decrease repetition). 0 means no penalty.
64
- */
65
- frequencyPenalty?: number;
66
- /**
67
- * The seed (integer) to use for random sampling. If set and supported
68
- * by the model, calls will generate deterministic results.
69
- */
70
- seed?: number;
71
- /**
72
- * Abort signal for cancelling the operation.
73
- */
74
- abortSignal?: AbortSignal;
75
- };
76
-
77
- /**
78
- * A prompt is a list of messages.
79
- *
80
- * Note: Not all models and prompt formats support multi-modal inputs and
81
- * tool calls. The validation happens at runtime.
82
- *
83
- * Note: This is not a user-facing prompt. The AI SDK methods will map the
84
- * user-facing prompt types such as chat or instruction prompts to this format.
85
- */
86
- type LanguageModelV1Prompt = Array<LanguageModelV1Message>;
87
- type LanguageModelV1Message = {
88
- role: 'system';
89
- content: string;
90
- } | {
91
- role: 'user';
92
- content: Array<LanguageModelV1TextPart | LanguageModelV1ImagePart>;
93
- } | {
94
- role: 'assistant';
95
- content: Array<LanguageModelV1TextPart | LanguageModelV1ToolCallPart>;
96
- } | {
97
- role: 'tool';
98
- content: Array<LanguageModelV1ToolResultPart>;
99
- };
100
- interface LanguageModelV1TextPart {
101
- type: 'text';
102
- /**
103
- * The text content.
104
- */
105
- text: string;
106
- }
107
- interface LanguageModelV1ImagePart {
108
- type: 'image';
109
- /**
110
- * Image data as a Uint8Array (e.g. from a Blob or Buffer) or a URL.
111
- */
112
- image: Uint8Array | URL;
113
- /**
114
- * Optional mime type of the image.
115
- */
116
- mimeType?: string;
117
- }
118
- interface LanguageModelV1ToolCallPart {
119
- type: 'tool-call';
120
- toolCallId: string;
121
- toolName: string;
122
- args: unknown;
123
- }
124
- interface LanguageModelV1ToolResultPart {
125
- type: 'tool-result';
126
- toolCallId: string;
127
- toolName: string;
128
- result: unknown;
129
- }
130
-
131
- type LanguageModelV1CallOptions = LanguageModelV1CallSettings & {
132
- /**
133
- * Whether the user provided the input as messages or as
134
- * a prompt. This can help guide non-chat models in the
135
- * expansion, bc different expansions can be needed for
136
- * chat/non-chat use cases.
137
- */
138
- inputFormat: 'messages' | 'prompt';
139
- /**
140
- * The mode affects the behavior of the language model. It is required to
141
- * support provider-independent streaming and generation of structured objects.
142
- * The model can take this information and e.g. configure json mode, the correct
143
- * low level grammar, etc. It can also be used to optimize the efficiency of the
144
- * streaming, e.g. tool-delta stream parts are only needed in the
145
- * object-tool mode.
146
- */
147
- mode: {
148
- type: 'regular';
149
- tools?: Array<LanguageModelV1FunctionTool>;
150
- } | {
151
- type: 'object-json';
152
- } | {
153
- type: 'object-grammar';
154
- schema: JSONSchema7;
155
- } | {
156
- type: 'object-tool';
157
- tool: LanguageModelV1FunctionTool;
158
- };
159
- /**
160
- * A language mode prompt is a standardized prompt type.
161
- *
162
- * Note: This is **not** the user-facing prompt. The AI SDK methods will map the
163
- * user-facing prompt types such as chat or instruction prompts to this format.
164
- * That approach allows us to evolve the user facing prompts without breaking
165
- * the language model interface.
166
- */
167
- prompt: LanguageModelV1Prompt;
168
- };
169
-
170
- /**
171
- * Warning from the model provider for this call. The call will proceed, but e.g.
172
- * some settings might not be supported, which can lead to suboptimal results.
173
- */
174
- type LanguageModelV1CallWarning = {
175
- type: 'unsupported-setting';
176
- setting: keyof LanguageModelV1CallSettings;
177
- } | {
178
- type: 'other';
179
- message: string;
180
- };
181
-
182
- type LanguageModelV1FinishReason = 'stop' | 'length' | 'content-filter' | 'tool-calls' | 'error' | 'other';
183
-
184
- type LanguageModelV1FunctionToolCall = {
185
- toolCallType: 'function';
186
- toolCallId: string;
187
- toolName: string;
188
- /**
189
- * Stringified JSON object with the tool call arguments. Must match the
190
- * parameters schema of the tool.
191
- */
192
- args: string;
193
- };
194
-
195
- /**
196
- * Experimental: Specification for a language model that implements the language model
197
- * interface version 1.
198
- */
199
- type LanguageModelV1 = {
200
- /**
201
- * The language model must specify which language model interface
202
- * version it implements. This will allow us to evolve the language
203
- * model interface and retain backwards compatibility. The different
204
- * implementation versions can be handled as a discriminated union
205
- * on our side.
206
- */
207
- readonly specificationVersion: 'v1';
208
- /**
209
- * Name of the provider for logging purposes.
210
- */
211
- readonly provider: string;
212
- /**
213
- * Provider-specific model ID for logging purposes.
214
- */
215
- readonly modelId: string;
216
- /**
217
- * Default object generation mode that should be used with this model when
218
- * no mode is specified. Should be the mode with the best results for this
219
- * model. `undefined` can be returned if object generation is not supported.
220
- *
221
- * This is needed to generate the best objects possible w/o requiring the
222
- * user to explicitly specify the object generation mode.
223
- */
224
- readonly defaultObjectGenerationMode: 'json' | 'tool' | 'grammar' | undefined;
225
- /**
226
- * Generates a language model output (non-streaming).
227
- *
228
- * Naming: "do" prefix to prevent accidental direct usage of the method
229
- * by the user.
230
- */
231
- doGenerate(options: LanguageModelV1CallOptions): PromiseLike<{
232
- /**
233
- * Text that the model has generated. Can be undefined if the model
234
- * has only generated tool calls.
235
- */
236
- text?: string;
237
- /**
238
- * Tool calls that the model has generated. Can be undefined if the
239
- * model has only generated text.
240
- */
241
- toolCalls?: Array<LanguageModelV1FunctionToolCall>;
242
- /**
243
- * Finish reason.
244
- */
245
- finishReason: LanguageModelV1FinishReason;
246
- /**
247
- * Usage information.
248
- */
249
- usage: {
250
- promptTokens: number;
251
- completionTokens: number;
252
- };
253
- /**
254
- * Raw prompt and setting information for observability provider integration.
255
- */
256
- rawCall: {
257
- /**
258
- * Raw prompt after expansion and conversion to the format that the
259
- * provider uses to send the information to their API.
260
- */
261
- rawPrompt: unknown;
262
- /**
263
- * Raw settings that are used for the API call. Includes provider-specific
264
- * settings.
265
- */
266
- rawSettings: Record<string, unknown>;
267
- };
268
- warnings?: LanguageModelV1CallWarning[];
269
- }>;
270
- /**
271
- * Generates a language model output (streaming).
272
- *
273
- * Naming: "do" prefix to prevent accidental direct usage of the method
274
- * by the user.
275
- *
276
- * @return A stream of higher-level language model output parts.
277
- */
278
- doStream(options: LanguageModelV1CallOptions): PromiseLike<{
279
- stream: ReadableStream<LanguageModelV1StreamPart>;
280
- /**
281
- * Raw prompt and setting information for observability provider integration.
282
- */
283
- rawCall: {
284
- /**
285
- * Raw prompt after expansion and conversion to the format that the
286
- * provider uses to send the information to their API.
287
- */
288
- rawPrompt: unknown;
289
- /**
290
- * Raw settings that are used for the API call. Includes provider-specific
291
- * settings.
292
- */
293
- rawSettings: Record<string, unknown>;
294
- };
295
- warnings?: LanguageModelV1CallWarning[];
296
- }>;
297
- };
298
- type LanguageModelV1StreamPart = {
299
- type: 'text-delta';
300
- textDelta: string;
301
- } | ({
302
- type: 'tool-call';
303
- } & LanguageModelV1FunctionToolCall) | {
304
- type: 'tool-call-delta';
305
- toolCallType: 'function';
306
- toolCallId: string;
307
- toolName: string;
308
- argsTextDelta: string;
309
- } | {
310
- type: 'finish';
311
- finishReason: LanguageModelV1FinishReason;
312
- usage: {
313
- promptTokens: number;
314
- completionTokens: number;
315
- };
316
- } | {
317
- type: 'error';
318
- error: unknown;
319
- };
1
+ import { LanguageModelV1 } from '@ai-sdk/provider';
320
2
 
321
3
  type AnthropicMessagesModelId = 'claude-3-opus-20240229' | 'claude-3-sonnet-20240229' | 'claude-3-haiku-20240307' | (string & {});
322
4
  interface AnthropicMessagesSettings {
@@ -1,322 +1,4 @@
1
- import { JSONSchema7 } from 'json-schema';
2
-
3
- /**
4
- A tool has a name, a description, and a set of parameters.
5
-
6
- Note: this is **not** the user-facing tool definition. The AI SDK methods will
7
- map the user-facing tool definitions to this format.
8
- */
9
- type LanguageModelV1FunctionTool = {
10
- /**
11
- The type of the tool. Only functions for now, but this gives us room to
12
- add more specific tool types in the future and use a discriminated union.
13
- */
14
- type: 'function';
15
- /**
16
- The name of the tool. Unique within this model call.
17
- */
18
- name: string;
19
- description?: string;
20
- parameters: JSONSchema7;
21
- };
22
-
23
- type LanguageModelV1CallSettings = {
24
- /**
25
- * Maximum number of tokens to generate.
26
- */
27
- maxTokens?: number;
28
- /**
29
- * Temperature setting. This is a number between 0 (almost no randomness) and
30
- * 1 (very random).
31
- *
32
- * Different LLM providers have different temperature
33
- * scales, so they'd need to map it (without mapping, the same temperature has
34
- * different effects on different models). The provider can also chose to map
35
- * this to topP, potentially even using a custom setting on their model.
36
- *
37
- * Note: This is an example of a setting that requires a clear specification of
38
- * the semantics.
39
- */
40
- temperature?: number;
41
- /**
42
- * Nucleus sampling. This is a number between 0 and 1.
43
- *
44
- * E.g. 0.1 would mean that only tokens with the top 10% probability mass
45
- * are considered.
46
- *
47
- * It is recommended to set either `temperature` or `topP`, but not both.
48
- */
49
- topP?: number;
50
- /**
51
- * Presence penalty setting. It affects the likelihood of the model to
52
- * repeat information that is already in the prompt.
53
- *
54
- * The presence penalty is a number between -1 (increase repetition)
55
- * and 1 (maximum penalty, decrease repetition). 0 means no penalty.
56
- */
57
- presencePenalty?: number;
58
- /**
59
- * Frequency penalty setting. It affects the likelihood of the model
60
- * to repeatedly use the same words or phrases.
61
- *
62
- * The frequency penalty is a number between -1 (increase repetition)
63
- * and 1 (maximum penalty, decrease repetition). 0 means no penalty.
64
- */
65
- frequencyPenalty?: number;
66
- /**
67
- * The seed (integer) to use for random sampling. If set and supported
68
- * by the model, calls will generate deterministic results.
69
- */
70
- seed?: number;
71
- /**
72
- * Abort signal for cancelling the operation.
73
- */
74
- abortSignal?: AbortSignal;
75
- };
76
-
77
- /**
78
- * A prompt is a list of messages.
79
- *
80
- * Note: Not all models and prompt formats support multi-modal inputs and
81
- * tool calls. The validation happens at runtime.
82
- *
83
- * Note: This is not a user-facing prompt. The AI SDK methods will map the
84
- * user-facing prompt types such as chat or instruction prompts to this format.
85
- */
86
- type LanguageModelV1Prompt = Array<LanguageModelV1Message>;
87
- type LanguageModelV1Message = {
88
- role: 'system';
89
- content: string;
90
- } | {
91
- role: 'user';
92
- content: Array<LanguageModelV1TextPart | LanguageModelV1ImagePart>;
93
- } | {
94
- role: 'assistant';
95
- content: Array<LanguageModelV1TextPart | LanguageModelV1ToolCallPart>;
96
- } | {
97
- role: 'tool';
98
- content: Array<LanguageModelV1ToolResultPart>;
99
- };
100
- interface LanguageModelV1TextPart {
101
- type: 'text';
102
- /**
103
- * The text content.
104
- */
105
- text: string;
106
- }
107
- interface LanguageModelV1ImagePart {
108
- type: 'image';
109
- /**
110
- * Image data as a Uint8Array (e.g. from a Blob or Buffer) or a URL.
111
- */
112
- image: Uint8Array | URL;
113
- /**
114
- * Optional mime type of the image.
115
- */
116
- mimeType?: string;
117
- }
118
- interface LanguageModelV1ToolCallPart {
119
- type: 'tool-call';
120
- toolCallId: string;
121
- toolName: string;
122
- args: unknown;
123
- }
124
- interface LanguageModelV1ToolResultPart {
125
- type: 'tool-result';
126
- toolCallId: string;
127
- toolName: string;
128
- result: unknown;
129
- }
130
-
131
- type LanguageModelV1CallOptions = LanguageModelV1CallSettings & {
132
- /**
133
- * Whether the user provided the input as messages or as
134
- * a prompt. This can help guide non-chat models in the
135
- * expansion, bc different expansions can be needed for
136
- * chat/non-chat use cases.
137
- */
138
- inputFormat: 'messages' | 'prompt';
139
- /**
140
- * The mode affects the behavior of the language model. It is required to
141
- * support provider-independent streaming and generation of structured objects.
142
- * The model can take this information and e.g. configure json mode, the correct
143
- * low level grammar, etc. It can also be used to optimize the efficiency of the
144
- * streaming, e.g. tool-delta stream parts are only needed in the
145
- * object-tool mode.
146
- */
147
- mode: {
148
- type: 'regular';
149
- tools?: Array<LanguageModelV1FunctionTool>;
150
- } | {
151
- type: 'object-json';
152
- } | {
153
- type: 'object-grammar';
154
- schema: JSONSchema7;
155
- } | {
156
- type: 'object-tool';
157
- tool: LanguageModelV1FunctionTool;
158
- };
159
- /**
160
- * A language mode prompt is a standardized prompt type.
161
- *
162
- * Note: This is **not** the user-facing prompt. The AI SDK methods will map the
163
- * user-facing prompt types such as chat or instruction prompts to this format.
164
- * That approach allows us to evolve the user facing prompts without breaking
165
- * the language model interface.
166
- */
167
- prompt: LanguageModelV1Prompt;
168
- };
169
-
170
- /**
171
- * Warning from the model provider for this call. The call will proceed, but e.g.
172
- * some settings might not be supported, which can lead to suboptimal results.
173
- */
174
- type LanguageModelV1CallWarning = {
175
- type: 'unsupported-setting';
176
- setting: keyof LanguageModelV1CallSettings;
177
- } | {
178
- type: 'other';
179
- message: string;
180
- };
181
-
182
- type LanguageModelV1FinishReason = 'stop' | 'length' | 'content-filter' | 'tool-calls' | 'error' | 'other';
183
-
184
- type LanguageModelV1FunctionToolCall = {
185
- toolCallType: 'function';
186
- toolCallId: string;
187
- toolName: string;
188
- /**
189
- * Stringified JSON object with the tool call arguments. Must match the
190
- * parameters schema of the tool.
191
- */
192
- args: string;
193
- };
194
-
195
- /**
196
- * Experimental: Specification for a language model that implements the language model
197
- * interface version 1.
198
- */
199
- type LanguageModelV1 = {
200
- /**
201
- * The language model must specify which language model interface
202
- * version it implements. This will allow us to evolve the language
203
- * model interface and retain backwards compatibility. The different
204
- * implementation versions can be handled as a discriminated union
205
- * on our side.
206
- */
207
- readonly specificationVersion: 'v1';
208
- /**
209
- * Name of the provider for logging purposes.
210
- */
211
- readonly provider: string;
212
- /**
213
- * Provider-specific model ID for logging purposes.
214
- */
215
- readonly modelId: string;
216
- /**
217
- * Default object generation mode that should be used with this model when
218
- * no mode is specified. Should be the mode with the best results for this
219
- * model. `undefined` can be returned if object generation is not supported.
220
- *
221
- * This is needed to generate the best objects possible w/o requiring the
222
- * user to explicitly specify the object generation mode.
223
- */
224
- readonly defaultObjectGenerationMode: 'json' | 'tool' | 'grammar' | undefined;
225
- /**
226
- * Generates a language model output (non-streaming).
227
- *
228
- * Naming: "do" prefix to prevent accidental direct usage of the method
229
- * by the user.
230
- */
231
- doGenerate(options: LanguageModelV1CallOptions): PromiseLike<{
232
- /**
233
- * Text that the model has generated. Can be undefined if the model
234
- * has only generated tool calls.
235
- */
236
- text?: string;
237
- /**
238
- * Tool calls that the model has generated. Can be undefined if the
239
- * model has only generated text.
240
- */
241
- toolCalls?: Array<LanguageModelV1FunctionToolCall>;
242
- /**
243
- * Finish reason.
244
- */
245
- finishReason: LanguageModelV1FinishReason;
246
- /**
247
- * Usage information.
248
- */
249
- usage: {
250
- promptTokens: number;
251
- completionTokens: number;
252
- };
253
- /**
254
- * Raw prompt and setting information for observability provider integration.
255
- */
256
- rawCall: {
257
- /**
258
- * Raw prompt after expansion and conversion to the format that the
259
- * provider uses to send the information to their API.
260
- */
261
- rawPrompt: unknown;
262
- /**
263
- * Raw settings that are used for the API call. Includes provider-specific
264
- * settings.
265
- */
266
- rawSettings: Record<string, unknown>;
267
- };
268
- warnings?: LanguageModelV1CallWarning[];
269
- }>;
270
- /**
271
- * Generates a language model output (streaming).
272
- *
273
- * Naming: "do" prefix to prevent accidental direct usage of the method
274
- * by the user.
275
- *
276
- * @return A stream of higher-level language model output parts.
277
- */
278
- doStream(options: LanguageModelV1CallOptions): PromiseLike<{
279
- stream: ReadableStream<LanguageModelV1StreamPart>;
280
- /**
281
- * Raw prompt and setting information for observability provider integration.
282
- */
283
- rawCall: {
284
- /**
285
- * Raw prompt after expansion and conversion to the format that the
286
- * provider uses to send the information to their API.
287
- */
288
- rawPrompt: unknown;
289
- /**
290
- * Raw settings that are used for the API call. Includes provider-specific
291
- * settings.
292
- */
293
- rawSettings: Record<string, unknown>;
294
- };
295
- warnings?: LanguageModelV1CallWarning[];
296
- }>;
297
- };
298
- type LanguageModelV1StreamPart = {
299
- type: 'text-delta';
300
- textDelta: string;
301
- } | ({
302
- type: 'tool-call';
303
- } & LanguageModelV1FunctionToolCall) | {
304
- type: 'tool-call-delta';
305
- toolCallType: 'function';
306
- toolCallId: string;
307
- toolName: string;
308
- argsTextDelta: string;
309
- } | {
310
- type: 'finish';
311
- finishReason: LanguageModelV1FinishReason;
312
- usage: {
313
- promptTokens: number;
314
- completionTokens: number;
315
- };
316
- } | {
317
- type: 'error';
318
- error: unknown;
319
- };
1
+ import { LanguageModelV1 } from '@ai-sdk/provider';
320
2
 
321
3
  type AnthropicMessagesModelId = 'claude-3-opus-20240229' | 'claude-3-sonnet-20240229' | 'claude-3-haiku-20240307' | (string & {});
322
4
  interface AnthropicMessagesSettings {