@anthropic-ai/sdk 0.10.1 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +9 -9
  3. package/error.d.ts.map +1 -1
  4. package/error.js +2 -1
  5. package/error.js.map +1 -1
  6. package/error.mjs +2 -1
  7. package/error.mjs.map +1 -1
  8. package/index.d.mts +9 -5
  9. package/index.d.ts +9 -5
  10. package/index.d.ts.map +1 -1
  11. package/index.js +7 -5
  12. package/index.js.map +1 -1
  13. package/index.mjs +7 -5
  14. package/index.mjs.map +1 -1
  15. package/lib/MessageStream.d.ts +94 -0
  16. package/lib/MessageStream.d.ts.map +1 -0
  17. package/lib/MessageStream.js +421 -0
  18. package/lib/MessageStream.js.map +1 -0
  19. package/lib/MessageStream.mjs +417 -0
  20. package/lib/MessageStream.mjs.map +1 -0
  21. package/package.json +3 -2
  22. package/resources/beta/beta.d.ts +25 -0
  23. package/resources/beta/beta.d.ts.map +1 -0
  24. package/resources/beta/beta.js +40 -0
  25. package/resources/beta/beta.js.map +1 -0
  26. package/resources/beta/beta.mjs +13 -0
  27. package/resources/beta/beta.mjs.map +1 -0
  28. package/resources/beta/index.d.ts +3 -0
  29. package/resources/beta/index.d.ts.map +1 -0
  30. package/resources/beta/index.js +9 -0
  31. package/resources/beta/index.js.map +1 -0
  32. package/resources/beta/index.mjs +4 -0
  33. package/resources/beta/index.mjs.map +1 -0
  34. package/resources/beta/messages.d.ts +511 -0
  35. package/resources/beta/messages.d.ts.map +1 -0
  36. package/resources/beta/messages.js +35 -0
  37. package/resources/beta/messages.js.map +1 -0
  38. package/resources/beta/messages.mjs +30 -0
  39. package/resources/beta/messages.mjs.map +1 -0
  40. package/resources/completions.d.ts +55 -40
  41. package/resources/completions.d.ts.map +1 -1
  42. package/resources/completions.js +4 -2
  43. package/resources/completions.js.map +1 -1
  44. package/resources/completions.mjs +4 -2
  45. package/resources/completions.mjs.map +1 -1
  46. package/resources/index.d.ts +1 -0
  47. package/resources/index.d.ts.map +1 -1
  48. package/resources/index.js +3 -1
  49. package/resources/index.js.map +1 -1
  50. package/resources/index.mjs +1 -0
  51. package/resources/index.mjs.map +1 -1
  52. package/src/error.ts +2 -1
  53. package/src/index.ts +11 -5
  54. package/src/lib/MessageStream.ts +515 -0
  55. package/src/resources/beta/beta.ts +28 -0
  56. package/src/resources/beta/index.ts +22 -0
  57. package/src/resources/beta/messages.ts +605 -0
  58. package/src/resources/completions.ts +62 -42
  59. package/src/resources/index.ts +1 -0
  60. package/src/streaming.ts +21 -1
  61. package/src/uploads.ts +2 -3
  62. package/src/version.ts +1 -1
  63. package/streaming.d.ts.map +1 -1
  64. package/streaming.js +15 -0
  65. package/streaming.js.map +1 -1
  66. package/streaming.mjs +15 -0
  67. package/streaming.mjs.map +1 -1
  68. package/uploads.d.ts.map +1 -1
  69. package/uploads.js +2 -1
  70. package/uploads.js.map +1 -1
  71. package/uploads.mjs +2 -1
  72. package/uploads.mjs.map +1 -1
  73. package/version.d.ts +1 -1
  74. package/version.js +1 -1
  75. package/version.mjs +1 -1
@@ -0,0 +1,605 @@
1
+ // File generated from our OpenAPI spec by Stainless.
2
+
3
+ import * as Core from "../../core";
4
+ import { APIPromise } from "../../core";
5
+ import { APIResource } from "../../resource";
6
+ import { MessageStream } from "../../lib/MessageStream";
7
+ export { MessageStream } from "../../lib/MessageStream";
8
+ import * as MessagesAPI from "./messages";
9
+ import { Stream } from "../../streaming";
10
+
11
+ export class Messages extends APIResource {
12
+ /**
13
+ * Create a Message.
14
+ *
15
+ * The Messages API is currently in beta.
16
+ */
17
+ create(params: MessageCreateParamsNonStreaming, options?: Core.RequestOptions): APIPromise<Message>;
18
+ create(
19
+ params: MessageCreateParamsStreaming,
20
+ options?: Core.RequestOptions,
21
+ ): APIPromise<Stream<MessageStreamEvent>>;
22
+ create(
23
+ params: MessageCreateParamsBase,
24
+ options?: Core.RequestOptions,
25
+ ): APIPromise<Stream<MessageStreamEvent> | Message>;
26
+ create(
27
+ params: MessageCreateParams,
28
+ options?: Core.RequestOptions,
29
+ ): APIPromise<Message> | APIPromise<Stream<MessageStreamEvent>> {
30
+ const { 'anthropic-beta': anthropicBeta, 'x-api-key': xAPIKey, ...body } = params;
31
+ return this._client.post('/v1/messages', {
32
+ body,
33
+ timeout: 600000,
34
+ ...options,
35
+ headers: {
36
+ 'Anthropic-Beta': 'messages-2023-12-15',
37
+ 'anthropic-beta': anthropicBeta,
38
+ 'x-api-key': xAPIKey || '',
39
+ ...options?.headers,
40
+ },
41
+ stream: params.stream ?? false,
42
+ }) as APIPromise<Message> | APIPromise<Stream<MessageStreamEvent>>;
43
+ }
44
+
45
+ /**
46
+ * Create a Message stream
47
+ */
48
+ stream(body: MessageStreamParams, options?: Core.RequestOptions): MessageStream {
49
+ return MessageStream.createMessage(this._client.beta.messages, body, options);
50
+ }
51
+ }
52
+
53
+ export interface ContentBlock {
54
+ text: string;
55
+
56
+ type: 'text';
57
+ }
58
+
59
+ export interface ContentBlockDeltaEvent {
60
+ delta: TextDelta;
61
+
62
+ index: number;
63
+
64
+ type: 'content_block_delta';
65
+ }
66
+
67
+ export interface ContentBlockStartEvent {
68
+ content_block: ContentBlock;
69
+
70
+ index: number;
71
+
72
+ type: 'content_block_start';
73
+ }
74
+
75
+ export interface ContentBlockStopEvent {
76
+ index: number;
77
+
78
+ type: 'content_block_stop';
79
+ }
80
+
81
+ export interface Message {
82
+ /**
83
+ * Unique object identifier.
84
+ *
85
+ * The format and length of IDs may change over time.
86
+ */
87
+ id: string;
88
+
89
+ /**
90
+ * Content generated by the model.
91
+ *
92
+ * This is an array of content blocks, each of which has a `type` that determines
93
+ * its shape. Currently, the only `type` available is `"text"`.
94
+ *
95
+ * Example:
96
+ *
97
+ * ```json
98
+ * [{ "type": "text", "text": "Hi, I'm Claude." }]
99
+ * ```
100
+ *
101
+ * If the request input `messages` ended with an `assistant` turn, then the
102
+ * response `content` will continue directly from that last turn. You can use this
103
+ * to constrain the model's output.
104
+ *
105
+ * For example, if the input `messages` were:
106
+ *
107
+ * ```json
108
+ * [
109
+ * {
110
+ * "role": "user",
111
+ * "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
112
+ * },
113
+ * {
114
+ * "role": "assistant",
115
+ * "content": "The best answer is ("
116
+ * }
117
+ * ]
118
+ * ```
119
+ *
120
+ * Then the response `content` might be:
121
+ *
122
+ * ```json
123
+ * [{ "type": "text", "text": "B)" }]
124
+ * ```
125
+ */
126
+ content: Array<ContentBlock>;
127
+
128
+ /**
129
+ * The model that handled the request.
130
+ */
131
+ model: string;
132
+
133
+ /**
134
+ * Conversational role of the generated message.
135
+ *
136
+ * This will always be `"assistant"`.
137
+ */
138
+ role: 'assistant';
139
+
140
+ /**
141
+ * The reason that we stopped.
142
+ *
143
+ * This may be one the following values:
144
+ *
145
+ * - `"end_turn"`: the model reached a natural stopping point
146
+ * - `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
147
+ * - `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
148
+ *
149
+ * Note that these values are different than those in `/v1/complete`, where
150
+ * `end_turn` and `stop_sequence` were not differentiated.
151
+ *
152
+ * In non-streaming mode this value is always non-null. In streaming mode, it is
153
+ * null in the `message_start` event and non-null otherwise.
154
+ */
155
+ stop_reason: 'end_turn' | 'max_tokens' | 'stop_sequence' | null;
156
+
157
+ /**
158
+ * Which custom stop sequence was generated.
159
+ *
160
+ * This value will be non-null if one of your custom stop sequences was generated.
161
+ */
162
+ stop_sequence: string | null;
163
+
164
+ type: 'message';
165
+ }
166
+
167
+ export interface MessageDeltaEvent {
168
+ delta: MessageDeltaEvent.Delta;
169
+
170
+ type: 'message_delta';
171
+ }
172
+
173
+ export namespace MessageDeltaEvent {
174
+ export interface Delta {
175
+ stop_reason: 'end_turn' | 'max_tokens' | 'stop_sequence' | null;
176
+
177
+ stop_sequence: string | null;
178
+ }
179
+ }
180
+
181
+ export interface MessageParam {
182
+ content: string | Array<TextBlock>;
183
+
184
+ role: 'user' | 'assistant';
185
+ }
186
+
187
+ export interface MessageStartEvent {
188
+ message: Message;
189
+
190
+ type: 'message_start';
191
+ }
192
+
193
+ export interface MessageStopEvent {
194
+ type: 'message_stop';
195
+ }
196
+
197
+ export type MessageStreamEvent =
198
+ | MessageStartEvent
199
+ | MessageDeltaEvent
200
+ | MessageStopEvent
201
+ | ContentBlockStartEvent
202
+ | ContentBlockDeltaEvent
203
+ | ContentBlockStopEvent;
204
+
205
+ export interface TextBlock {
206
+ text: string;
207
+
208
+ type?: 'text';
209
+ }
210
+
211
+ export interface TextDelta {
212
+ text: string;
213
+
214
+ type: 'text_delta';
215
+ }
216
+
217
+ export type MessageCreateParams = MessageCreateParamsNonStreaming | MessageCreateParamsStreaming;
218
+
219
+ export interface MessageCreateParamsBase {
220
+ /**
221
+ * Body param: The maximum number of tokens to generate before stopping.
222
+ *
223
+ * Note that our models may stop _before_ reaching this maximum. This parameter
224
+ * only specifies the absolute maximum number of tokens to generate.
225
+ *
226
+ * Different models have different maximum values for this parameter. See
227
+ * [input and output sizes](https://docs.anthropic.com/claude/reference/input-and-output-sizes)
228
+ * for details.
229
+ */
230
+ max_tokens: number;
231
+
232
+ /**
233
+ * Body param: Input messages.
234
+ *
235
+ * Our models are trained to operate on alternating `user` and `assistant`
236
+ * conversational turns. When creating a new `Message`, you specify the prior
237
+ * conversational turns with the `messages` parameter, and the model then generates
238
+ * the next `Message` in the conversation.
239
+ *
240
+ * Each input message must be an object with a `role` and `content`. You can
241
+ * specify a single `user`-role message, or you can include multiple `user` and
242
+ * `assistant` messages. The first message must always use the `user` role.
243
+ *
244
+ * If the final message uses the `assistant` role, the response content will
245
+ * continue immediately from the content in that message. This can be used to
246
+ * constrain part of the model's response.
247
+ *
248
+ * Example with a single `user` message:
249
+ *
250
+ * ```json
251
+ * [{ "role": "user", "content": "Hello, Claude" }]
252
+ * ```
253
+ *
254
+ * Example with multiple conversational turns:
255
+ *
256
+ * ```json
257
+ * [
258
+ * { "role": "user", "content": "Hello there." },
259
+ * { "role": "assistant", "content": "Hi, I'm Claude. How can I help you?" },
260
+ * { "role": "user", "content": "Can you explain LLMs in plain English?" }
261
+ * ]
262
+ * ```
263
+ *
264
+ * Example with a partially-filled response from Claude:
265
+ *
266
+ * ```json
267
+ * [
268
+ * { "role": "user", "content": "Please describe yourself using only JSON" },
269
+ * { "role": "assistant", "content": "Here is my JSON description:\n{" }
270
+ * ]
271
+ * ```
272
+ *
273
+ * Each input message `content` may be either a single `string` or an array of
274
+ * content blocks, where each block has a specific `type`. Using a `string` is
275
+ * shorthand for an array of one content block of type `"text"`. The following
276
+ * input messages are equivalent:
277
+ *
278
+ * ```json
279
+ * { "role": "user", "content": "Hello, Claude" }
280
+ * ```
281
+ *
282
+ * ```json
283
+ * { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
284
+ * ```
285
+ *
286
+ * During beta, the Messages API only accepts content blocks of type `"text"`, and
287
+ * at most one block per message.
288
+ *
289
+ * See our
290
+ * [guide to prompt design](https://docs.anthropic.com/claude/docs/introduction-to-prompt-design)
291
+ * for more details on how to best construct prompts.
292
+ */
293
+ messages: Array<MessageParam>;
294
+
295
+ /**
296
+ * Body param: The model that will complete your prompt.
297
+ *
298
+ * As we improve Claude, we develop new versions of it that you can query. The
299
+ * `model` parameter controls which version of Claude responds to your request.
300
+ * Right now we offer two model families: Claude, and Claude Instant. You can use
301
+ * them by setting `model` to `"claude-2.1"` or `"claude-instant-1.2"`,
302
+ * respectively.
303
+ *
304
+ * See [models](https://docs.anthropic.com/claude/reference/selecting-a-model) for
305
+ * additional details and options.
306
+ */
307
+ model: string;
308
+
309
+ /**
310
+ * Header param: Beta version header.
311
+ *
312
+ * During the beta, the Messages API requires sending the
313
+ * `anthropic-beta: messages-2023-12-15` header. This is a beta-specific header
314
+ * that is required in addition to the normal `anthropic-version` header. If you
315
+ * are using our SDKs, both of these headers will be sent automatically.
316
+ */
317
+ 'anthropic-beta': string;
318
+
319
+ /**
320
+ * Body param: An object describing metadata about the request.
321
+ */
322
+ metadata?: MessageCreateParams.Metadata;
323
+
324
+ /**
325
+ * Body param: Custom text sequences that will cause the model to stop generating.
326
+ *
327
+ * Our models will normally stop when they have naturally completed their turn,
328
+ * which will result in a response `stop_reason` of `"end_turn"`.
329
+ *
330
+ * If you want the model to stop generating when it encounters custom strings of
331
+ * text, you can use the `stop_sequences` parameter. If the model encounters one of
332
+ * the custom sequences, the response `stop_reason` value will be `"stop_sequence"`
333
+ * and the response `stop_sequence` value will contain the matched stop sequence.
334
+ */
335
+ stop_sequences?: Array<string>;
336
+
337
+ /**
338
+ * Body param: Whether to incrementally stream the response using server-sent
339
+ * events.
340
+ *
341
+ * See [streaming](https://docs.anthropic.com/claude/reference/streaming) for
342
+ * details.
343
+ */
344
+ stream?: boolean;
345
+
346
+ /**
347
+ * Body param: System prompt.
348
+ *
349
+ * A system prompt is a way of providing context and instructions to Claude, such
350
+ * as specifying a particular goal or role. See our
351
+ * [guide to system prompts](https://docs.anthropic.com/claude/docs/how-to-use-system-prompts).
352
+ */
353
+ system?: string;
354
+
355
+ /**
356
+ * Body param: Amount of randomness injected into the response.
357
+ *
358
+ * Defaults to 1. Ranges from 0 to 1. Use temp closer to 0 for analytical /
359
+ * multiple choice, and closer to 1 for creative and generative tasks.
360
+ */
361
+ temperature?: number;
362
+
363
+ /**
364
+ * Body param: Only sample from the top K options for each subsequent token.
365
+ *
366
+ * Used to remove "long tail" low probability responses.
367
+ * [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
368
+ */
369
+ top_k?: number;
370
+
371
+ /**
372
+ * Body param: Use nucleus sampling.
373
+ *
374
+ * In nucleus sampling, we compute the cumulative distribution over all the options
375
+ * for each subsequent token in decreasing probability order and cut it off once it
376
+ * reaches a particular probability specified by `top_p`. You should either alter
377
+ * `temperature` or `top_p`, but not both.
378
+ */
379
+ top_p?: number;
380
+
381
+ /**
382
+ * Header param:
383
+ */
384
+ 'x-api-key'?: string;
385
+ }
386
+
387
+ export namespace MessageCreateParams {
388
+ /**
389
+ * An object describing metadata about the request.
390
+ */
391
+ export interface Metadata {
392
+ /**
393
+ * An external identifier for the user who is associated with the request.
394
+ *
395
+ * This should be a uuid, hash value, or other opaque identifier. Anthropic may use
396
+ * this id to help detect abuse. Do not include any identifying information such as
397
+ * name, email address, or phone number.
398
+ */
399
+ user_id?: string;
400
+ }
401
+
402
+ export type MessageCreateParamsNonStreaming = MessagesAPI.MessageCreateParamsNonStreaming;
403
+ export type MessageCreateParamsStreaming = MessagesAPI.MessageCreateParamsStreaming;
404
+ }
405
+
406
+ export interface MessageCreateParamsNonStreaming extends MessageCreateParamsBase {
407
+ /**
408
+ * Body param: Whether to incrementally stream the response using server-sent
409
+ * events.
410
+ *
411
+ * See [streaming](https://docs.anthropic.com/claude/reference/streaming) for
412
+ * details.
413
+ */
414
+ stream?: false;
415
+ }
416
+
417
+ export interface MessageCreateParamsStreaming extends MessageCreateParamsBase {
418
+ /**
419
+ * Body param: Whether to incrementally stream the response using server-sent
420
+ * events.
421
+ *
422
+ * See [streaming](https://docs.anthropic.com/claude/reference/streaming) for
423
+ * details.
424
+ */
425
+ stream: true;
426
+ }
427
+
428
+ export interface MessageStreamParams {
429
+ /**
430
+ * The maximum number of tokens to generate before stopping.
431
+ *
432
+ * Note that our models may stop _before_ reaching this maximum. This parameter
433
+ * only specifies the absolute maximum number of tokens to generate.
434
+ *
435
+ * Different models have different maximum values for this parameter. See
436
+ * [input and output sizes](https://docs.anthropic.com/claude/reference/input-and-output-sizes)
437
+ * for details.
438
+ */
439
+ max_tokens: number;
440
+
441
+ /**
442
+ * Input messages.
443
+ *
444
+ * Our models are trained to operate on alternating `user` and `assistant`
445
+ * conversational turns. When creating a new `Message`, you specify the prior
446
+ * conversational turns with the `messages` parameter, and the model then generates
447
+ * the next `Message` in the conversation.
448
+ *
449
+ * Each input message must be an object with a `role` and `content`. You can
450
+ * specify a single `user`-role message, or you can include multiple `user` and
451
+ * `assistant` messages. The first message must always use the `user` role.
452
+ *
453
+ * If the final message uses the `assistant` role, the response content will
454
+ * continue immediately from the content in that message. This can be used to
455
+ * constrain part of the model's response.
456
+ *
457
+ * Example with a single `user` message:
458
+ *
459
+ * ```json
460
+ * [{ "role": "user", "content": "Hello, Claude" }]
461
+ * ```
462
+ *
463
+ * Example with multiple conversational turns:
464
+ *
465
+ * ```json
466
+ * [
467
+ * { "role": "user", "content": "Hello there." },
468
+ * { "role": "assistant", "content": "Hi, I'm Claude. How can I help you?" },
469
+ * { "role": "user", "content": "Can you explain LLMs in plain English?" }
470
+ * ]
471
+ * ```
472
+ *
473
+ * Example with a partially-filled response from Claude:
474
+ *
475
+ * ```json
476
+ * [
477
+ * { "role": "user", "content": "Please describe yourself using only JSON" },
478
+ * { "role": "assistant", "content": "Here is my JSON description:\n{" }
479
+ * ]
480
+ * ```
481
+ *
482
+ * Each input message `content` may be either a single `string` or an array of
483
+ * content blocks, where each block has a specific `type`. Using a `string` is
484
+ * shorthand for an array of one content block of type `"text"`. The following
485
+ * input messages are equivalent:
486
+ *
487
+ * ```json
488
+ * { "role": "user", "content": "Hello, Claude" }
489
+ * ```
490
+ *
491
+ * ```json
492
+ * { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
493
+ * ```
494
+ *
495
+ * During beta, the Messages API only accepts content blocks of type `"text"`, and
496
+ * at most one block per message.
497
+ *
498
+ * See our
499
+ * [guide to prompt design](https://docs.anthropic.com/claude/docs/introduction-to-prompt-design)
500
+ * for more details on how to best construct prompts.
501
+ */
502
+ messages: Array<MessageParam>;
503
+
504
+ /**
505
+ * The model that will complete your prompt.
506
+ *
507
+ * As we improve Claude, we develop new versions of it that you can query. The
508
+ * `model` parameter controls which version of Claude responds to your request.
509
+ * Right now we offer two model families: Claude, and Claude Instant. You can use
510
+ * them by setting `model` to `"claude-2.1"` or `"claude-instant-1.2"`,
511
+ * respectively.
512
+ *
513
+ * See [models](https://docs.anthropic.com/claude/reference/selecting-a-model) for
514
+ * additional details and options.
515
+ */
516
+ model: string;
517
+
518
+ /**
519
+ * An object describing metadata about the request.
520
+ */
521
+ metadata?: MessageStreamParams.Metadata;
522
+
523
+ /**
524
+ * Custom text sequences that will cause the model to stop generating.
525
+ *
526
+ * Our models will normally stop when they have naturally completed their turn,
527
+ * which will result in a response `stop_reason` of `"end_turn"`.
528
+ *
529
+ * If you want the model to stop generating when it encounters custom strings of
530
+ * text, you can use the `stop_sequences` parameter. If the model encounters one of
531
+ * the custom sequences, the response `stop_reason` value will be `"stop_sequence"`
532
+ * and the response `stop_sequence` value will contain the matched stop sequence.
533
+ */
534
+ stop_sequences?: Array<string>;
535
+
536
+ /**
537
+ * System prompt.
538
+ *
539
+ * A system prompt is a way of providing context and instructions to Claude, such
540
+ * as specifying a particular goal or role. See our
541
+ * [guide to system prompts](https://docs.anthropic.com/claude/docs/how-to-use-system-prompts).
542
+ */
543
+ system?: string;
544
+
545
+ /**
546
+ * Amount of randomness injected into the response.
547
+ *
548
+ * Defaults to 1. Ranges from 0 to 1. Use temp closer to 0 for analytical /
549
+ * multiple choice, and closer to 1 for creative and generative tasks.
550
+ */
551
+ temperature?: number;
552
+
553
+ /**
554
+ * Only sample from the top K options for each subsequent token.
555
+ *
556
+ * Used to remove "long tail" low probability responses.
557
+ * [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
558
+ */
559
+ top_k?: number;
560
+
561
+ /**
562
+ * Use nucleus sampling.
563
+ *
564
+ * In nucleus sampling, we compute the cumulative distribution over all the options
565
+ * for each subsequent token in decreasing probability order and cut it off once it
566
+ * reaches a particular probability specified by `top_p`. You should either alter
567
+ * `temperature` or `top_p`, but not both.
568
+ */
569
+ top_p?: number;
570
+ }
571
+
572
+ export namespace MessageStreamParams {
573
+ /**
574
+ * An object describing metadata about the request.
575
+ */
576
+ export interface Metadata {
577
+ /**
578
+ * An external identifier for the user who is associated with the request.
579
+ *
580
+ * This should be a uuid, hash value, or other opaque identifier. Anthropic may use
581
+ * this id to help detect abuse. Do not include any identifying information such as
582
+ * name, email address, or phone number.
583
+ */
584
+ user_id?: string;
585
+ }
586
+ }
587
+
588
+ export namespace Messages {
589
+ export import ContentBlock = MessagesAPI.ContentBlock;
590
+ export import ContentBlockDeltaEvent = MessagesAPI.ContentBlockDeltaEvent;
591
+ export import ContentBlockStartEvent = MessagesAPI.ContentBlockStartEvent;
592
+ export import ContentBlockStopEvent = MessagesAPI.ContentBlockStopEvent;
593
+ export import Message = MessagesAPI.Message;
594
+ export import MessageDeltaEvent = MessagesAPI.MessageDeltaEvent;
595
+ export import MessageParam = MessagesAPI.MessageParam;
596
+ export import MessageStartEvent = MessagesAPI.MessageStartEvent;
597
+ export import MessageStopEvent = MessagesAPI.MessageStopEvent;
598
+ export import MessageStreamEvent = MessagesAPI.MessageStreamEvent;
599
+ export import TextBlock = MessagesAPI.TextBlock;
600
+ export import TextDelta = MessagesAPI.TextDelta;
601
+ export import MessageCreateParams = MessagesAPI.MessageCreateParams;
602
+ export import MessageCreateParamsNonStreaming = MessagesAPI.MessageCreateParamsNonStreaming;
603
+ export import MessageCreateParamsStreaming = MessagesAPI.MessageCreateParamsStreaming;
604
+ export import MessageStreamParams = MessagesAPI.MessageStreamParams;
605
+ }