@anthropic-ai/sdk 0.53.0 → 0.55.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 +49 -0
- package/README.md +3 -4
- package/client.d.mts +8 -5
- package/client.d.mts.map +1 -1
- package/client.d.ts +8 -5
- package/client.d.ts.map +1 -1
- package/client.js +31 -24
- package/client.js.map +1 -1
- package/client.mjs +20 -13
- package/client.mjs.map +1 -1
- package/core/resource.d.mts +1 -1
- package/core/resource.d.mts.map +1 -1
- package/core/resource.d.ts +1 -1
- package/core/resource.d.ts.map +1 -1
- package/core/resource.js.map +1 -1
- package/core/resource.mjs.map +1 -1
- package/internal/headers.d.mts.map +1 -1
- package/internal/headers.d.ts.map +1 -1
- package/internal/headers.js +3 -3
- package/internal/headers.js.map +1 -1
- package/internal/headers.mjs +3 -3
- package/internal/headers.mjs.map +1 -1
- package/internal/request-options.d.mts +1 -0
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts +1 -0
- package/internal/request-options.d.ts.map +1 -1
- package/internal/request-options.js.map +1 -1
- package/internal/request-options.mjs.map +1 -1
- package/internal/uploads.js +1 -1
- package/internal/uploads.js.map +1 -1
- package/internal/uploads.mjs +1 -1
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/log.js +1 -1
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +1 -1
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/path.d.mts.map +1 -1
- package/internal/utils/path.d.ts.map +1 -1
- package/internal/utils/path.js.map +1 -1
- package/internal/utils/path.mjs +1 -1
- package/internal/utils/path.mjs.map +1 -1
- package/internal/utils/values.d.mts +2 -0
- package/internal/utils/values.d.mts.map +1 -1
- package/internal/utils/values.d.ts +2 -0
- package/internal/utils/values.d.ts.map +1 -1
- package/internal/utils/values.js +4 -1
- package/internal/utils/values.js.map +1 -1
- package/internal/utils/values.mjs +2 -0
- package/internal/utils/values.mjs.map +1 -1
- package/lib/BetaMessageStream.d.mts.map +1 -1
- package/lib/BetaMessageStream.d.ts.map +1 -1
- package/lib/BetaMessageStream.js +45 -21
- package/lib/BetaMessageStream.js.map +1 -1
- package/lib/BetaMessageStream.mjs +45 -21
- package/lib/BetaMessageStream.mjs.map +1 -1
- package/lib/MessageStream.d.mts.map +1 -1
- package/lib/MessageStream.d.ts.map +1 -1
- package/lib/MessageStream.js +38 -20
- package/lib/MessageStream.js.map +1 -1
- package/lib/MessageStream.mjs +38 -20
- package/lib/MessageStream.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/beta/beta.d.mts +2 -2
- package/resources/beta/beta.d.mts.map +1 -1
- package/resources/beta/beta.d.ts +2 -2
- 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.mts +1 -1
- package/resources/beta/index.d.mts.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/index.d.mts +1 -1
- package/resources/beta/messages/index.d.mts.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.mts +17 -13
- package/resources/beta/messages/messages.d.mts.map +1 -1
- package/resources/beta/messages/messages.d.ts +17 -13
- package/resources/beta/messages/messages.d.ts.map +1 -1
- package/resources/beta/messages/messages.js.map +1 -1
- package/resources/beta/messages/messages.mjs.map +1 -1
- package/src/client.ts +34 -13
- package/src/core/resource.ts +1 -1
- package/src/internal/headers.ts +4 -4
- package/src/internal/request-options.ts +1 -0
- package/src/internal/uploads.ts +2 -2
- package/src/internal/utils/log.ts +1 -1
- package/src/internal/utils/path.ts +1 -1
- package/src/internal/utils/values.ts +3 -0
- package/src/lib/BetaMessageStream.ts +46 -23
- package/src/lib/MessageStream.ts +38 -22
- package/src/resources/beta/beta.ts +3 -1
- package/src/resources/beta/index.ts +2 -1
- package/src/resources/beta/messages/index.ts +2 -1
- package/src/resources/beta/messages/messages.ts +30 -24
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/src/core/resource.ts
CHANGED
package/src/internal/headers.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
import { isReadonlyArray } from './utils/values';
|
|
4
|
+
|
|
3
5
|
type HeaderValue = string | undefined | null;
|
|
4
6
|
export type HeadersLike =
|
|
5
7
|
| Headers
|
|
@@ -27,8 +29,6 @@ export type NullableHeaders = {
|
|
|
27
29
|
nulls: Set<string>;
|
|
28
30
|
};
|
|
29
31
|
|
|
30
|
-
const isArray = Array.isArray as (val: unknown) => val is readonly unknown[];
|
|
31
|
-
|
|
32
32
|
function* iterateHeaders(headers: HeadersLike): IterableIterator<readonly [string, string | null]> {
|
|
33
33
|
if (!headers) return;
|
|
34
34
|
|
|
@@ -45,7 +45,7 @@ function* iterateHeaders(headers: HeadersLike): IterableIterator<readonly [strin
|
|
|
45
45
|
let iter: Iterable<readonly (HeaderValue | readonly HeaderValue[])[]>;
|
|
46
46
|
if (headers instanceof Headers) {
|
|
47
47
|
iter = headers.entries();
|
|
48
|
-
} else if (
|
|
48
|
+
} else if (isReadonlyArray(headers)) {
|
|
49
49
|
iter = headers;
|
|
50
50
|
} else {
|
|
51
51
|
shouldClear = true;
|
|
@@ -54,7 +54,7 @@ function* iterateHeaders(headers: HeadersLike): IterableIterator<readonly [strin
|
|
|
54
54
|
for (let row of iter) {
|
|
55
55
|
const name = row[0];
|
|
56
56
|
if (typeof name !== 'string') throw new TypeError('expected header name to be a string');
|
|
57
|
-
const values =
|
|
57
|
+
const values = isReadonlyArray(row[1]) ? row[1] : [row[1]];
|
|
58
58
|
let didClear = false;
|
|
59
59
|
for (const value of values) {
|
|
60
60
|
if (value === undefined) continue;
|
package/src/internal/uploads.ts
CHANGED
|
@@ -90,7 +90,7 @@ export const multipartFormRequestOptions = async (
|
|
|
90
90
|
return { ...opts, body: await createForm(opts.body, fetch) };
|
|
91
91
|
};
|
|
92
92
|
|
|
93
|
-
const supportsFormDataMap = new WeakMap<Fetch, Promise<boolean>>();
|
|
93
|
+
const supportsFormDataMap = /** @__PURE__ */ new WeakMap<Fetch, Promise<boolean>>();
|
|
94
94
|
|
|
95
95
|
/**
|
|
96
96
|
* node-fetch doesn't support the global FormData object in recent node versions. Instead of sending
|
|
@@ -138,7 +138,7 @@ export const createForm = async <T = Record<string, unknown>>(
|
|
|
138
138
|
|
|
139
139
|
// We check for Blob not File because Bun.File doesn't inherit from File,
|
|
140
140
|
// but they both inherit from Blob and have a `name` property at runtime.
|
|
141
|
-
const isNamedBlob = (value:
|
|
141
|
+
const isNamedBlob = (value: unknown): value is Blob => value instanceof Blob && 'name' in value;
|
|
142
142
|
|
|
143
143
|
const isUploadable = (value: unknown) =>
|
|
144
144
|
typeof value === 'object' &&
|
|
@@ -58,7 +58,7 @@ const noopLogger = {
|
|
|
58
58
|
debug: noop,
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
-
let cachedLoggers = new WeakMap<Logger, [LogLevel, Logger]>();
|
|
61
|
+
let cachedLoggers = /** @__PURE__ */ new WeakMap<Logger, [LogLevel, Logger]>();
|
|
62
62
|
|
|
63
63
|
export function loggerFor(client: BaseAnthropic): Logger {
|
|
64
64
|
const logger = client.logger;
|
|
@@ -62,4 +62,4 @@ export const createPathTagFunction = (pathEncoder = encodeURIPath) =>
|
|
|
62
62
|
/**
|
|
63
63
|
* URI-encodes path params and ensures no unsafe /./ or /../ path segments are introduced.
|
|
64
64
|
*/
|
|
65
|
-
export const path = createPathTagFunction(encodeURIPath);
|
|
65
|
+
export const path = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
|
|
@@ -9,6 +9,9 @@ export const isAbsoluteURL = (url: string): boolean => {
|
|
|
9
9
|
return startsWithSchemeRegexp.test(url);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
+
export let isArray = (val: unknown): val is unknown[] => ((isArray = Array.isArray), isArray(val));
|
|
13
|
+
export let isReadonlyArray = isArray as (val: unknown) => val is readonly unknown[];
|
|
14
|
+
|
|
12
15
|
/** Returns an object if the given value isn't an object, otherwise returns as-is */
|
|
13
16
|
export function maybeObj(x: unknown): object {
|
|
14
17
|
if (typeof x !== 'object') {
|
|
@@ -181,22 +181,30 @@ export class BetaMessageStream implements AsyncIterable<BetaMessageStreamEvent>
|
|
|
181
181
|
options?: RequestOptions,
|
|
182
182
|
): Promise<void> {
|
|
183
183
|
const signal = options?.signal;
|
|
184
|
+
let abortHandler: (() => void) | undefined;
|
|
184
185
|
if (signal) {
|
|
185
186
|
if (signal.aborted) this.controller.abort();
|
|
186
|
-
|
|
187
|
+
abortHandler = this.controller.abort.bind(this.controller);
|
|
188
|
+
signal.addEventListener('abort', abortHandler);
|
|
187
189
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
190
|
+
try {
|
|
191
|
+
this.#beginRequest();
|
|
192
|
+
const { response, data: stream } = await messages
|
|
193
|
+
.create({ ...params, stream: true }, { ...options, signal: this.controller.signal })
|
|
194
|
+
.withResponse();
|
|
195
|
+
this._connected(response);
|
|
196
|
+
for await (const event of stream) {
|
|
197
|
+
this.#addStreamEvent(event);
|
|
198
|
+
}
|
|
199
|
+
if (stream.controller.signal?.aborted) {
|
|
200
|
+
throw new APIUserAbortError();
|
|
201
|
+
}
|
|
202
|
+
this.#endRequest();
|
|
203
|
+
} finally {
|
|
204
|
+
if (signal && abortHandler) {
|
|
205
|
+
signal.removeEventListener('abort', abortHandler);
|
|
206
|
+
}
|
|
198
207
|
}
|
|
199
|
-
this.#endRequest();
|
|
200
208
|
}
|
|
201
209
|
|
|
202
210
|
protected _connected(response: Response | null) {
|
|
@@ -497,20 +505,28 @@ export class BetaMessageStream implements AsyncIterable<BetaMessageStreamEvent>
|
|
|
497
505
|
options?: RequestOptions,
|
|
498
506
|
): Promise<void> {
|
|
499
507
|
const signal = options?.signal;
|
|
508
|
+
let abortHandler: (() => void) | undefined;
|
|
500
509
|
if (signal) {
|
|
501
510
|
if (signal.aborted) this.controller.abort();
|
|
502
|
-
|
|
511
|
+
abortHandler = this.controller.abort.bind(this.controller);
|
|
512
|
+
signal.addEventListener('abort', abortHandler);
|
|
503
513
|
}
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
514
|
+
try {
|
|
515
|
+
this.#beginRequest();
|
|
516
|
+
this._connected(null);
|
|
517
|
+
const stream = Stream.fromReadableStream<BetaMessageStreamEvent>(readableStream, this.controller);
|
|
518
|
+
for await (const event of stream) {
|
|
519
|
+
this.#addStreamEvent(event);
|
|
520
|
+
}
|
|
521
|
+
if (stream.controller.signal?.aborted) {
|
|
522
|
+
throw new APIUserAbortError();
|
|
523
|
+
}
|
|
524
|
+
this.#endRequest();
|
|
525
|
+
} finally {
|
|
526
|
+
if (signal && abortHandler) {
|
|
527
|
+
signal.removeEventListener('abort', abortHandler);
|
|
528
|
+
}
|
|
512
529
|
}
|
|
513
|
-
this.#endRequest();
|
|
514
530
|
}
|
|
515
531
|
|
|
516
532
|
/**
|
|
@@ -593,7 +609,14 @@ export class BetaMessageStream implements AsyncIterable<BetaMessageStreamEvent>
|
|
|
593
609
|
});
|
|
594
610
|
|
|
595
611
|
if (jsonBuf) {
|
|
596
|
-
|
|
612
|
+
try {
|
|
613
|
+
snapshotContent.input = partialParse(jsonBuf);
|
|
614
|
+
} catch (err) {
|
|
615
|
+
const error = new AnthropicError(
|
|
616
|
+
`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${err}. JSON: ${jsonBuf}`,
|
|
617
|
+
);
|
|
618
|
+
this.#handleError(error);
|
|
619
|
+
}
|
|
597
620
|
}
|
|
598
621
|
}
|
|
599
622
|
break;
|
package/src/lib/MessageStream.ts
CHANGED
|
@@ -180,22 +180,30 @@ export class MessageStream implements AsyncIterable<MessageStreamEvent> {
|
|
|
180
180
|
options?: RequestOptions,
|
|
181
181
|
): Promise<void> {
|
|
182
182
|
const signal = options?.signal;
|
|
183
|
+
let abortHandler: (() => void) | undefined;
|
|
183
184
|
if (signal) {
|
|
184
185
|
if (signal.aborted) this.controller.abort();
|
|
185
|
-
|
|
186
|
+
abortHandler = this.controller.abort.bind(this.controller);
|
|
187
|
+
signal.addEventListener('abort', abortHandler);
|
|
186
188
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
189
|
+
try {
|
|
190
|
+
this.#beginRequest();
|
|
191
|
+
const { response, data: stream } = await messages
|
|
192
|
+
.create({ ...params, stream: true }, { ...options, signal: this.controller.signal })
|
|
193
|
+
.withResponse();
|
|
194
|
+
this._connected(response);
|
|
195
|
+
for await (const event of stream) {
|
|
196
|
+
this.#addStreamEvent(event);
|
|
197
|
+
}
|
|
198
|
+
if (stream.controller.signal?.aborted) {
|
|
199
|
+
throw new APIUserAbortError();
|
|
200
|
+
}
|
|
201
|
+
this.#endRequest();
|
|
202
|
+
} finally {
|
|
203
|
+
if (signal && abortHandler) {
|
|
204
|
+
signal.removeEventListener('abort', abortHandler);
|
|
205
|
+
}
|
|
197
206
|
}
|
|
198
|
-
this.#endRequest();
|
|
199
207
|
}
|
|
200
208
|
|
|
201
209
|
protected _connected(response: Response | null) {
|
|
@@ -496,20 +504,28 @@ export class MessageStream implements AsyncIterable<MessageStreamEvent> {
|
|
|
496
504
|
options?: RequestOptions,
|
|
497
505
|
): Promise<void> {
|
|
498
506
|
const signal = options?.signal;
|
|
507
|
+
let abortHandler: (() => void) | undefined;
|
|
499
508
|
if (signal) {
|
|
500
509
|
if (signal.aborted) this.controller.abort();
|
|
501
|
-
|
|
510
|
+
abortHandler = this.controller.abort.bind(this.controller);
|
|
511
|
+
signal.addEventListener('abort', abortHandler);
|
|
502
512
|
}
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
513
|
+
try {
|
|
514
|
+
this.#beginRequest();
|
|
515
|
+
this._connected(null);
|
|
516
|
+
const stream = Stream.fromReadableStream<MessageStreamEvent>(readableStream, this.controller);
|
|
517
|
+
for await (const event of stream) {
|
|
518
|
+
this.#addStreamEvent(event);
|
|
519
|
+
}
|
|
520
|
+
if (stream.controller.signal?.aborted) {
|
|
521
|
+
throw new APIUserAbortError();
|
|
522
|
+
}
|
|
523
|
+
this.#endRequest();
|
|
524
|
+
} finally {
|
|
525
|
+
if (signal && abortHandler) {
|
|
526
|
+
signal.removeEventListener('abort', abortHandler);
|
|
527
|
+
}
|
|
511
528
|
}
|
|
512
|
-
this.#endRequest();
|
|
513
529
|
}
|
|
514
530
|
|
|
515
531
|
/**
|
|
@@ -74,6 +74,7 @@ import {
|
|
|
74
74
|
BetaRawMessageStreamEvent,
|
|
75
75
|
BetaRedactedThinkingBlock,
|
|
76
76
|
BetaRedactedThinkingBlockParam,
|
|
77
|
+
BetaRequestDocumentBlock,
|
|
77
78
|
BetaRequestMCPServerToolConfiguration,
|
|
78
79
|
BetaRequestMCPServerURLDefinition,
|
|
79
80
|
BetaRequestMCPToolResultBlockParam,
|
|
@@ -255,7 +256,6 @@ export declare namespace Beta {
|
|
|
255
256
|
export {
|
|
256
257
|
Messages as Messages,
|
|
257
258
|
type BetaBase64ImageSource as BetaBase64ImageSource,
|
|
258
|
-
type BetaBase64PDFBlock as BetaBase64PDFBlock,
|
|
259
259
|
type BetaBase64PDFSource as BetaBase64PDFSource,
|
|
260
260
|
type BetaCacheControlEphemeral as BetaCacheControlEphemeral,
|
|
261
261
|
type BetaCacheCreation as BetaCacheCreation,
|
|
@@ -311,6 +311,7 @@ export declare namespace Beta {
|
|
|
311
311
|
type BetaRawMessageStreamEvent as BetaRawMessageStreamEvent,
|
|
312
312
|
type BetaRedactedThinkingBlock as BetaRedactedThinkingBlock,
|
|
313
313
|
type BetaRedactedThinkingBlockParam as BetaRedactedThinkingBlockParam,
|
|
314
|
+
type BetaRequestDocumentBlock as BetaRequestDocumentBlock,
|
|
314
315
|
type BetaRequestMCPServerToolConfiguration as BetaRequestMCPServerToolConfiguration,
|
|
315
316
|
type BetaRequestMCPServerURLDefinition as BetaRequestMCPServerURLDefinition,
|
|
316
317
|
type BetaRequestMCPToolResultBlockParam as BetaRequestMCPToolResultBlockParam,
|
|
@@ -360,6 +361,7 @@ export declare namespace Beta {
|
|
|
360
361
|
type BetaWebSearchToolResultBlockParamContent as BetaWebSearchToolResultBlockParamContent,
|
|
361
362
|
type BetaWebSearchToolResultError as BetaWebSearchToolResultError,
|
|
362
363
|
type BetaWebSearchToolResultErrorCode as BetaWebSearchToolResultErrorCode,
|
|
364
|
+
type BetaBase64PDFBlock as BetaBase64PDFBlock,
|
|
363
365
|
type MessageCreateParams as MessageCreateParams,
|
|
364
366
|
type MessageCreateParamsNonStreaming as MessageCreateParamsNonStreaming,
|
|
365
367
|
type MessageCreateParamsStreaming as MessageCreateParamsStreaming,
|
|
@@ -29,7 +29,6 @@ export {
|
|
|
29
29
|
export {
|
|
30
30
|
Messages,
|
|
31
31
|
type BetaBase64ImageSource,
|
|
32
|
-
type BetaBase64PDFBlock,
|
|
33
32
|
type BetaBase64PDFSource,
|
|
34
33
|
type BetaCacheControlEphemeral,
|
|
35
34
|
type BetaCacheCreation,
|
|
@@ -85,6 +84,7 @@ export {
|
|
|
85
84
|
type BetaRawMessageStreamEvent,
|
|
86
85
|
type BetaRedactedThinkingBlock,
|
|
87
86
|
type BetaRedactedThinkingBlockParam,
|
|
87
|
+
type BetaRequestDocumentBlock,
|
|
88
88
|
type BetaRequestMCPServerToolConfiguration,
|
|
89
89
|
type BetaRequestMCPServerURLDefinition,
|
|
90
90
|
type BetaRequestMCPToolResultBlockParam,
|
|
@@ -134,6 +134,7 @@ export {
|
|
|
134
134
|
type BetaWebSearchToolResultBlockParamContent,
|
|
135
135
|
type BetaWebSearchToolResultError,
|
|
136
136
|
type BetaWebSearchToolResultErrorCode,
|
|
137
|
+
type BetaBase64PDFBlock,
|
|
137
138
|
type MessageCreateParams,
|
|
138
139
|
type MessageCreateParamsNonStreaming,
|
|
139
140
|
type MessageCreateParamsStreaming,
|
|
@@ -22,7 +22,6 @@ export {
|
|
|
22
22
|
export {
|
|
23
23
|
Messages,
|
|
24
24
|
type BetaBase64ImageSource,
|
|
25
|
-
type BetaBase64PDFBlock,
|
|
26
25
|
type BetaBase64PDFSource,
|
|
27
26
|
type BetaCacheControlEphemeral,
|
|
28
27
|
type BetaCacheCreation,
|
|
@@ -78,6 +77,7 @@ export {
|
|
|
78
77
|
type BetaRawMessageStreamEvent,
|
|
79
78
|
type BetaRedactedThinkingBlock,
|
|
80
79
|
type BetaRedactedThinkingBlockParam,
|
|
80
|
+
type BetaRequestDocumentBlock,
|
|
81
81
|
type BetaRequestMCPServerToolConfiguration,
|
|
82
82
|
type BetaRequestMCPServerURLDefinition,
|
|
83
83
|
type BetaRequestMCPToolResultBlockParam,
|
|
@@ -127,6 +127,7 @@ export {
|
|
|
127
127
|
type BetaWebSearchToolResultBlockParamContent,
|
|
128
128
|
type BetaWebSearchToolResultError,
|
|
129
129
|
type BetaWebSearchToolResultErrorCode,
|
|
130
|
+
type BetaBase64PDFBlock,
|
|
130
131
|
type MessageCreateParams,
|
|
131
132
|
type MessageCreateParamsNonStreaming,
|
|
132
133
|
type MessageCreateParamsStreaming,
|
|
@@ -157,28 +157,6 @@ export interface BetaBase64ImageSource {
|
|
|
157
157
|
type: 'base64';
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
export interface BetaBase64PDFBlock {
|
|
161
|
-
source:
|
|
162
|
-
| BetaBase64PDFSource
|
|
163
|
-
| BetaPlainTextSource
|
|
164
|
-
| BetaContentBlockSource
|
|
165
|
-
| BetaURLPDFSource
|
|
166
|
-
| BetaFileDocumentSource;
|
|
167
|
-
|
|
168
|
-
type: 'document';
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* Create a cache control breakpoint at this content block.
|
|
172
|
-
*/
|
|
173
|
-
cache_control?: BetaCacheControlEphemeral | null;
|
|
174
|
-
|
|
175
|
-
citations?: BetaCitationsConfigParam;
|
|
176
|
-
|
|
177
|
-
context?: string | null;
|
|
178
|
-
|
|
179
|
-
title?: string | null;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
160
|
export interface BetaBase64PDFSource {
|
|
183
161
|
data: string;
|
|
184
162
|
|
|
@@ -504,7 +482,7 @@ export type BetaContentBlockParam =
|
|
|
504
482
|
| BetaImageBlockParam
|
|
505
483
|
| BetaToolUseBlockParam
|
|
506
484
|
| BetaToolResultBlockParam
|
|
507
|
-
|
|
|
485
|
+
| BetaRequestDocumentBlock
|
|
508
486
|
| BetaThinkingBlockParam
|
|
509
487
|
| BetaRedactedThinkingBlockParam
|
|
510
488
|
| BetaContainerUploadBlockParam;
|
|
@@ -879,6 +857,28 @@ export interface BetaRedactedThinkingBlockParam {
|
|
|
879
857
|
type: 'redacted_thinking';
|
|
880
858
|
}
|
|
881
859
|
|
|
860
|
+
export interface BetaRequestDocumentBlock {
|
|
861
|
+
source:
|
|
862
|
+
| BetaBase64PDFSource
|
|
863
|
+
| BetaPlainTextSource
|
|
864
|
+
| BetaContentBlockSource
|
|
865
|
+
| BetaURLPDFSource
|
|
866
|
+
| BetaFileDocumentSource;
|
|
867
|
+
|
|
868
|
+
type: 'document';
|
|
869
|
+
|
|
870
|
+
/**
|
|
871
|
+
* Create a cache control breakpoint at this content block.
|
|
872
|
+
*/
|
|
873
|
+
cache_control?: BetaCacheControlEphemeral | null;
|
|
874
|
+
|
|
875
|
+
citations?: BetaCitationsConfigParam;
|
|
876
|
+
|
|
877
|
+
context?: string | null;
|
|
878
|
+
|
|
879
|
+
title?: string | null;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
882
|
export interface BetaRequestMCPServerToolConfiguration {
|
|
883
883
|
allowed_tools?: Array<string> | null;
|
|
884
884
|
|
|
@@ -1561,6 +1561,11 @@ export type BetaWebSearchToolResultErrorCode =
|
|
|
1561
1561
|
| 'too_many_requests'
|
|
1562
1562
|
| 'query_too_long';
|
|
1563
1563
|
|
|
1564
|
+
/**
|
|
1565
|
+
* @deprecated BetaRequestDocumentBlock should be used insated
|
|
1566
|
+
*/
|
|
1567
|
+
export type BetaBase64PDFBlock = BetaRequestDocumentBlock;
|
|
1568
|
+
|
|
1564
1569
|
export type MessageCreateParams = MessageCreateParamsNonStreaming | MessageCreateParamsStreaming;
|
|
1565
1570
|
|
|
1566
1571
|
export interface MessageCreateParamsBase {
|
|
@@ -2118,7 +2123,6 @@ Messages.Batches = Batches;
|
|
|
2118
2123
|
export declare namespace Messages {
|
|
2119
2124
|
export {
|
|
2120
2125
|
type BetaBase64ImageSource as BetaBase64ImageSource,
|
|
2121
|
-
type BetaBase64PDFBlock as BetaBase64PDFBlock,
|
|
2122
2126
|
type BetaBase64PDFSource as BetaBase64PDFSource,
|
|
2123
2127
|
type BetaCacheControlEphemeral as BetaCacheControlEphemeral,
|
|
2124
2128
|
type BetaCacheCreation as BetaCacheCreation,
|
|
@@ -2174,6 +2178,7 @@ export declare namespace Messages {
|
|
|
2174
2178
|
type BetaRawMessageStreamEvent as BetaRawMessageStreamEvent,
|
|
2175
2179
|
type BetaRedactedThinkingBlock as BetaRedactedThinkingBlock,
|
|
2176
2180
|
type BetaRedactedThinkingBlockParam as BetaRedactedThinkingBlockParam,
|
|
2181
|
+
type BetaRequestDocumentBlock as BetaRequestDocumentBlock,
|
|
2177
2182
|
type BetaRequestMCPServerToolConfiguration as BetaRequestMCPServerToolConfiguration,
|
|
2178
2183
|
type BetaRequestMCPServerURLDefinition as BetaRequestMCPServerURLDefinition,
|
|
2179
2184
|
type BetaRequestMCPToolResultBlockParam as BetaRequestMCPToolResultBlockParam,
|
|
@@ -2223,6 +2228,7 @@ export declare namespace Messages {
|
|
|
2223
2228
|
type BetaWebSearchToolResultBlockParamContent as BetaWebSearchToolResultBlockParamContent,
|
|
2224
2229
|
type BetaWebSearchToolResultError as BetaWebSearchToolResultError,
|
|
2225
2230
|
type BetaWebSearchToolResultErrorCode as BetaWebSearchToolResultErrorCode,
|
|
2231
|
+
type BetaBase64PDFBlock as BetaBase64PDFBlock,
|
|
2226
2232
|
type MessageCreateParams as MessageCreateParams,
|
|
2227
2233
|
type MessageCreateParamsNonStreaming as MessageCreateParamsNonStreaming,
|
|
2228
2234
|
type MessageCreateParamsStreaming as MessageCreateParamsStreaming,
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.55.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.55.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.55.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.55.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|