@anthropic-ai/sdk 0.36.2 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/README.md +30 -3
- package/core.d.ts +1 -0
- package/core.d.ts.map +1 -1
- package/core.js +33 -6
- package/core.js.map +1 -1
- package/core.mjs +33 -6
- package/core.mjs.map +1 -1
- package/index.d.mts +2 -2
- package/index.d.ts +2 -2
- package/index.d.ts.map +1 -1
- package/index.js.map +1 -1
- package/index.mjs.map +1 -1
- package/internal/decoders/line.d.ts +3 -2
- package/internal/decoders/line.d.ts.map +1 -1
- package/internal/decoders/line.js +97 -35
- package/internal/decoders/line.js.map +1 -1
- package/internal/decoders/line.mjs +95 -34
- package/internal/decoders/line.mjs.map +1 -1
- package/lib/BetaMessageStream.d.ts +4 -1
- package/lib/BetaMessageStream.d.ts.map +1 -1
- package/lib/BetaMessageStream.js +79 -22
- package/lib/BetaMessageStream.js.map +1 -1
- package/lib/BetaMessageStream.mjs +79 -22
- package/lib/BetaMessageStream.mjs.map +1 -1
- package/lib/MessageStream.d.ts +4 -1
- package/lib/MessageStream.d.ts.map +1 -1
- package/lib/MessageStream.js +79 -22
- package/lib/MessageStream.js.map +1 -1
- package/lib/MessageStream.mjs +79 -22
- package/lib/MessageStream.mjs.map +1 -1
- package/package.json +29 -8
- package/pagination.d.ts +1 -0
- package/pagination.d.ts.map +1 -1
- package/pagination.js +6 -0
- package/pagination.js.map +1 -1
- package/pagination.mjs +6 -0
- package/pagination.mjs.map +1 -1
- package/resources/beta/beta.d.ts +3 -3
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/index.d.ts +1 -1
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs.map +1 -1
- package/resources/beta/messages/batches.d.ts +22 -0
- package/resources/beta/messages/batches.d.ts.map +1 -1
- package/resources/beta/messages/batches.js +3 -0
- package/resources/beta/messages/batches.js.map +1 -1
- package/resources/beta/messages/batches.mjs +3 -0
- package/resources/beta/messages/batches.mjs.map +1 -1
- package/resources/beta/messages/index.d.ts +1 -1
- package/resources/beta/messages/index.d.ts.map +1 -1
- package/resources/beta/messages/index.js.map +1 -1
- package/resources/beta/messages/index.mjs.map +1 -1
- package/resources/beta/messages/messages.d.ts +148 -13
- package/resources/beta/messages/messages.d.ts.map +1 -1
- package/resources/beta/messages/messages.js +5 -1
- package/resources/beta/messages/messages.js.map +1 -1
- package/resources/beta/messages/messages.mjs +5 -1
- package/resources/beta/messages/messages.mjs.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/messages/batches.d.ts +22 -0
- package/resources/messages/batches.d.ts.map +1 -1
- package/resources/messages/batches.js +15 -0
- package/resources/messages/batches.js.map +1 -1
- package/resources/messages/batches.mjs +15 -0
- package/resources/messages/batches.mjs.map +1 -1
- package/resources/messages/index.d.ts +1 -1
- package/resources/messages/index.d.ts.map +1 -1
- package/resources/messages/index.js.map +1 -1
- package/resources/messages/index.mjs.map +1 -1
- package/resources/messages/messages.d.ts +129 -14
- package/resources/messages/messages.d.ts.map +1 -1
- package/resources/messages/messages.js +5 -1
- package/resources/messages/messages.js.map +1 -1
- package/resources/messages/messages.mjs +5 -1
- package/resources/messages/messages.mjs.map +1 -1
- package/src/core.ts +39 -6
- package/src/index.ts +26 -0
- package/src/internal/decoders/line.ts +100 -38
- package/src/lib/BetaMessageStream.ts +87 -22
- package/src/lib/MessageStream.ts +88 -22
- package/src/pagination.ts +8 -0
- package/src/resources/beta/beta.ts +28 -1
- package/src/resources/beta/index.ts +12 -0
- package/src/resources/beta/messages/batches.ts +22 -0
- package/src/resources/beta/messages/index.ts +12 -0
- package/src/resources/beta/messages/messages.ts +212 -14
- package/src/resources/index.ts +13 -0
- package/src/resources/messages/batches.ts +22 -0
- package/src/resources/messages/index.ts +13 -0
- package/src/resources/messages/messages.ts +177 -15
- package/src/streaming.ts +1 -43
- package/src/version.ts +1 -1
- package/streaming.d.ts +0 -2
- package/streaming.d.ts.map +1 -1
- package/streaming.js +2 -38
- package/streaming.js.map +1 -1
- package/streaming.mjs +1 -36
- package/streaming.mjs.map +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -34,6 +34,8 @@ export class Messages extends APIResource {
|
|
|
34
34
|
*
|
|
35
35
|
* The Messages API can be used for either single queries or stateless multi-turn
|
|
36
36
|
* conversations.
|
|
37
|
+
*
|
|
38
|
+
* Learn more about the Messages API in our [user guide](/en/docs/initial-setup)
|
|
37
39
|
*/
|
|
38
40
|
create(body: MessageCreateParamsNonStreaming, options?: Core.RequestOptions): APIPromise<Message>;
|
|
39
41
|
create(
|
|
@@ -57,7 +59,9 @@ export class Messages extends APIResource {
|
|
|
57
59
|
}
|
|
58
60
|
return this._client.post('/v1/messages', {
|
|
59
61
|
body,
|
|
60
|
-
timeout:
|
|
62
|
+
timeout:
|
|
63
|
+
(this._client as any)._options.timeout ??
|
|
64
|
+
(body.stream ? 600000 : this._client._calculateNonstreamingTimeout(body.max_tokens)),
|
|
61
65
|
...options,
|
|
62
66
|
stream: body.stream ?? false,
|
|
63
67
|
}) as APIPromise<Message> | APIPromise<Stream<RawMessageStreamEvent>>;
|
|
@@ -75,6 +79,9 @@ export class Messages extends APIResource {
|
|
|
75
79
|
*
|
|
76
80
|
* The Token Count API can be used to count the number of tokens in a Message,
|
|
77
81
|
* including tools, images, and documents, without creating it.
|
|
82
|
+
*
|
|
83
|
+
* Learn more about token counting in our
|
|
84
|
+
* [user guide](/en/docs/build-with-claude/token-counting)
|
|
78
85
|
*/
|
|
79
86
|
countTokens(
|
|
80
87
|
body: MessageCountTokensParams,
|
|
@@ -190,7 +197,7 @@ export interface CitationsDelta {
|
|
|
190
197
|
type: 'citations_delta';
|
|
191
198
|
}
|
|
192
199
|
|
|
193
|
-
export type ContentBlock = TextBlock | ToolUseBlock;
|
|
200
|
+
export type ContentBlock = TextBlock | ToolUseBlock | ThinkingBlock | RedactedThinkingBlock;
|
|
194
201
|
|
|
195
202
|
export type ContentBlockDeltaEvent = RawContentBlockDeltaEvent;
|
|
196
203
|
|
|
@@ -199,7 +206,9 @@ export type ContentBlockParam =
|
|
|
199
206
|
| ImageBlockParam
|
|
200
207
|
| ToolUseBlockParam
|
|
201
208
|
| ToolResultBlockParam
|
|
202
|
-
| DocumentBlockParam
|
|
209
|
+
| DocumentBlockParam
|
|
210
|
+
| ThinkingBlockParam
|
|
211
|
+
| RedactedThinkingBlockParam;
|
|
203
212
|
|
|
204
213
|
export interface ContentBlockSource {
|
|
205
214
|
content: string | Array<ContentBlockSourceContent>;
|
|
@@ -354,10 +363,15 @@ export interface Message {
|
|
|
354
363
|
*
|
|
355
364
|
* For example, `output_tokens` will be non-zero, even for an empty string response
|
|
356
365
|
* from Claude.
|
|
366
|
+
*
|
|
367
|
+
* Total input tokens in a request is the summation of `input_tokens`,
|
|
368
|
+
* `cache_creation_input_tokens`, and `cache_read_input_tokens`.
|
|
357
369
|
*/
|
|
358
370
|
usage: Usage;
|
|
359
371
|
}
|
|
360
372
|
|
|
373
|
+
export type MessageCountTokensTool = ToolBash20250124 | ToolTextEditor20250124 | Tool;
|
|
374
|
+
|
|
361
375
|
export type MessageDeltaEvent = RawMessageDeltaEvent;
|
|
362
376
|
|
|
363
377
|
export interface MessageDeltaUsage {
|
|
@@ -404,7 +418,8 @@ export interface Metadata {
|
|
|
404
418
|
* details and options.
|
|
405
419
|
*/
|
|
406
420
|
export type Model =
|
|
407
|
-
|
|
|
421
|
+
| 'claude-3-7-sonnet-latest'
|
|
422
|
+
| 'claude-3-7-sonnet-20250219'
|
|
408
423
|
| 'claude-3-5-haiku-latest'
|
|
409
424
|
| 'claude-3-5-haiku-20241022'
|
|
410
425
|
| 'claude-3-5-sonnet-latest'
|
|
@@ -415,7 +430,8 @@ export type Model =
|
|
|
415
430
|
| 'claude-3-sonnet-20240229'
|
|
416
431
|
| 'claude-3-haiku-20240307'
|
|
417
432
|
| 'claude-2.1'
|
|
418
|
-
| 'claude-2.0'
|
|
433
|
+
| 'claude-2.0'
|
|
434
|
+
| (string & {});
|
|
419
435
|
|
|
420
436
|
const DEPRECATED_MODELS: {
|
|
421
437
|
[K in Model]?: string;
|
|
@@ -439,7 +455,7 @@ export interface PlainTextSource {
|
|
|
439
455
|
}
|
|
440
456
|
|
|
441
457
|
export interface RawContentBlockDeltaEvent {
|
|
442
|
-
delta: TextDelta | InputJSONDelta | CitationsDelta;
|
|
458
|
+
delta: TextDelta | InputJSONDelta | CitationsDelta | ThinkingDelta | SignatureDelta;
|
|
443
459
|
|
|
444
460
|
index: number;
|
|
445
461
|
|
|
@@ -447,7 +463,7 @@ export interface RawContentBlockDeltaEvent {
|
|
|
447
463
|
}
|
|
448
464
|
|
|
449
465
|
export interface RawContentBlockStartEvent {
|
|
450
|
-
content_block: TextBlock | ToolUseBlock;
|
|
466
|
+
content_block: TextBlock | ToolUseBlock | ThinkingBlock | RedactedThinkingBlock;
|
|
451
467
|
|
|
452
468
|
index: number;
|
|
453
469
|
|
|
@@ -478,6 +494,9 @@ export interface RawMessageDeltaEvent {
|
|
|
478
494
|
*
|
|
479
495
|
* For example, `output_tokens` will be non-zero, even for an empty string response
|
|
480
496
|
* from Claude.
|
|
497
|
+
*
|
|
498
|
+
* Total input tokens in a request is the summation of `input_tokens`,
|
|
499
|
+
* `cache_creation_input_tokens`, and `cache_read_input_tokens`.
|
|
481
500
|
*/
|
|
482
501
|
usage: MessageDeltaUsage;
|
|
483
502
|
}
|
|
@@ -508,6 +527,24 @@ export type RawMessageStreamEvent =
|
|
|
508
527
|
| RawContentBlockDeltaEvent
|
|
509
528
|
| RawContentBlockStopEvent;
|
|
510
529
|
|
|
530
|
+
export interface RedactedThinkingBlock {
|
|
531
|
+
data: string;
|
|
532
|
+
|
|
533
|
+
type: 'redacted_thinking';
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
export interface RedactedThinkingBlockParam {
|
|
537
|
+
data: string;
|
|
538
|
+
|
|
539
|
+
type: 'redacted_thinking';
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
export interface SignatureDelta {
|
|
543
|
+
signature: string;
|
|
544
|
+
|
|
545
|
+
type: 'signature_delta';
|
|
546
|
+
}
|
|
547
|
+
|
|
511
548
|
export interface TextBlock {
|
|
512
549
|
/**
|
|
513
550
|
* Citations supporting the text block.
|
|
@@ -546,9 +583,65 @@ export interface TextDelta {
|
|
|
546
583
|
type: 'text_delta';
|
|
547
584
|
}
|
|
548
585
|
|
|
586
|
+
export interface ThinkingBlock {
|
|
587
|
+
signature: string;
|
|
588
|
+
|
|
589
|
+
thinking: string;
|
|
590
|
+
|
|
591
|
+
type: 'thinking';
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
export interface ThinkingBlockParam {
|
|
595
|
+
signature: string;
|
|
596
|
+
|
|
597
|
+
thinking: string;
|
|
598
|
+
|
|
599
|
+
type: 'thinking';
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
export interface ThinkingConfigDisabled {
|
|
603
|
+
type: 'disabled';
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
export interface ThinkingConfigEnabled {
|
|
607
|
+
/**
|
|
608
|
+
* Determines how many tokens Claude can use for its internal reasoning process.
|
|
609
|
+
* Larger budgets can enable more thorough analysis for complex problems, improving
|
|
610
|
+
* response quality.
|
|
611
|
+
*
|
|
612
|
+
* Must be ≥1024 and less than `max_tokens`.
|
|
613
|
+
*
|
|
614
|
+
* See
|
|
615
|
+
* [extended thinking](https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking)
|
|
616
|
+
* for details.
|
|
617
|
+
*/
|
|
618
|
+
budget_tokens: number;
|
|
619
|
+
|
|
620
|
+
type: 'enabled';
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
/**
|
|
624
|
+
* Configuration for enabling Claude's extended thinking.
|
|
625
|
+
*
|
|
626
|
+
* When enabled, responses include `thinking` content blocks showing Claude's
|
|
627
|
+
* thinking process before the final answer. Requires a minimum budget of 1,024
|
|
628
|
+
* tokens and counts towards your `max_tokens` limit.
|
|
629
|
+
*
|
|
630
|
+
* See
|
|
631
|
+
* [extended thinking](https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking)
|
|
632
|
+
* for details.
|
|
633
|
+
*/
|
|
634
|
+
export type ThinkingConfigParam = ThinkingConfigEnabled | ThinkingConfigDisabled;
|
|
635
|
+
|
|
636
|
+
export interface ThinkingDelta {
|
|
637
|
+
thinking: string;
|
|
638
|
+
|
|
639
|
+
type: 'thinking_delta';
|
|
640
|
+
}
|
|
641
|
+
|
|
549
642
|
export interface Tool {
|
|
550
643
|
/**
|
|
551
|
-
* [JSON schema](https://json-schema.org/) for this tool's input.
|
|
644
|
+
* [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
|
|
552
645
|
*
|
|
553
646
|
* This defines the shape of the `input` that your tool accepts and that the model
|
|
554
647
|
* will produce.
|
|
@@ -577,7 +670,7 @@ export interface Tool {
|
|
|
577
670
|
|
|
578
671
|
export namespace Tool {
|
|
579
672
|
/**
|
|
580
|
-
* [JSON schema](https://json-schema.org/) for this tool's input.
|
|
673
|
+
* [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
|
|
581
674
|
*
|
|
582
675
|
* This defines the shape of the `input` that your tool accepts and that the model
|
|
583
676
|
* will produce.
|
|
@@ -590,6 +683,19 @@ export namespace Tool {
|
|
|
590
683
|
}
|
|
591
684
|
}
|
|
592
685
|
|
|
686
|
+
export interface ToolBash20250124 {
|
|
687
|
+
/**
|
|
688
|
+
* Name of the tool.
|
|
689
|
+
*
|
|
690
|
+
* This is how the tool will be called by the model and in tool_use blocks.
|
|
691
|
+
*/
|
|
692
|
+
name: 'bash';
|
|
693
|
+
|
|
694
|
+
type: 'bash_20250124';
|
|
695
|
+
|
|
696
|
+
cache_control?: CacheControlEphemeral | null;
|
|
697
|
+
}
|
|
698
|
+
|
|
593
699
|
/**
|
|
594
700
|
* How the model should use the provided tools. The model can use a specific tool,
|
|
595
701
|
* any available tool, or decide by itself.
|
|
@@ -658,6 +764,21 @@ export interface ToolResultBlockParam {
|
|
|
658
764
|
is_error?: boolean;
|
|
659
765
|
}
|
|
660
766
|
|
|
767
|
+
export interface ToolTextEditor20250124 {
|
|
768
|
+
/**
|
|
769
|
+
* Name of the tool.
|
|
770
|
+
*
|
|
771
|
+
* This is how the tool will be called by the model and in tool_use blocks.
|
|
772
|
+
*/
|
|
773
|
+
name: 'str_replace_editor';
|
|
774
|
+
|
|
775
|
+
type: 'text_editor_20250124';
|
|
776
|
+
|
|
777
|
+
cache_control?: CacheControlEphemeral | null;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
export type ToolUnion = ToolBash20250124 | ToolTextEditor20250124 | Tool;
|
|
781
|
+
|
|
661
782
|
export interface ToolUseBlock {
|
|
662
783
|
id: string;
|
|
663
784
|
|
|
@@ -860,6 +981,19 @@ export interface MessageCreateParamsBase {
|
|
|
860
981
|
*/
|
|
861
982
|
temperature?: number;
|
|
862
983
|
|
|
984
|
+
/**
|
|
985
|
+
* Configuration for enabling Claude's extended thinking.
|
|
986
|
+
*
|
|
987
|
+
* When enabled, responses include `thinking` content blocks showing Claude's
|
|
988
|
+
* thinking process before the final answer. Requires a minimum budget of 1,024
|
|
989
|
+
* tokens and counts towards your `max_tokens` limit.
|
|
990
|
+
*
|
|
991
|
+
* See
|
|
992
|
+
* [extended thinking](https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking)
|
|
993
|
+
* for details.
|
|
994
|
+
*/
|
|
995
|
+
thinking?: ThinkingConfigParam;
|
|
996
|
+
|
|
863
997
|
/**
|
|
864
998
|
* How the model should use the provided tools. The model can use a specific tool,
|
|
865
999
|
* any available tool, or decide by itself.
|
|
@@ -878,8 +1012,9 @@ export interface MessageCreateParamsBase {
|
|
|
878
1012
|
*
|
|
879
1013
|
* - `name`: Name of the tool.
|
|
880
1014
|
* - `description`: Optional, but strongly-recommended description of the tool.
|
|
881
|
-
* - `input_schema`: [JSON schema](https://json-schema.org/) for the
|
|
882
|
-
* shape that the model will produce in `tool_use` output content
|
|
1015
|
+
* - `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the
|
|
1016
|
+
* tool `input` shape that the model will produce in `tool_use` output content
|
|
1017
|
+
* blocks.
|
|
883
1018
|
*
|
|
884
1019
|
* For example, if you defined `tools` as:
|
|
885
1020
|
*
|
|
@@ -936,7 +1071,7 @@ export interface MessageCreateParamsBase {
|
|
|
936
1071
|
*
|
|
937
1072
|
* See our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details.
|
|
938
1073
|
*/
|
|
939
|
-
tools?: Array<
|
|
1074
|
+
tools?: Array<ToolUnion>;
|
|
940
1075
|
|
|
941
1076
|
/**
|
|
942
1077
|
* Only sample from the top K options for each subsequent token.
|
|
@@ -1117,6 +1252,19 @@ export interface MessageCountTokensParams {
|
|
|
1117
1252
|
*/
|
|
1118
1253
|
system?: string | Array<TextBlockParam>;
|
|
1119
1254
|
|
|
1255
|
+
/**
|
|
1256
|
+
* Configuration for enabling Claude's extended thinking.
|
|
1257
|
+
*
|
|
1258
|
+
* When enabled, responses include `thinking` content blocks showing Claude's
|
|
1259
|
+
* thinking process before the final answer. Requires a minimum budget of 1,024
|
|
1260
|
+
* tokens and counts towards your `max_tokens` limit.
|
|
1261
|
+
*
|
|
1262
|
+
* See
|
|
1263
|
+
* [extended thinking](https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking)
|
|
1264
|
+
* for details.
|
|
1265
|
+
*/
|
|
1266
|
+
thinking?: ThinkingConfigParam;
|
|
1267
|
+
|
|
1120
1268
|
/**
|
|
1121
1269
|
* How the model should use the provided tools. The model can use a specific tool,
|
|
1122
1270
|
* any available tool, or decide by itself.
|
|
@@ -1135,8 +1283,9 @@ export interface MessageCountTokensParams {
|
|
|
1135
1283
|
*
|
|
1136
1284
|
* - `name`: Name of the tool.
|
|
1137
1285
|
* - `description`: Optional, but strongly-recommended description of the tool.
|
|
1138
|
-
* - `input_schema`: [JSON schema](https://json-schema.org/) for the
|
|
1139
|
-
* shape that the model will produce in `tool_use` output content
|
|
1286
|
+
* - `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the
|
|
1287
|
+
* tool `input` shape that the model will produce in `tool_use` output content
|
|
1288
|
+
* blocks.
|
|
1140
1289
|
*
|
|
1141
1290
|
* For example, if you defined `tools` as:
|
|
1142
1291
|
*
|
|
@@ -1193,7 +1342,7 @@ export interface MessageCountTokensParams {
|
|
|
1193
1342
|
*
|
|
1194
1343
|
* See our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details.
|
|
1195
1344
|
*/
|
|
1196
|
-
tools?: Array<
|
|
1345
|
+
tools?: Array<MessageCountTokensTool>;
|
|
1197
1346
|
}
|
|
1198
1347
|
|
|
1199
1348
|
Messages.Batches = Batches;
|
|
@@ -1223,6 +1372,7 @@ export declare namespace Messages {
|
|
|
1223
1372
|
type InputJsonDelta as InputJsonDelta,
|
|
1224
1373
|
type InputJSONDelta as InputJSONDelta,
|
|
1225
1374
|
type Message as Message,
|
|
1375
|
+
type MessageCountTokensTool as MessageCountTokensTool,
|
|
1226
1376
|
type MessageDeltaEvent as MessageDeltaEvent,
|
|
1227
1377
|
type MessageDeltaUsage as MessageDeltaUsage,
|
|
1228
1378
|
type MessageParam as MessageParam,
|
|
@@ -1240,17 +1390,29 @@ export declare namespace Messages {
|
|
|
1240
1390
|
type RawMessageStartEvent as RawMessageStartEvent,
|
|
1241
1391
|
type RawMessageStopEvent as RawMessageStopEvent,
|
|
1242
1392
|
type RawMessageStreamEvent as RawMessageStreamEvent,
|
|
1393
|
+
type RedactedThinkingBlock as RedactedThinkingBlock,
|
|
1394
|
+
type RedactedThinkingBlockParam as RedactedThinkingBlockParam,
|
|
1395
|
+
type SignatureDelta as SignatureDelta,
|
|
1243
1396
|
type TextBlock as TextBlock,
|
|
1244
1397
|
type TextBlockParam as TextBlockParam,
|
|
1245
1398
|
type TextCitation as TextCitation,
|
|
1246
1399
|
type TextCitationParam as TextCitationParam,
|
|
1247
1400
|
type TextDelta as TextDelta,
|
|
1401
|
+
type ThinkingBlock as ThinkingBlock,
|
|
1402
|
+
type ThinkingBlockParam as ThinkingBlockParam,
|
|
1403
|
+
type ThinkingConfigDisabled as ThinkingConfigDisabled,
|
|
1404
|
+
type ThinkingConfigEnabled as ThinkingConfigEnabled,
|
|
1405
|
+
type ThinkingConfigParam as ThinkingConfigParam,
|
|
1406
|
+
type ThinkingDelta as ThinkingDelta,
|
|
1248
1407
|
type Tool as Tool,
|
|
1408
|
+
type ToolBash20250124 as ToolBash20250124,
|
|
1249
1409
|
type ToolChoice as ToolChoice,
|
|
1250
1410
|
type ToolChoiceAny as ToolChoiceAny,
|
|
1251
1411
|
type ToolChoiceAuto as ToolChoiceAuto,
|
|
1252
1412
|
type ToolChoiceTool as ToolChoiceTool,
|
|
1253
1413
|
type ToolResultBlockParam as ToolResultBlockParam,
|
|
1414
|
+
type ToolTextEditor20250124 as ToolTextEditor20250124,
|
|
1415
|
+
type ToolUnion as ToolUnion,
|
|
1254
1416
|
type ToolUseBlock as ToolUseBlock,
|
|
1255
1417
|
type ToolUseBlockParam as ToolUseBlockParam,
|
|
1256
1418
|
type Usage as Usage,
|
package/src/streaming.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReadableStream, type Response } from "./_shims/index.js";
|
|
2
2
|
import { AnthropicError } from "./error.js";
|
|
3
|
-
import { LineDecoder } from "./internal/decoders/line.js";
|
|
3
|
+
import { findDoubleNewlineIndex, LineDecoder } from "./internal/decoders/line.js";
|
|
4
4
|
import { ReadableStreamToAsyncIterable } from "./internal/stream-utils.js";
|
|
5
5
|
|
|
6
6
|
import { createResponseHeaders } from "./core.js";
|
|
@@ -261,37 +261,6 @@ async function* iterSSEChunks(iterator: AsyncIterableIterator<Bytes>): AsyncGene
|
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
-
function findDoubleNewlineIndex(buffer: Uint8Array): number {
|
|
265
|
-
// This function searches the buffer for the end patterns (\r\r, \n\n, \r\n\r\n)
|
|
266
|
-
// and returns the index right after the first occurrence of any pattern,
|
|
267
|
-
// or -1 if none of the patterns are found.
|
|
268
|
-
const newline = 0x0a; // \n
|
|
269
|
-
const carriage = 0x0d; // \r
|
|
270
|
-
|
|
271
|
-
for (let i = 0; i < buffer.length - 2; i++) {
|
|
272
|
-
if (buffer[i] === newline && buffer[i + 1] === newline) {
|
|
273
|
-
// \n\n
|
|
274
|
-
return i + 2;
|
|
275
|
-
}
|
|
276
|
-
if (buffer[i] === carriage && buffer[i + 1] === carriage) {
|
|
277
|
-
// \r\r
|
|
278
|
-
return i + 2;
|
|
279
|
-
}
|
|
280
|
-
if (
|
|
281
|
-
buffer[i] === carriage &&
|
|
282
|
-
buffer[i + 1] === newline &&
|
|
283
|
-
i + 3 < buffer.length &&
|
|
284
|
-
buffer[i + 2] === carriage &&
|
|
285
|
-
buffer[i + 3] === newline
|
|
286
|
-
) {
|
|
287
|
-
// \r\n\r\n
|
|
288
|
-
return i + 4;
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
return -1;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
264
|
class SSEDecoder {
|
|
296
265
|
private data: string[];
|
|
297
266
|
private event: string | null;
|
|
@@ -347,17 +316,6 @@ class SSEDecoder {
|
|
|
347
316
|
}
|
|
348
317
|
}
|
|
349
318
|
|
|
350
|
-
/** This is an internal helper function that's just used for testing */
|
|
351
|
-
export function _decodeChunks(chunks: string[]): string[] {
|
|
352
|
-
const decoder = new LineDecoder();
|
|
353
|
-
const lines: string[] = [];
|
|
354
|
-
for (const chunk of chunks) {
|
|
355
|
-
lines.push(...decoder.decode(chunk));
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
return lines;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
319
|
function partition(str: string, delimiter: string): [string, string, string] {
|
|
362
320
|
const index = str.indexOf(delimiter);
|
|
363
321
|
if (index !== -1) {
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.37.0'; // x-release-please-version
|
package/streaming.d.ts
CHANGED
|
@@ -29,6 +29,4 @@ export declare class Stream<Item> implements AsyncIterable<Item> {
|
|
|
29
29
|
toReadableStream(): ReadableStream;
|
|
30
30
|
}
|
|
31
31
|
export declare function _iterSSEMessages(response: Response, controller: AbortController): AsyncGenerator<ServerSentEvent, void, unknown>;
|
|
32
|
-
/** This is an internal helper function that's just used for testing */
|
|
33
|
-
export declare function _decodeChunks(chunks: string[]): string[];
|
|
34
32
|
//# sourceMappingURL=streaming.d.ts.map
|
package/streaming.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streaming.d.ts","sourceRoot":"","sources":["src/streaming.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAU/D,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,EAAE,CAAC;CACf,CAAC;AAEF,qBAAa,MAAM,CAAC,IAAI,CAAE,YAAW,aAAa,CAAC,IAAI,CAAC;IAIpD,OAAO,CAAC,QAAQ;IAHlB,UAAU,EAAE,eAAe,CAAC;gBAGlB,QAAQ,EAAE,MAAM,aAAa,CAAC,IAAI,CAAC,EAC3C,UAAU,EAAE,eAAe;IAK7B,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,eAAe,GAAG,MAAM,CAAC,IAAI,CAAC;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AC;IA2C1G,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC;IAI7C;;;OAGG;IACH,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAwBnC;;;;OAIG;IACH,gBAAgB,IAAI,cAAc;CA0BnC;AAED,wBAAuB,gBAAgB,CACrC,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,eAAe,GAC1B,cAAc,CAAC,eAAe,EAAE,IAAI,EAAE,OAAO,CAAC,CAqBhD"}
|
package/streaming.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports._iterSSEMessages = exports.Stream = void 0;
|
|
4
4
|
const index_1 = require("./_shims/index.js");
|
|
5
5
|
const error_1 = require("./error.js");
|
|
6
6
|
const line_1 = require("./internal/decoders/line.js");
|
|
@@ -217,7 +217,7 @@ async function* iterSSEChunks(iterator) {
|
|
|
217
217
|
newData.set(binaryChunk, data.length);
|
|
218
218
|
data = newData;
|
|
219
219
|
let patternIndex;
|
|
220
|
-
while ((patternIndex = findDoubleNewlineIndex(data)) !== -1) {
|
|
220
|
+
while ((patternIndex = (0, line_1.findDoubleNewlineIndex)(data)) !== -1) {
|
|
221
221
|
yield data.slice(0, patternIndex);
|
|
222
222
|
data = data.slice(patternIndex);
|
|
223
223
|
}
|
|
@@ -226,32 +226,6 @@ async function* iterSSEChunks(iterator) {
|
|
|
226
226
|
yield data;
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
|
-
function findDoubleNewlineIndex(buffer) {
|
|
230
|
-
// This function searches the buffer for the end patterns (\r\r, \n\n, \r\n\r\n)
|
|
231
|
-
// and returns the index right after the first occurrence of any pattern,
|
|
232
|
-
// or -1 if none of the patterns are found.
|
|
233
|
-
const newline = 0x0a; // \n
|
|
234
|
-
const carriage = 0x0d; // \r
|
|
235
|
-
for (let i = 0; i < buffer.length - 2; i++) {
|
|
236
|
-
if (buffer[i] === newline && buffer[i + 1] === newline) {
|
|
237
|
-
// \n\n
|
|
238
|
-
return i + 2;
|
|
239
|
-
}
|
|
240
|
-
if (buffer[i] === carriage && buffer[i + 1] === carriage) {
|
|
241
|
-
// \r\r
|
|
242
|
-
return i + 2;
|
|
243
|
-
}
|
|
244
|
-
if (buffer[i] === carriage &&
|
|
245
|
-
buffer[i + 1] === newline &&
|
|
246
|
-
i + 3 < buffer.length &&
|
|
247
|
-
buffer[i + 2] === carriage &&
|
|
248
|
-
buffer[i + 3] === newline) {
|
|
249
|
-
// \r\n\r\n
|
|
250
|
-
return i + 4;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
return -1;
|
|
254
|
-
}
|
|
255
229
|
class SSEDecoder {
|
|
256
230
|
constructor() {
|
|
257
231
|
this.event = null;
|
|
@@ -293,16 +267,6 @@ class SSEDecoder {
|
|
|
293
267
|
return null;
|
|
294
268
|
}
|
|
295
269
|
}
|
|
296
|
-
/** This is an internal helper function that's just used for testing */
|
|
297
|
-
function _decodeChunks(chunks) {
|
|
298
|
-
const decoder = new line_1.LineDecoder();
|
|
299
|
-
const lines = [];
|
|
300
|
-
for (const chunk of chunks) {
|
|
301
|
-
lines.push(...decoder.decode(chunk));
|
|
302
|
-
}
|
|
303
|
-
return lines;
|
|
304
|
-
}
|
|
305
|
-
exports._decodeChunks = _decodeChunks;
|
|
306
270
|
function partition(str, delimiter) {
|
|
307
271
|
const index = str.indexOf(delimiter);
|
|
308
272
|
if (index !== -1) {
|
package/streaming.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streaming.js","sourceRoot":"","sources":["src/streaming.ts"],"names":[],"mappings":";;;AAAA,6CAA+D;AAC/D,sCAAyC;AACzC,
|
|
1
|
+
{"version":3,"file":"streaming.js","sourceRoot":"","sources":["src/streaming.ts"],"names":[],"mappings":";;;AAA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AAC,CAAC,EAAE,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;KACtF;IAED,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;AACvB,CAAC"}
|
package/streaming.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReadableStream } from "./_shims/index.mjs";
|
|
2
2
|
import { AnthropicError } from "./error.mjs";
|
|
3
|
-
import { LineDecoder } from "./internal/decoders/line.mjs";
|
|
3
|
+
import { findDoubleNewlineIndex, LineDecoder } from "./internal/decoders/line.mjs";
|
|
4
4
|
import { ReadableStreamToAsyncIterable } from "./internal/stream-utils.mjs";
|
|
5
5
|
import { createResponseHeaders } from "./core.mjs";
|
|
6
6
|
import { APIError } from "./error.mjs";
|
|
@@ -221,32 +221,6 @@ async function* iterSSEChunks(iterator) {
|
|
|
221
221
|
yield data;
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
-
function findDoubleNewlineIndex(buffer) {
|
|
225
|
-
// This function searches the buffer for the end patterns (\r\r, \n\n, \r\n\r\n)
|
|
226
|
-
// and returns the index right after the first occurrence of any pattern,
|
|
227
|
-
// or -1 if none of the patterns are found.
|
|
228
|
-
const newline = 0x0a; // \n
|
|
229
|
-
const carriage = 0x0d; // \r
|
|
230
|
-
for (let i = 0; i < buffer.length - 2; i++) {
|
|
231
|
-
if (buffer[i] === newline && buffer[i + 1] === newline) {
|
|
232
|
-
// \n\n
|
|
233
|
-
return i + 2;
|
|
234
|
-
}
|
|
235
|
-
if (buffer[i] === carriage && buffer[i + 1] === carriage) {
|
|
236
|
-
// \r\r
|
|
237
|
-
return i + 2;
|
|
238
|
-
}
|
|
239
|
-
if (buffer[i] === carriage &&
|
|
240
|
-
buffer[i + 1] === newline &&
|
|
241
|
-
i + 3 < buffer.length &&
|
|
242
|
-
buffer[i + 2] === carriage &&
|
|
243
|
-
buffer[i + 3] === newline) {
|
|
244
|
-
// \r\n\r\n
|
|
245
|
-
return i + 4;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
return -1;
|
|
249
|
-
}
|
|
250
224
|
class SSEDecoder {
|
|
251
225
|
constructor() {
|
|
252
226
|
this.event = null;
|
|
@@ -288,15 +262,6 @@ class SSEDecoder {
|
|
|
288
262
|
return null;
|
|
289
263
|
}
|
|
290
264
|
}
|
|
291
|
-
/** This is an internal helper function that's just used for testing */
|
|
292
|
-
export function _decodeChunks(chunks) {
|
|
293
|
-
const decoder = new LineDecoder();
|
|
294
|
-
const lines = [];
|
|
295
|
-
for (const chunk of chunks) {
|
|
296
|
-
lines.push(...decoder.decode(chunk));
|
|
297
|
-
}
|
|
298
|
-
return lines;
|
|
299
|
-
}
|
|
300
265
|
function partition(str, delimiter) {
|
|
301
266
|
const index = str.indexOf(delimiter);
|
|
302
267
|
if (index !== -1) {
|
package/streaming.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streaming.mjs","sourceRoot":"","sources":["src/streaming.ts"],"names":[],"mappings":"OAAO,EAAE,cAAc,EAAiB;OACjC,EAAE,cAAc,EAAE;OAClB,EAAE,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"streaming.mjs","sourceRoot":"","sources":["src/streaming.ts"],"names":[],"mappings":"OAAO,EAAE,cAAc,EAAiB;OACjC,EAAE,cAAc,EAAE;OAClB,EAAE,sBAAsB,EAAE,WAAW,EAAE;OACvC,EAAE,6BAA6B,EAAE;OAEjC,EAAE,qBAAqB,EAAE;OACzB,EAAE,QAAQ,EAAE;AAUnB,MAAM,OAAO,MAAM;IAGjB,YACU,QAAmC,EAC3C,UAA2B;QADnB,aAAQ,GAAR,QAAQ,CAA2B;QAG3C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED,MAAM,CAAC,eAAe,CAAO,QAAkB,EAAE,UAA2B;QAC1E,IAAI,QAAQ,G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AC,IAAI,GAAG,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;YAEjB,OAAO,GAAG,CAAC;SACZ;QAED,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEvB,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;YACxB,OAAO,IAAI,CAAC;SACb;QAED,IAAI,CAAC,SAAS,EAAE,CAAC,EAAE,KAAK,CAAC,GAAG,SAAS,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAEjD,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;YACzB,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;SAC5B;QAED,IAAI,SAAS,KAAK,OAAO,EAAE;YACzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;SACpB;aAAM,IAAI,SAAS,KAAK,MAAM,EAAE;YAC/B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACvB;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED,SAAS,SAAS,CAAC,GAAW,EAAE,SAAiB;IAC/C,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACrC,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;QAChB,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;KACtF;IAED,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;AACvB,CAAC"}
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.37.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.37.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|