@anthropic-ai/sdk 0.21.0 → 0.22.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 +27 -0
- package/README.md +1 -1
- package/index.d.mts +12 -2
- package/index.d.ts +12 -2
- package/index.d.ts.map +1 -1
- package/index.js +0 -2
- package/index.js.map +1 -1
- package/index.mjs +0 -2
- package/index.mjs.map +1 -1
- package/lib/MessageStream.d.ts +3 -2
- package/lib/MessageStream.d.ts.map +1 -1
- package/lib/MessageStream.js +25 -2
- package/lib/MessageStream.js.map +1 -1
- package/lib/MessageStream.mjs +25 -2
- package/lib/MessageStream.mjs.map +1 -1
- package/package.json +2 -2
- package/resources/index.d.ts +1 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +1 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +0 -1
- package/resources/index.mjs.map +1 -1
- package/resources/messages.d.ts +207 -213
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs.map +1 -1
- package/src/_shims/auto/runtime-bun.ts +1 -1
- package/src/_shims/auto/runtime-node.ts +1 -1
- package/src/_shims/auto/runtime.ts +1 -1
- package/src/_shims/auto/types-node.ts +1 -1
- package/src/_shims/bun-runtime.ts +2 -2
- package/src/_shims/index.d.ts +3 -3
- package/src/_shims/index.mjs +1 -1
- package/src/_shims/node-runtime.ts +3 -3
- package/src/_shims/registry.ts +1 -1
- package/src/_shims/web-runtime.ts +3 -3
- package/src/core.ts +6 -6
- package/src/error.ts +1 -1
- package/src/index.ts +17 -8
- package/src/lib/MessageStream.ts +36 -10
- package/src/resource.ts +1 -1
- package/src/resources/completions.ts +5 -5
- package/src/resources/index.ts +14 -3
- package/src/resources/messages.ts +267 -254
- package/src/shims/node.ts +3 -3
- package/src/shims/web.ts +3 -3
- package/src/streaming.ts +4 -4
- package/src/uploads.ts +4 -4
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/lib/ToolsBetaMessageStream.d.ts +0 -95
- package/lib/ToolsBetaMessageStream.d.ts.map +0 -1
- package/lib/ToolsBetaMessageStream.js +0 -459
- package/lib/ToolsBetaMessageStream.js.map +0 -1
- package/lib/ToolsBetaMessageStream.mjs +0 -455
- package/lib/ToolsBetaMessageStream.mjs.map +0 -1
- package/resources/beta/beta.d.ts +0 -9
- package/resources/beta/beta.d.ts.map +0 -1
- package/resources/beta/beta.js +0 -40
- package/resources/beta/beta.js.map +0 -1
- package/resources/beta/beta.mjs +0 -13
- package/resources/beta/beta.mjs.map +0 -1
- package/resources/beta/index.d.ts +0 -3
- package/resources/beta/index.d.ts.map +0 -1
- package/resources/beta/index.js +0 -9
- package/resources/beta/index.js.map +0 -1
- package/resources/beta/index.mjs +0 -4
- package/resources/beta/index.mjs.map +0 -1
- package/resources/beta/tools/index.d.ts +0 -3
- package/resources/beta/tools/index.d.ts.map +0 -1
- package/resources/beta/tools/index.js +0 -9
- package/resources/beta/tools/index.js.map +0 -1
- package/resources/beta/tools/index.mjs +0 -4
- package/resources/beta/tools/index.mjs.map +0 -1
- package/resources/beta/tools/messages.d.ts +0 -793
- package/resources/beta/tools/messages.d.ts.map +0 -1
- package/resources/beta/tools/messages.js +0 -29
- package/resources/beta/tools/messages.js.map +0 -1
- package/resources/beta/tools/messages.mjs +0 -24
- package/resources/beta/tools/messages.mjs.map +0 -1
- package/resources/beta/tools/tools.d.ts +0 -24
- package/resources/beta/tools/tools.d.ts.map +0 -1
- package/resources/beta/tools/tools.js +0 -40
- package/resources/beta/tools/tools.js.map +0 -1
- package/resources/beta/tools/tools.mjs +0 -13
- package/resources/beta/tools/tools.mjs.map +0 -1
- package/src/lib/ToolsBetaMessageStream.ts +0 -561
- package/src/resources/beta/beta.ts +0 -12
- package/src/resources/beta/index.ts +0 -4
- package/src/resources/beta/tools/index.ts +0 -21
- package/src/resources/beta/tools/messages.ts +0 -907
- package/src/resources/beta/tools/tools.ts +0 -27
package/resources/messages.d.ts
CHANGED
|
@@ -12,32 +12,21 @@ export declare class Messages extends APIResource {
|
|
|
12
12
|
* Send a structured list of input messages with text and/or image content, and the
|
|
13
13
|
* model will generate the next message in the conversation.
|
|
14
14
|
*
|
|
15
|
-
* The Messages API can be used for
|
|
16
|
-
*
|
|
15
|
+
* The Messages API can be used for either single queries or stateless multi-turn
|
|
16
|
+
* conversations.
|
|
17
17
|
*/
|
|
18
18
|
create(body: MessageCreateParamsNonStreaming, options?: Core.RequestOptions): APIPromise<Message>;
|
|
19
|
-
create(body: MessageCreateParamsStreaming, options?: Core.RequestOptions): APIPromise<Stream<
|
|
20
|
-
create(body: MessageCreateParamsBase, options?: Core.RequestOptions): APIPromise<Stream<
|
|
19
|
+
create(body: MessageCreateParamsStreaming, options?: Core.RequestOptions): APIPromise<Stream<RawMessageStreamEvent>>;
|
|
20
|
+
create(body: MessageCreateParamsBase, options?: Core.RequestOptions): APIPromise<Stream<RawMessageStreamEvent> | Message>;
|
|
21
21
|
/**
|
|
22
22
|
* Create a Message stream
|
|
23
23
|
*/
|
|
24
24
|
stream(body: MessageStreamParams, options?: Core.RequestOptions): MessageStream;
|
|
25
25
|
}
|
|
26
|
-
export type ContentBlock = TextBlock;
|
|
27
|
-
export
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
type: 'content_block_delta';
|
|
31
|
-
}
|
|
32
|
-
export interface ContentBlockStartEvent {
|
|
33
|
-
content_block: TextBlock;
|
|
34
|
-
index: number;
|
|
35
|
-
type: 'content_block_start';
|
|
36
|
-
}
|
|
37
|
-
export interface ContentBlockStopEvent {
|
|
38
|
-
index: number;
|
|
39
|
-
type: 'content_block_stop';
|
|
40
|
-
}
|
|
26
|
+
export type ContentBlock = TextBlock | ToolUseBlock;
|
|
27
|
+
export type ContentBlockDeltaEvent = RawContentBlockDeltaEvent;
|
|
28
|
+
export type ContentBlockStartEvent = RawContentBlockStartEvent;
|
|
29
|
+
export type ContentBlockStopEvent = RawContentBlockStopEvent;
|
|
41
30
|
export interface ImageBlockParam {
|
|
42
31
|
source: ImageBlockParam.Source;
|
|
43
32
|
type: 'image';
|
|
@@ -49,6 +38,10 @@ export declare namespace ImageBlockParam {
|
|
|
49
38
|
type: 'base64';
|
|
50
39
|
}
|
|
51
40
|
}
|
|
41
|
+
export interface InputJsonDelta {
|
|
42
|
+
partial_json: string;
|
|
43
|
+
type: 'input_json_delta';
|
|
44
|
+
}
|
|
52
45
|
export interface Message {
|
|
53
46
|
/**
|
|
54
47
|
* Unique object identifier.
|
|
@@ -60,7 +53,7 @@ export interface Message {
|
|
|
60
53
|
* Content generated by the model.
|
|
61
54
|
*
|
|
62
55
|
* This is an array of content blocks, each of which has a `type` that determines
|
|
63
|
-
* its shape.
|
|
56
|
+
* its shape.
|
|
64
57
|
*
|
|
65
58
|
* Example:
|
|
66
59
|
*
|
|
@@ -90,7 +83,7 @@ export interface Message {
|
|
|
90
83
|
* [{ "type": "text", "text": "B)" }]
|
|
91
84
|
* ```
|
|
92
85
|
*/
|
|
93
|
-
content: Array<
|
|
86
|
+
content: Array<ContentBlock>;
|
|
94
87
|
/**
|
|
95
88
|
* The model that handled the request.
|
|
96
89
|
*/
|
|
@@ -109,11 +102,12 @@ export interface Message {
|
|
|
109
102
|
* - `"end_turn"`: the model reached a natural stopping point
|
|
110
103
|
* - `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
|
|
111
104
|
* - `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
|
|
105
|
+
* - `"tool_use"`: the model invoked one or more tools
|
|
112
106
|
*
|
|
113
107
|
* In non-streaming mode this value is always non-null. In streaming mode, it is
|
|
114
108
|
* null in the `message_start` event and non-null otherwise.
|
|
115
109
|
*/
|
|
116
|
-
stop_reason: 'end_turn' | 'max_tokens' | 'stop_sequence' | null;
|
|
110
|
+
stop_reason: 'end_turn' | 'max_tokens' | 'stop_sequence' | 'tool_use' | null;
|
|
117
111
|
/**
|
|
118
112
|
* Which custom stop sequence was generated, if any.
|
|
119
113
|
*
|
|
@@ -143,8 +137,36 @@ export interface Message {
|
|
|
143
137
|
*/
|
|
144
138
|
usage: Usage;
|
|
145
139
|
}
|
|
146
|
-
export
|
|
147
|
-
|
|
140
|
+
export type MessageDeltaEvent = RawMessageDeltaEvent;
|
|
141
|
+
export interface MessageDeltaUsage {
|
|
142
|
+
/**
|
|
143
|
+
* The cumulative number of output tokens which were used.
|
|
144
|
+
*/
|
|
145
|
+
output_tokens: number;
|
|
146
|
+
}
|
|
147
|
+
export interface MessageParam {
|
|
148
|
+
content: string | Array<TextBlockParam | ImageBlockParam | ToolUseBlockParam | ToolResultBlockParam>;
|
|
149
|
+
role: 'user' | 'assistant';
|
|
150
|
+
}
|
|
151
|
+
export type MessageStartEvent = RawMessageStartEvent;
|
|
152
|
+
export type MessageStopEvent = RawMessageStopEvent;
|
|
153
|
+
export type MessageStreamEvent = RawMessageStreamEvent;
|
|
154
|
+
export interface RawContentBlockDeltaEvent {
|
|
155
|
+
delta: TextDelta | InputJsonDelta;
|
|
156
|
+
index: number;
|
|
157
|
+
type: 'content_block_delta';
|
|
158
|
+
}
|
|
159
|
+
export interface RawContentBlockStartEvent {
|
|
160
|
+
content_block: TextBlock | ToolUseBlock;
|
|
161
|
+
index: number;
|
|
162
|
+
type: 'content_block_start';
|
|
163
|
+
}
|
|
164
|
+
export interface RawContentBlockStopEvent {
|
|
165
|
+
index: number;
|
|
166
|
+
type: 'content_block_stop';
|
|
167
|
+
}
|
|
168
|
+
export interface RawMessageDeltaEvent {
|
|
169
|
+
delta: RawMessageDeltaEvent.Delta;
|
|
148
170
|
type: 'message_delta';
|
|
149
171
|
/**
|
|
150
172
|
* Billing and rate-limit usage.
|
|
@@ -162,30 +184,20 @@ export interface MessageDeltaEvent {
|
|
|
162
184
|
*/
|
|
163
185
|
usage: MessageDeltaUsage;
|
|
164
186
|
}
|
|
165
|
-
export declare namespace
|
|
187
|
+
export declare namespace RawMessageDeltaEvent {
|
|
166
188
|
interface Delta {
|
|
167
|
-
stop_reason: 'end_turn' | 'max_tokens' | 'stop_sequence' | null;
|
|
189
|
+
stop_reason: 'end_turn' | 'max_tokens' | 'stop_sequence' | 'tool_use' | null;
|
|
168
190
|
stop_sequence: string | null;
|
|
169
191
|
}
|
|
170
192
|
}
|
|
171
|
-
export interface
|
|
172
|
-
/**
|
|
173
|
-
* The cumulative number of output tokens which were used.
|
|
174
|
-
*/
|
|
175
|
-
output_tokens: number;
|
|
176
|
-
}
|
|
177
|
-
export interface MessageParam {
|
|
178
|
-
content: string | Array<TextBlockParam | ImageBlockParam>;
|
|
179
|
-
role: 'user' | 'assistant';
|
|
180
|
-
}
|
|
181
|
-
export interface MessageStartEvent {
|
|
193
|
+
export interface RawMessageStartEvent {
|
|
182
194
|
message: Message;
|
|
183
195
|
type: 'message_start';
|
|
184
196
|
}
|
|
185
|
-
export interface
|
|
197
|
+
export interface RawMessageStopEvent {
|
|
186
198
|
type: 'message_stop';
|
|
187
199
|
}
|
|
188
|
-
export type
|
|
200
|
+
export type RawMessageStreamEvent = RawMessageStartEvent | RawMessageDeltaEvent | RawMessageStopEvent | RawContentBlockStartEvent | RawContentBlockDeltaEvent | RawContentBlockStopEvent;
|
|
189
201
|
export interface TextBlock {
|
|
190
202
|
text: string;
|
|
191
203
|
type: 'text';
|
|
@@ -198,6 +210,56 @@ export interface TextDelta {
|
|
|
198
210
|
text: string;
|
|
199
211
|
type: 'text_delta';
|
|
200
212
|
}
|
|
213
|
+
export interface Tool {
|
|
214
|
+
/**
|
|
215
|
+
* [JSON schema](https://json-schema.org/) for this tool's input.
|
|
216
|
+
*
|
|
217
|
+
* This defines the shape of the `input` that your tool accepts and that the model
|
|
218
|
+
* will produce.
|
|
219
|
+
*/
|
|
220
|
+
input_schema: Tool.InputSchema;
|
|
221
|
+
name: string;
|
|
222
|
+
/**
|
|
223
|
+
* Description of what this tool does.
|
|
224
|
+
*
|
|
225
|
+
* Tool descriptions should be as detailed as possible. The more information that
|
|
226
|
+
* the model has about what the tool is and how to use it, the better it will
|
|
227
|
+
* perform. You can use natural language descriptions to reinforce important
|
|
228
|
+
* aspects of the tool input JSON schema.
|
|
229
|
+
*/
|
|
230
|
+
description?: string;
|
|
231
|
+
}
|
|
232
|
+
export declare namespace Tool {
|
|
233
|
+
/**
|
|
234
|
+
* [JSON schema](https://json-schema.org/) for this tool's input.
|
|
235
|
+
*
|
|
236
|
+
* This defines the shape of the `input` that your tool accepts and that the model
|
|
237
|
+
* will produce.
|
|
238
|
+
*/
|
|
239
|
+
interface InputSchema {
|
|
240
|
+
type: 'object';
|
|
241
|
+
properties?: unknown | null;
|
|
242
|
+
[k: string]: unknown;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
export interface ToolResultBlockParam {
|
|
246
|
+
tool_use_id: string;
|
|
247
|
+
type: 'tool_result';
|
|
248
|
+
content?: Array<TextBlockParam | ImageBlockParam>;
|
|
249
|
+
is_error?: boolean;
|
|
250
|
+
}
|
|
251
|
+
export interface ToolUseBlock {
|
|
252
|
+
id: string;
|
|
253
|
+
input: unknown;
|
|
254
|
+
name: string;
|
|
255
|
+
type: 'tool_use';
|
|
256
|
+
}
|
|
257
|
+
export interface ToolUseBlockParam {
|
|
258
|
+
id: string;
|
|
259
|
+
input: unknown;
|
|
260
|
+
name: string;
|
|
261
|
+
type: 'tool_use';
|
|
262
|
+
}
|
|
201
263
|
export interface Usage {
|
|
202
264
|
/**
|
|
203
265
|
* The number of input tokens which were used.
|
|
@@ -358,204 +420,81 @@ export interface MessageCreateParamsBase {
|
|
|
358
420
|
*/
|
|
359
421
|
temperature?: number;
|
|
360
422
|
/**
|
|
361
|
-
*
|
|
362
|
-
*
|
|
363
|
-
* Used to remove "long tail" low probability responses.
|
|
364
|
-
* [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
|
|
365
|
-
*
|
|
366
|
-
* Recommended for advanced use cases only. You usually only need to use
|
|
367
|
-
* `temperature`.
|
|
423
|
+
* How the model should use the provided tools. The model can use a specific tool,
|
|
424
|
+
* any available tool, or decide by itself.
|
|
368
425
|
*/
|
|
369
|
-
|
|
426
|
+
tool_choice?: MessageCreateParams.ToolChoiceAuto | MessageCreateParams.ToolChoiceAny | MessageCreateParams.ToolChoiceTool;
|
|
370
427
|
/**
|
|
371
|
-
*
|
|
428
|
+
* Definitions of tools that the model may use.
|
|
372
429
|
*
|
|
373
|
-
*
|
|
374
|
-
*
|
|
375
|
-
*
|
|
376
|
-
*
|
|
430
|
+
* If you include `tools` in your API request, the model may return `tool_use`
|
|
431
|
+
* content blocks that represent the model's use of those tools. You can then run
|
|
432
|
+
* those tools using the tool input generated by the model and then optionally
|
|
433
|
+
* return results back to the model using `tool_result` content blocks.
|
|
377
434
|
*
|
|
378
|
-
*
|
|
379
|
-
* `temperature`.
|
|
380
|
-
*/
|
|
381
|
-
top_p?: number;
|
|
382
|
-
}
|
|
383
|
-
export declare namespace MessageCreateParams {
|
|
384
|
-
/**
|
|
385
|
-
* An object describing metadata about the request.
|
|
386
|
-
*/
|
|
387
|
-
interface Metadata {
|
|
388
|
-
/**
|
|
389
|
-
* An external identifier for the user who is associated with the request.
|
|
390
|
-
*
|
|
391
|
-
* This should be a uuid, hash value, or other opaque identifier. Anthropic may use
|
|
392
|
-
* this id to help detect abuse. Do not include any identifying information such as
|
|
393
|
-
* name, email address, or phone number.
|
|
394
|
-
*/
|
|
395
|
-
user_id?: string | null;
|
|
396
|
-
}
|
|
397
|
-
type MessageCreateParamsNonStreaming = MessagesAPI.MessageCreateParamsNonStreaming;
|
|
398
|
-
type MessageCreateParamsStreaming = MessagesAPI.MessageCreateParamsStreaming;
|
|
399
|
-
}
|
|
400
|
-
export interface MessageCreateParamsNonStreaming extends MessageCreateParamsBase {
|
|
401
|
-
/**
|
|
402
|
-
* Whether to incrementally stream the response using server-sent events.
|
|
435
|
+
* Each tool definition includes:
|
|
403
436
|
*
|
|
404
|
-
*
|
|
405
|
-
*
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
}
|
|
409
|
-
export interface MessageCreateParamsStreaming extends MessageCreateParamsBase {
|
|
410
|
-
/**
|
|
411
|
-
* Whether to incrementally stream the response using server-sent events.
|
|
412
|
-
*
|
|
413
|
-
* See [streaming](https://docs.anthropic.com/en/api/messages-streaming) for
|
|
414
|
-
* details.
|
|
415
|
-
*/
|
|
416
|
-
stream: true;
|
|
417
|
-
}
|
|
418
|
-
export interface MessageStreamParams {
|
|
419
|
-
/**
|
|
420
|
-
* The maximum number of tokens to generate before stopping.
|
|
421
|
-
*
|
|
422
|
-
* Note that our models may stop _before_ reaching this maximum. This parameter
|
|
423
|
-
* only specifies the absolute maximum number of tokens to generate.
|
|
424
|
-
*
|
|
425
|
-
* Different models have different maximum values for this parameter. See
|
|
426
|
-
* [models](https://docs.anthropic.com/en/docs/models-overview) for details.
|
|
427
|
-
*/
|
|
428
|
-
max_tokens: number;
|
|
429
|
-
/**
|
|
430
|
-
* Input messages.
|
|
431
|
-
*
|
|
432
|
-
* Our models are trained to operate on alternating `user` and `assistant`
|
|
433
|
-
* conversational turns. When creating a new `Message`, you specify the prior
|
|
434
|
-
* conversational turns with the `messages` parameter, and the model then generates
|
|
435
|
-
* the next `Message` in the conversation.
|
|
437
|
+
* - `name`: Name of the tool.
|
|
438
|
+
* - `description`: Optional, but strongly-recommended description of the tool.
|
|
439
|
+
* - `input_schema`: [JSON schema](https://json-schema.org/) for the tool `input`
|
|
440
|
+
* shape that the model will produce in `tool_use` output content blocks.
|
|
436
441
|
*
|
|
437
|
-
*
|
|
438
|
-
* specify a single `user`-role message, or you can include multiple `user` and
|
|
439
|
-
* `assistant` messages. The first message must always use the `user` role.
|
|
440
|
-
*
|
|
441
|
-
* If the final message uses the `assistant` role, the response content will
|
|
442
|
-
* continue immediately from the content in that message. This can be used to
|
|
443
|
-
* constrain part of the model's response.
|
|
444
|
-
*
|
|
445
|
-
* Example with a single `user` message:
|
|
446
|
-
*
|
|
447
|
-
* ```json
|
|
448
|
-
* [{ "role": "user", "content": "Hello, Claude" }]
|
|
449
|
-
* ```
|
|
450
|
-
*
|
|
451
|
-
* Example with multiple conversational turns:
|
|
442
|
+
* For example, if you defined `tools` as:
|
|
452
443
|
*
|
|
453
444
|
* ```json
|
|
454
445
|
* [
|
|
455
|
-
* {
|
|
456
|
-
*
|
|
457
|
-
*
|
|
446
|
+
* {
|
|
447
|
+
* "name": "get_stock_price",
|
|
448
|
+
* "description": "Get the current stock price for a given ticker symbol.",
|
|
449
|
+
* "input_schema": {
|
|
450
|
+
* "type": "object",
|
|
451
|
+
* "properties": {
|
|
452
|
+
* "ticker": {
|
|
453
|
+
* "type": "string",
|
|
454
|
+
* "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
|
|
455
|
+
* }
|
|
456
|
+
* },
|
|
457
|
+
* "required": ["ticker"]
|
|
458
|
+
* }
|
|
459
|
+
* }
|
|
458
460
|
* ]
|
|
459
461
|
* ```
|
|
460
462
|
*
|
|
461
|
-
*
|
|
463
|
+
* And then asked the model "What's the S&P 500 at today?", the model might produce
|
|
464
|
+
* `tool_use` content blocks in the response like this:
|
|
462
465
|
*
|
|
463
466
|
* ```json
|
|
464
467
|
* [
|
|
465
468
|
* {
|
|
466
|
-
* "
|
|
467
|
-
* "
|
|
468
|
-
*
|
|
469
|
-
*
|
|
469
|
+
* "type": "tool_use",
|
|
470
|
+
* "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
|
|
471
|
+
* "name": "get_stock_price",
|
|
472
|
+
* "input": { "ticker": "^GSPC" }
|
|
473
|
+
* }
|
|
470
474
|
* ]
|
|
471
475
|
* ```
|
|
472
476
|
*
|
|
473
|
-
*
|
|
474
|
-
*
|
|
475
|
-
*
|
|
476
|
-
* following input messages are equivalent:
|
|
477
|
-
*
|
|
478
|
-
* ```json
|
|
479
|
-
* { "role": "user", "content": "Hello, Claude" }
|
|
480
|
-
* ```
|
|
481
|
-
*
|
|
482
|
-
* ```json
|
|
483
|
-
* { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
|
|
484
|
-
* ```
|
|
485
|
-
*
|
|
486
|
-
* Starting with Claude 3 models, you can also send image content blocks:
|
|
477
|
+
* You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an
|
|
478
|
+
* input, and return the following back to the model in a subsequent `user`
|
|
479
|
+
* message:
|
|
487
480
|
*
|
|
488
481
|
* ```json
|
|
489
|
-
*
|
|
490
|
-
*
|
|
491
|
-
*
|
|
492
|
-
*
|
|
493
|
-
*
|
|
494
|
-
*
|
|
495
|
-
*
|
|
496
|
-
* "media_type": "image/jpeg",
|
|
497
|
-
* "data": "/9j/4AAQSkZJRg..."
|
|
498
|
-
* }
|
|
499
|
-
* },
|
|
500
|
-
* { "type": "text", "text": "What is in this image?" }
|
|
501
|
-
* ]
|
|
502
|
-
* }
|
|
482
|
+
* [
|
|
483
|
+
* {
|
|
484
|
+
* "type": "tool_result",
|
|
485
|
+
* "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
|
|
486
|
+
* "content": "259.75 USD"
|
|
487
|
+
* }
|
|
488
|
+
* ]
|
|
503
489
|
* ```
|
|
504
490
|
*
|
|
505
|
-
*
|
|
506
|
-
*
|
|
507
|
-
*
|
|
508
|
-
* See [examples](https://docs.anthropic.com/en/api/messages-examples) for more
|
|
509
|
-
* input examples.
|
|
510
|
-
*
|
|
511
|
-
* Note that if you want to include a
|
|
512
|
-
* [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
|
|
513
|
-
* the top-level `system` parameter — there is no `"system"` role for input
|
|
514
|
-
* messages in the Messages API.
|
|
515
|
-
*/
|
|
516
|
-
messages: Array<MessageParam>;
|
|
517
|
-
/**
|
|
518
|
-
* The model that will complete your prompt.
|
|
519
|
-
*
|
|
520
|
-
* See [models](https://docs.anthropic.com/en/docs/models-overview) for additional
|
|
521
|
-
* details and options.
|
|
522
|
-
*/
|
|
523
|
-
model: (string & {}) | 'claude-3-opus-20240229' | 'claude-3-sonnet-20240229' | 'claude-3-haiku-20240307' | 'claude-2.1' | 'claude-2.0' | 'claude-instant-1.2';
|
|
524
|
-
/**
|
|
525
|
-
* An object describing metadata about the request.
|
|
526
|
-
*/
|
|
527
|
-
metadata?: MessageStreamParams.Metadata;
|
|
528
|
-
/**
|
|
529
|
-
* Custom text sequences that will cause the model to stop generating.
|
|
530
|
-
*
|
|
531
|
-
* Our models will normally stop when they have naturally completed their turn,
|
|
532
|
-
* which will result in a response `stop_reason` of `"end_turn"`.
|
|
491
|
+
* Tools can be used for workflows that include running client-side tools and
|
|
492
|
+
* functions, or more generally whenever you want the model to produce a particular
|
|
493
|
+
* JSON structure of output.
|
|
533
494
|
*
|
|
534
|
-
*
|
|
535
|
-
* text, you can use the `stop_sequences` parameter. If the model encounters one of
|
|
536
|
-
* the custom sequences, the response `stop_reason` value will be `"stop_sequence"`
|
|
537
|
-
* and the response `stop_sequence` value will contain the matched stop sequence.
|
|
495
|
+
* See our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details.
|
|
538
496
|
*/
|
|
539
|
-
|
|
540
|
-
/**
|
|
541
|
-
* System prompt.
|
|
542
|
-
*
|
|
543
|
-
* A system prompt is a way of providing context and instructions to Claude, such
|
|
544
|
-
* as specifying a particular goal or role. See our
|
|
545
|
-
* [guide to system prompts](https://docs.anthropic.com/en/docs/system-prompts).
|
|
546
|
-
*/
|
|
547
|
-
system?: string;
|
|
548
|
-
/**
|
|
549
|
-
* Amount of randomness injected into the response.
|
|
550
|
-
*
|
|
551
|
-
* Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0`
|
|
552
|
-
* for analytical / multiple choice, and closer to `1.0` for creative and
|
|
553
|
-
* generative tasks.
|
|
554
|
-
*
|
|
555
|
-
* Note that even with `temperature` of `0.0`, the results will not be fully
|
|
556
|
-
* deterministic.
|
|
557
|
-
*/
|
|
558
|
-
temperature?: number;
|
|
497
|
+
tools?: Array<Tool>;
|
|
559
498
|
/**
|
|
560
499
|
* Only sample from the top K options for each subsequent token.
|
|
561
500
|
*
|
|
@@ -579,7 +518,7 @@ export interface MessageStreamParams {
|
|
|
579
518
|
*/
|
|
580
519
|
top_p?: number;
|
|
581
520
|
}
|
|
582
|
-
export declare namespace
|
|
521
|
+
export declare namespace MessageCreateParams {
|
|
583
522
|
/**
|
|
584
523
|
* An object describing metadata about the request.
|
|
585
524
|
*/
|
|
@@ -593,13 +532,57 @@ export declare namespace MessageStreamParams {
|
|
|
593
532
|
*/
|
|
594
533
|
user_id?: string | null;
|
|
595
534
|
}
|
|
535
|
+
/**
|
|
536
|
+
* The model will automatically decide whether to use tools.
|
|
537
|
+
*/
|
|
538
|
+
interface ToolChoiceAuto {
|
|
539
|
+
type: 'auto';
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* The model will use any available tools.
|
|
543
|
+
*/
|
|
544
|
+
interface ToolChoiceAny {
|
|
545
|
+
type: 'any';
|
|
546
|
+
}
|
|
547
|
+
/**
|
|
548
|
+
* The model will use the specified tool with `tool_choice.name`.
|
|
549
|
+
*/
|
|
550
|
+
interface ToolChoiceTool {
|
|
551
|
+
/**
|
|
552
|
+
* The name of the tool to use.
|
|
553
|
+
*/
|
|
554
|
+
name: string;
|
|
555
|
+
type: 'tool';
|
|
556
|
+
}
|
|
557
|
+
type MessageCreateParamsNonStreaming = MessagesAPI.MessageCreateParamsNonStreaming;
|
|
558
|
+
type MessageCreateParamsStreaming = MessagesAPI.MessageCreateParamsStreaming;
|
|
559
|
+
}
|
|
560
|
+
export interface MessageCreateParamsNonStreaming extends MessageCreateParamsBase {
|
|
561
|
+
/**
|
|
562
|
+
* Whether to incrementally stream the response using server-sent events.
|
|
563
|
+
*
|
|
564
|
+
* See [streaming](https://docs.anthropic.com/en/api/messages-streaming) for
|
|
565
|
+
* details.
|
|
566
|
+
*/
|
|
567
|
+
stream?: false;
|
|
568
|
+
}
|
|
569
|
+
export interface MessageCreateParamsStreaming extends MessageCreateParamsBase {
|
|
570
|
+
/**
|
|
571
|
+
* Whether to incrementally stream the response using server-sent events.
|
|
572
|
+
*
|
|
573
|
+
* See [streaming](https://docs.anthropic.com/en/api/messages-streaming) for
|
|
574
|
+
* details.
|
|
575
|
+
*/
|
|
576
|
+
stream: true;
|
|
596
577
|
}
|
|
578
|
+
export type MessageStreamParams = MessageCreateParamsBase;
|
|
597
579
|
export declare namespace Messages {
|
|
598
580
|
export import ContentBlock = MessagesAPI.ContentBlock;
|
|
599
581
|
export import ContentBlockDeltaEvent = MessagesAPI.ContentBlockDeltaEvent;
|
|
600
582
|
export import ContentBlockStartEvent = MessagesAPI.ContentBlockStartEvent;
|
|
601
583
|
export import ContentBlockStopEvent = MessagesAPI.ContentBlockStopEvent;
|
|
602
584
|
export import ImageBlockParam = MessagesAPI.ImageBlockParam;
|
|
585
|
+
export import InputJsonDelta = MessagesAPI.InputJsonDelta;
|
|
603
586
|
export import Message = MessagesAPI.Message;
|
|
604
587
|
export import MessageDeltaEvent = MessagesAPI.MessageDeltaEvent;
|
|
605
588
|
export import MessageDeltaUsage = MessagesAPI.MessageDeltaUsage;
|
|
@@ -607,9 +590,20 @@ export declare namespace Messages {
|
|
|
607
590
|
export import MessageStartEvent = MessagesAPI.MessageStartEvent;
|
|
608
591
|
export import MessageStopEvent = MessagesAPI.MessageStopEvent;
|
|
609
592
|
export import MessageStreamEvent = MessagesAPI.MessageStreamEvent;
|
|
593
|
+
export import RawContentBlockDeltaEvent = MessagesAPI.RawContentBlockDeltaEvent;
|
|
594
|
+
export import RawContentBlockStartEvent = MessagesAPI.RawContentBlockStartEvent;
|
|
595
|
+
export import RawContentBlockStopEvent = MessagesAPI.RawContentBlockStopEvent;
|
|
596
|
+
export import RawMessageDeltaEvent = MessagesAPI.RawMessageDeltaEvent;
|
|
597
|
+
export import RawMessageStartEvent = MessagesAPI.RawMessageStartEvent;
|
|
598
|
+
export import RawMessageStopEvent = MessagesAPI.RawMessageStopEvent;
|
|
599
|
+
export import RawMessageStreamEvent = MessagesAPI.RawMessageStreamEvent;
|
|
610
600
|
export import TextBlock = MessagesAPI.TextBlock;
|
|
611
601
|
export import TextBlockParam = MessagesAPI.TextBlockParam;
|
|
612
602
|
export import TextDelta = MessagesAPI.TextDelta;
|
|
603
|
+
export import Tool = MessagesAPI.Tool;
|
|
604
|
+
export import ToolResultBlockParam = MessagesAPI.ToolResultBlockParam;
|
|
605
|
+
export import ToolUseBlock = MessagesAPI.ToolUseBlock;
|
|
606
|
+
export import ToolUseBlockParam = MessagesAPI.ToolUseBlockParam;
|
|
613
607
|
export import Usage = MessagesAPI.Usage;
|
|
614
608
|
export import MessageCreateParams = MessagesAPI.MessageCreateParams;
|
|
615
609
|
export import MessageCreateParamsNonStreaming = MessagesAPI.MessageCreateParamsNonStreaming;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,KAAK,WAAW,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAErD,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;OAQG;IACH,MAAM,CAAC,IAAI,EAAE,+BAA+B,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IACjG,MAAM,CACJ,IAAI,EAAE,4BAA4B,EAClC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,UAAU,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["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ACzD,uEAAoE;AACpE,qEAAoE;AAA3D,8GAAA,aAAa,OAAA;AAItB,MAAa,QAAS,SAAQ,sBAAW;IAmBvC,MAAM,CACJ,IAAyB,EACzB,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE;YACvC,IAAI;YACJ,OAAO,EAAE,MAAM;YACf,GAAG,OAAO;YACV,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,KAAK;SAC7B,
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAItF,yDAAyD;AACzD,uEAAoE;AACpE,qEAAoE;AAA3D,8GAAA,aAAa,OAAA;AAItB,MAAa,QAAS,SAAQ,sBAAW;IAmBvC,MAAM,CACJ,IAAyB,EACzB,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE;YACvC,IAAI;YACJ,OAAO,EAAE,MAAM;YACf,GAAG,OAAO;YACV,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,KAAK;SAC7B,CAAoE,CAAC;IACxE,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,IAAyB,EAAE,OAA6B;QAC7D,OAAO,6BAAa,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;CACF;AArCD,4BAqCC;AAqpBD,WAAiB,QAAQ;AAiCzB,CAAC,EAjCgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAiCxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.mjs","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAI/E,EAAE,WAAW,EAAE,MAAM,4BAA4B;OACjD,EAAE,aAAa,EAAE,MAAM,qCAAqC;OAC5D,EAAE,aAAa,EAAE,MAAM,qCAAqC;AAInE,MAAM,OAAO,QAAS,SAAQ,WAAW;IAmBvC,MAAM,CACJ,IAAyB,EACzB,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE;YACvC,IAAI;YACJ,OAAO,EAAE,MAAM;YACf,GAAG,OAAO;YACV,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,KAAK;SAC7B,
|
|
1
|
+
{"version":3,"file":"messages.mjs","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAI/E,EAAE,WAAW,EAAE,MAAM,4BAA4B;OACjD,EAAE,aAAa,EAAE,MAAM,qCAAqC;OAC5D,EAAE,aAAa,EAAE,MAAM,qCAAqC;AAInE,MAAM,OAAO,QAAS,SAAQ,WAAW;IAmBvC,MAAM,CACJ,IAAyB,EACzB,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE;YACvC,IAAI;YACJ,OAAO,EAAE,MAAM;YACf,GAAG,OAAO;YACV,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,KAAK;SAC7B,CAAoE,CAAC;IACxE,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,IAAyB,EAAE,OAA6B;QAC7D,OAAO,aAAa,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;CACF;AAqpBD,WAAiB,QAAQ;AAiCzB,CAAC,EAjCgB,QAAQ,KAAR,QAAQ,QAiCxB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
3
|
*/
|
|
4
|
-
import { type Shims } from
|
|
5
|
-
import { getRuntime as getWebRuntime } from
|
|
4
|
+
import { type Shims } from "./registry.js";
|
|
5
|
+
import { getRuntime as getWebRuntime } from "./web-runtime.js";
|
|
6
6
|
import { ReadStream as FsReadStream } from 'node:fs';
|
|
7
7
|
|
|
8
8
|
export function getRuntime(): Shims {
|