feat: Complete zCode CLI X with Telegram bot integration

- Add full Telegram bot functionality with Z.AI API integration
- Implement 4 tools: Bash, FileEdit, WebSearch, Git
- Add 3 agents: Code Reviewer, Architect, DevOps Engineer
- Add 6 skills for common coding tasks
- Add systemd service file for 24/7 operation
- Add nginx configuration for HTTPS webhook
- Add comprehensive documentation
- Implement WebSocket server for real-time updates
- Add logging system with Winston
- Add environment validation

🤖 zCode CLI X - Agentic coder with Z.AI + Telegram integration
This commit is contained in:
admin
2026-05-05 09:01:26 +00:00
Unverified
parent 4a7035dd92
commit 875c7f9b91
24688 changed files with 3224957 additions and 221 deletions

View File

@@ -0,0 +1,2 @@
export * from "./beta/index.mjs";
//# sourceMappingURL=beta.d.mts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"beta.d.mts","sourceRoot":"","sources":["../src/resources/beta.ts"],"names":[],"mappings":""}

View File

@@ -0,0 +1,2 @@
export * from "./beta/index.js";
//# sourceMappingURL=beta.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"beta.d.ts","sourceRoot":"","sources":["../src/resources/beta.ts"],"names":[],"mappings":""}

View File

@@ -0,0 +1,6 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("../internal/tslib.js");
tslib_1.__exportStar(require("./beta/index.js"), exports);
//# sourceMappingURL=beta.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"beta.js","sourceRoot":"","sources":["../src/resources/beta.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,0DAA6B"}

View File

@@ -0,0 +1,3 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
export * from "./beta/index.mjs";
//# sourceMappingURL=beta.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"beta.mjs","sourceRoot":"","sources":["../src/resources/beta.ts"],"names":[],"mappings":"AAAA,sFAAsF"}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,29 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Beta = void 0;
const tslib_1 = require("../../internal/tslib.js");
const resource_1 = require("../../core/resource.js");
const FilesAPI = tslib_1.__importStar(require("./files.js"));
const files_1 = require("./files.js");
const ModelsAPI = tslib_1.__importStar(require("./models.js"));
const models_1 = require("./models.js");
const MessagesAPI = tslib_1.__importStar(require("./messages/messages.js"));
const messages_1 = require("./messages/messages.js");
const SkillsAPI = tslib_1.__importStar(require("./skills/skills.js"));
const skills_1 = require("./skills/skills.js");
class Beta extends resource_1.APIResource {
constructor() {
super(...arguments);
this.models = new ModelsAPI.Models(this._client);
this.messages = new MessagesAPI.Messages(this._client);
this.files = new FilesAPI.Files(this._client);
this.skills = new SkillsAPI.Skills(this._client);
}
}
exports.Beta = Beta;
Beta.Models = models_1.Models;
Beta.Messages = messages_1.Messages;
Beta.Files = files_1.Files;
Beta.Skills = skills_1.Skills;
//# sourceMappingURL=beta.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"beta.js","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,6DAAoC;AACpC,sCAUiB;AACjB,+DAAsC;AACtC,wCAYkB;AAClB,4EAAmD;AACnD,qDAmM6B;AAC7B,sEAA6C;AAC7C,+CAWyB;AAEzB,MAAa,IAAK,SAAQ,sBAAW;IAArC;;QACE,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9D,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxE,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzD,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAChE,CAAC;CAAA;AALD,oBAKC;AAmGD,IAAI,CAAC,MAAM,GAAG,eAAM,CAAC;AACrB,IAAI,CAAC,QAAQ,GAAG,mBAAQ,CAAC;AACzB,IAAI,CAAC,KAAK,GAAG,aAAK,CAAC;AACnB,IAAI,CAAC,MAAM,GAAG,eAAM,CAAC"}

View File

@@ -0,0 +1,24 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../core/resource.mjs";
import * as FilesAPI from "./files.mjs";
import { Files, } from "./files.mjs";
import * as ModelsAPI from "./models.mjs";
import { Models, } from "./models.mjs";
import * as MessagesAPI from "./messages/messages.mjs";
import { Messages, } from "./messages/messages.mjs";
import * as SkillsAPI from "./skills/skills.mjs";
import { Skills, } from "./skills/skills.mjs";
export class Beta extends APIResource {
constructor() {
super(...arguments);
this.models = new ModelsAPI.Models(this._client);
this.messages = new MessagesAPI.Messages(this._client);
this.files = new FilesAPI.Files(this._client);
this.skills = new SkillsAPI.Skills(this._client);
}
}
Beta.Models = Models;
Beta.Messages = Messages;
Beta.Files = Files;
Beta.Skills = Skills;
//# sourceMappingURL=beta.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"beta.mjs","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,QAAQ;OACb,EASL,KAAK,GACN;OACM,KAAK,SAAS;OACd,EAWL,MAAM,GACP;OACM,KAAK,WAAW;OAChB,EAgML,QAAQ,GAGT;OACM,KAAK,SAAS;OACd,EAUL,MAAM,GACP;AAED,MAAM,OAAO,IAAK,SAAQ,WAAW;IAArC;;QACE,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9D,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxE,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzD,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAChE,CAAC;CAAA;AAmGD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;AACrB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;AACzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;AACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC"}

View File

@@ -0,0 +1,151 @@
import { APIResource } from "../../core/resource.mjs";
import * as BetaAPI from "./beta.mjs";
import { APIPromise } from "../../core/api-promise.mjs";
import { Page, type PageParams, PagePromise } from "../../core/pagination.mjs";
import { type Uploadable } from "../../core/uploads.mjs";
import { RequestOptions } from "../../internal/request-options.mjs";
export declare class Files extends APIResource {
/**
* List Files
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const fileMetadata of client.beta.files.list()) {
* // ...
* }
* ```
*/
list(params?: FileListParams | null | undefined, options?: RequestOptions): PagePromise<FileMetadataPage, FileMetadata>;
/**
* Delete File
*
* @example
* ```ts
* const deletedFile = await client.beta.files.delete(
* 'file_id',
* );
* ```
*/
delete(fileID: string, params?: FileDeleteParams | null | undefined, options?: RequestOptions): APIPromise<DeletedFile>;
/**
* Download File
*
* @example
* ```ts
* const response = await client.beta.files.download(
* 'file_id',
* );
*
* const content = await response.blob();
* console.log(content);
* ```
*/
download(fileID: string, params?: FileDownloadParams | null | undefined, options?: RequestOptions): APIPromise<Response>;
/**
* Get File Metadata
*
* @example
* ```ts
* const fileMetadata =
* await client.beta.files.retrieveMetadata('file_id');
* ```
*/
retrieveMetadata(fileID: string, params?: FileRetrieveMetadataParams | null | undefined, options?: RequestOptions): APIPromise<FileMetadata>;
/**
* Upload File
*
* @example
* ```ts
* const fileMetadata = await client.beta.files.upload({
* file: fs.createReadStream('path/to/file'),
* });
* ```
*/
upload(params: FileUploadParams, options?: RequestOptions): APIPromise<FileMetadata>;
}
export type FileMetadataPage = Page<FileMetadata>;
export interface DeletedFile {
/**
* ID of the deleted file.
*/
id: string;
/**
* Deleted object type.
*
* For file deletion, this is always `"file_deleted"`.
*/
type?: 'file_deleted';
}
export interface FileMetadata {
/**
* Unique object identifier.
*
* The format and length of IDs may change over time.
*/
id: string;
/**
* RFC 3339 datetime string representing when the file was created.
*/
created_at: string;
/**
* Original filename of the uploaded file.
*/
filename: string;
/**
* MIME type of the file.
*/
mime_type: string;
/**
* Size of the file in bytes.
*/
size_bytes: number;
/**
* Object type.
*
* For files, this is always `"file"`.
*/
type: 'file';
/**
* Whether the file can be downloaded.
*/
downloadable?: boolean;
}
export interface FileListParams extends PageParams {
/**
* Header param: Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export interface FileDeleteParams {
/**
* Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export interface FileDownloadParams {
/**
* Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export interface FileRetrieveMetadataParams {
/**
* Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export interface FileUploadParams {
/**
* Body param: The file to upload
*/
file: Uploadable;
/**
* Header param: Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export declare namespace Files {
export { type DeletedFile as DeletedFile, type FileMetadata as FileMetadata, type FileMetadataPage as FileMetadataPage, type FileListParams as FileListParams, type FileDeleteParams as FileDeleteParams, type FileDownloadParams as FileDownloadParams, type FileRetrieveMetadataParams as FileRetrieveMetadataParams, type FileUploadParams as FileUploadParams, };
}
//# sourceMappingURL=files.d.mts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"files.d.mts","sourceRoot":"","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AAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}

View File

@@ -0,0 +1,151 @@
import { APIResource } from "../../core/resource.js";
import * as BetaAPI from "./beta.js";
import { APIPromise } from "../../core/api-promise.js";
import { Page, type PageParams, PagePromise } from "../../core/pagination.js";
import { type Uploadable } from "../../core/uploads.js";
import { RequestOptions } from "../../internal/request-options.js";
export declare class Files extends APIResource {
/**
* List Files
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const fileMetadata of client.beta.files.list()) {
* // ...
* }
* ```
*/
list(params?: FileListParams | null | undefined, options?: RequestOptions): PagePromise<FileMetadataPage, FileMetadata>;
/**
* Delete File
*
* @example
* ```ts
* const deletedFile = await client.beta.files.delete(
* 'file_id',
* );
* ```
*/
delete(fileID: string, params?: FileDeleteParams | null | undefined, options?: RequestOptions): APIPromise<DeletedFile>;
/**
* Download File
*
* @example
* ```ts
* const response = await client.beta.files.download(
* 'file_id',
* );
*
* const content = await response.blob();
* console.log(content);
* ```
*/
download(fileID: string, params?: FileDownloadParams | null | undefined, options?: RequestOptions): APIPromise<Response>;
/**
* Get File Metadata
*
* @example
* ```ts
* const fileMetadata =
* await client.beta.files.retrieveMetadata('file_id');
* ```
*/
retrieveMetadata(fileID: string, params?: FileRetrieveMetadataParams | null | undefined, options?: RequestOptions): APIPromise<FileMetadata>;
/**
* Upload File
*
* @example
* ```ts
* const fileMetadata = await client.beta.files.upload({
* file: fs.createReadStream('path/to/file'),
* });
* ```
*/
upload(params: FileUploadParams, options?: RequestOptions): APIPromise<FileMetadata>;
}
export type FileMetadataPage = Page<FileMetadata>;
export interface DeletedFile {
/**
* ID of the deleted file.
*/
id: string;
/**
* Deleted object type.
*
* For file deletion, this is always `"file_deleted"`.
*/
type?: 'file_deleted';
}
export interface FileMetadata {
/**
* Unique object identifier.
*
* The format and length of IDs may change over time.
*/
id: string;
/**
* RFC 3339 datetime string representing when the file was created.
*/
created_at: string;
/**
* Original filename of the uploaded file.
*/
filename: string;
/**
* MIME type of the file.
*/
mime_type: string;
/**
* Size of the file in bytes.
*/
size_bytes: number;
/**
* Object type.
*
* For files, this is always `"file"`.
*/
type: 'file';
/**
* Whether the file can be downloaded.
*/
downloadable?: boolean;
}
export interface FileListParams extends PageParams {
/**
* Header param: Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export interface FileDeleteParams {
/**
* Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export interface FileDownloadParams {
/**
* Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export interface FileRetrieveMetadataParams {
/**
* Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export interface FileUploadParams {
/**
* Body param: The file to upload
*/
file: Uploadable;
/**
* Header param: Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export declare namespace Files {
export { type DeletedFile as DeletedFile, type FileMetadata as FileMetadata, type FileMetadataPage as FileMetadataPage, type FileListParams as FileListParams, type FileDeleteParams as FileDeleteParams, type FileDownloadParams as FileDownloadParams, type FileRetrieveMetadataParams as FileRetrieveMetadataParams, type FileUploadParams as FileUploadParams, };
}
//# sourceMappingURL=files.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/resources/beta/files.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,OAAO;OACZ,EAAE,UAAU,EAAE;OACd,EAAE,IAAI,EAAE,KAAK,UAAU,EAAE,WAAW,EAAE;OACtC,EAAE,KAAK,UAAU,EAAE;OAEnB,EAAE,cAAc,EAAE;AAKzB,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;OAUG;IACH,IAAI,CACF,MAAM,GAAE,cAAc,GAAG,IAAI,GAAG,SAAc,EAC9C,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,g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;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;IAEjB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;CACtC;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}

View File

@@ -0,0 +1,124 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Files = void 0;
const resource_1 = require("../../core/resource.js");
const pagination_1 = require("../../core/pagination.js");
const headers_1 = require("../../internal/headers.js");
const stainless_helper_header_1 = require("../../lib/stainless-helper-header.js");
const uploads_1 = require("../../internal/uploads.js");
const path_1 = require("../../internal/utils/path.js");
class Files extends resource_1.APIResource {
/**
* List Files
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const fileMetadata of client.beta.files.list()) {
* // ...
* }
* ```
*/
list(params = {}, options) {
const { betas, ...query } = params ?? {};
return this._client.getAPIList('/v1/files', (pagination_1.Page), {
query,
...options,
headers: (0, headers_1.buildHeaders)([
{ 'anthropic-beta': [...(betas ?? []), 'files-api-2025-04-14'].toString() },
options?.headers,
]),
});
}
/**
* Delete File
*
* @example
* ```ts
* const deletedFile = await client.beta.files.delete(
* 'file_id',
* );
* ```
*/
delete(fileID, params = {}, options) {
const { betas } = params ?? {};
return this._client.delete((0, path_1.path) `/v1/files/${fileID}`, {
...options,
headers: (0, headers_1.buildHeaders)([
{ 'anthropic-beta': [...(betas ?? []), 'files-api-2025-04-14'].toString() },
options?.headers,
]),
});
}
/**
* Download File
*
* @example
* ```ts
* const response = await client.beta.files.download(
* 'file_id',
* );
*
* const content = await response.blob();
* console.log(content);
* ```
*/
download(fileID, params = {}, options) {
const { betas } = params ?? {};
return this._client.get((0, path_1.path) `/v1/files/${fileID}/content`, {
...options,
headers: (0, headers_1.buildHeaders)([
{
'anthropic-beta': [...(betas ?? []), 'files-api-2025-04-14'].toString(),
Accept: 'application/binary',
},
options?.headers,
]),
__binaryResponse: true,
});
}
/**
* Get File Metadata
*
* @example
* ```ts
* const fileMetadata =
* await client.beta.files.retrieveMetadata('file_id');
* ```
*/
retrieveMetadata(fileID, params = {}, options) {
const { betas } = params ?? {};
return this._client.get((0, path_1.path) `/v1/files/${fileID}`, {
...options,
headers: (0, headers_1.buildHeaders)([
{ 'anthropic-beta': [...(betas ?? []), 'files-api-2025-04-14'].toString() },
options?.headers,
]),
});
}
/**
* Upload File
*
* @example
* ```ts
* const fileMetadata = await client.beta.files.upload({
* file: fs.createReadStream('path/to/file'),
* });
* ```
*/
upload(params, options) {
const { betas, ...body } = params;
return this._client.post('/v1/files', (0, uploads_1.multipartFormRequestOptions)({
body,
...options,
headers: (0, headers_1.buildHeaders)([
{ 'anthropic-beta': [...(betas ?? []), 'files-api-2025-04-14'].toString() },
(0, stainless_helper_header_1.stainlessHelperHeaderFromFile)(body.file),
options?.headers,
]),
}, this._client));
}
}
exports.Files = Files;
//# sourceMappingURL=files.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/resources/beta/files.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAGlD,yDAA2E;AAE3E,uDAAsD;AAEtD,kFAAkF;AAClF,uDAAqE;AACrE,uDAAiD;AAEjD,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;;;;;OAUG;IACH,IAAI,CACF,SAA4C,EAAE,EAC9C,OAAwB;QAExB,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,CAAA,iBAAkB,CAAA,EAAE;YAC9D,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC;gBACpB,EAAE,gBAAgB,EAAE,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,sBAAsB,CAAC,CAAC,QAAQ,EAAE,EAAE;gBAC3E,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CACJ,MAAc,EACd,SAA8C,EAAE,EAChD,OAAwB;QAExB,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,aAAa,MAAM,EAAE,EAAE;YACpD,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC;gBACpB,EAAE,gBAAgB,EAAE,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,sBAAsB,CAAC,CAAC,QAAQ,EAAE,EAAE;gBAC3E,OAAO,EAAE,OAAO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AAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC;gBACpB,EAAE,gBAAgB,EAAE,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,sBAAsB,CAAC,CAAC,QAAQ,EAAE,EAAE;gBAC3E,IAAA,uDAA6B,EAAC,IAAI,CAAC,IAAI,CAAC;gBACxC,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,EACD,IAAI,CAAC,OAAO,CACb,CACF,CAAC;IACJ,CAAC;CACF;AAzID,sBAyIC"}

View File

@@ -0,0 +1,120 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../core/resource.mjs";
import { Page } from "../../core/pagination.mjs";
import { buildHeaders } from "../../internal/headers.mjs";
import { stainlessHelperHeaderFromFile } from "../../lib/stainless-helper-header.mjs";
import { multipartFormRequestOptions } from "../../internal/uploads.mjs";
import { path } from "../../internal/utils/path.mjs";
export class Files extends APIResource {
/**
* List Files
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const fileMetadata of client.beta.files.list()) {
* // ...
* }
* ```
*/
list(params = {}, options) {
const { betas, ...query } = params ?? {};
return this._client.getAPIList('/v1/files', (Page), {
query,
...options,
headers: buildHeaders([
{ 'anthropic-beta': [...(betas ?? []), 'files-api-2025-04-14'].toString() },
options?.headers,
]),
});
}
/**
* Delete File
*
* @example
* ```ts
* const deletedFile = await client.beta.files.delete(
* 'file_id',
* );
* ```
*/
delete(fileID, params = {}, options) {
const { betas } = params ?? {};
return this._client.delete(path `/v1/files/${fileID}`, {
...options,
headers: buildHeaders([
{ 'anthropic-beta': [...(betas ?? []), 'files-api-2025-04-14'].toString() },
options?.headers,
]),
});
}
/**
* Download File
*
* @example
* ```ts
* const response = await client.beta.files.download(
* 'file_id',
* );
*
* const content = await response.blob();
* console.log(content);
* ```
*/
download(fileID, params = {}, options) {
const { betas } = params ?? {};
return this._client.get(path `/v1/files/${fileID}/content`, {
...options,
headers: buildHeaders([
{
'anthropic-beta': [...(betas ?? []), 'files-api-2025-04-14'].toString(),
Accept: 'application/binary',
},
options?.headers,
]),
__binaryResponse: true,
});
}
/**
* Get File Metadata
*
* @example
* ```ts
* const fileMetadata =
* await client.beta.files.retrieveMetadata('file_id');
* ```
*/
retrieveMetadata(fileID, params = {}, options) {
const { betas } = params ?? {};
return this._client.get(path `/v1/files/${fileID}`, {
...options,
headers: buildHeaders([
{ 'anthropic-beta': [...(betas ?? []), 'files-api-2025-04-14'].toString() },
options?.headers,
]),
});
}
/**
* Upload File
*
* @example
* ```ts
* const fileMetadata = await client.beta.files.upload({
* file: fs.createReadStream('path/to/file'),
* });
* ```
*/
upload(params, options) {
const { betas, ...body } = params;
return this._client.post('/v1/files', multipartFormRequestOptions({
body,
...options,
headers: buildHeaders([
{ 'anthropic-beta': [...(betas ?? []), 'files-api-2025-04-14'].toString() },
stainlessHelperHeaderFromFile(body.file),
options?.headers,
]),
}, this._client));
}
}
//# sourceMappingURL=files.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"files.mjs","sourceRoot":"","sources":["../../src/resources/beta/files.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,IAAI,EAAgC;OAEtC,EAAE,YAAY,EAAE;OAEhB,EAAE,6BAA6B,EAAE;OACjC,EAAE,2BAA2B,EAAE;OAC/B,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;OAUG;IACH,IAAI,CACF,SAA4C,EAAE,EAC9C,OAAwB;QAExB,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,CAAA,IAAkB,CAAA,EAAE;YAC9D,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;gBACpB,EAAE,gBAAgB,E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AAI,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,MAAM,EAAE,EAAE;YACjD,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;gBACpB,EAAE,gBAAgB,EAAE,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,sBAAsB,CAAC,CAAC,QAAQ,EAAE,EAAE;gBAC3E,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,MAAwB,EAAE,OAAwB;QACvD,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAElC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB,WAAW,EACX,2BAA2B,CACzB;YACE,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;gBACpB,EAAE,gBAAgB,EAAE,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,sBAAsB,CAAC,CAAC,QAAQ,EAAE,EAAE;gBAC3E,6BAA6B,CAAC,IAAI,CAAC,IAAI,CAAC;gBACxC,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,EACD,IAAI,CAAC,OAAO,CACb,CACF,CAAC;IACJ,CAAC;CACF"}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":"OAEO,EACL,IAAI,EACJ,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GACxB;OACM,EACL,KA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gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,EAChC,KAAK,gCAAgC,EACrC,KAAK,gCAAgC,EACrC,KAAK,qCAAqC,EAC1C,KAAK,+BAA+B,EACpC,KAAK,wBAAwB,EAC7B,KAAK,6BAA6B,EAClC,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,6BAA6B,EAClC,KAAK,4BAA4B,EACjC,KAAK,mCAAmC,EACxC,KAAK,iCAAiC,EACtC,KAAK,wCAAwC,EAC7C,KAAK,4BAA4B,EACjC,KAAK,gCAAgC,EACrC,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,+BAA+B,EACpC,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,EAC7B,KAAK,+BAA+B,GACrC;OACM,EACL,MAAM,EACN,KAAK,qBAAqB,EAC1B,KAAK,+BAA+B,EACpC,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,kBAAkB,GACxB;OACM,EACL,MAAM,EACN,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,4BAA4B,GAClC"}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":"OAEO,EACL,IAAI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AAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,4BAA4B,GAClC"}

View File

@@ -0,0 +1,15 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Skills = exports.Models = exports.Messages = exports.Files = exports.Beta = void 0;
var beta_1 = require("./beta.js");
Object.defineProperty(exports, "Beta", { enumerable: true, get: function () { return beta_1.Beta; } });
var files_1 = require("./files.js");
Object.defineProperty(exports, "Files", { enumerable: true, get: function () { return files_1.Files; } });
var index_1 = require("./messages/index.js");
Object.defineProperty(exports, "Messages", { enumerable: true, get: function () { return index_1.Messages; } });
var models_1 = require("./models.js");
Object.defineProperty(exports, "Models", { enumerable: true, get: function () { return models_1.Models; } });
var index_2 = require("./skills/index.js");
Object.defineProperty(exports, "Skills", { enumerable: true, get: function () { return index_2.Skills; } });
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kCAcgB;AAbd,4FAAA,IAAI,OAAA;AAcN,oCAUiB;AATf,8FAAA,KAAK,OAAA;AAUP,6CA4M0B;AA3MxB,iGAAA,QAAQ,OAAA;AA4MV,sCAYkB;AAXhB,gGAAA,MAAM,OAAA;AAYR,2CAWwB;AAVtB,+FAAA,MAAM,OAAA"}

View File

@@ -0,0 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
export { Beta, } from "./beta.mjs";
export { Files, } from "./files.mjs";
export { Messages, } from "./messages/index.mjs";
export { Models, } from "./models.mjs";
export { Skills, } from "./skills/index.mjs";
//# sourceMappingURL=index.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,IAAI,GAaL;OACM,EACL,KAAK,GASN;OACM,EACL,QAAQ,GA2MT;OACM,EACL,MAAM,GAWP;OACM,EACL,MAAM,GAUP"}

View File

@@ -0,0 +1,2 @@
export * from "./messages/index.mjs";
//# sourceMappingURL=messages.d.mts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"messages.d.mts","sourceRoot":"","sources":["../../src/resources/beta/messages.ts"],"names":[],"mappings":""}

View File

@@ -0,0 +1,2 @@
export * from "./messages/index.js";
//# sourceMappingURL=messages.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/resources/beta/messages.ts"],"names":[],"mappings":""}

View File

@@ -0,0 +1,6 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("../../internal/tslib.js");
tslib_1.__exportStar(require("./messages/index.js"), exports);
//# sourceMappingURL=messages.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/resources/beta/messages.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,8DAAiC"}

View File

@@ -0,0 +1,3 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
export * from "./messages/index.mjs";
//# sourceMappingURL=messages.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"messages.mjs","sourceRoot":"","sources":["../../src/resources/beta/messages.ts"],"names":[],"mappings":"AAAA,sFAAsF"}

View File

@@ -0,0 +1,646 @@
import { APIResource } from "../../../core/resource.mjs";
import * as BetaAPI from "../beta.mjs";
import { APIPromise } from "../../../core/api-promise.mjs";
import * as BetaMessagesAPI from "./messages.mjs";
import { Page, type PageParams, PagePromise } from "../../../core/pagination.mjs";
import { RequestOptions } from "../../../internal/request-options.mjs";
import { JSONLDecoder } from "../../../internal/decoders/jsonl.mjs";
import * as MessagesApi from "../../messages/messages.mjs";
export declare class Batches extends APIResource {
/**
* Send a batch of Message creation requests.
*
* The Message Batches API can be used to process multiple Messages API requests at
* once. Once a Message Batch is created, it begins processing immediately. Batches
* can take up to 24 hours to complete.
*
* Learn more about the Message Batches API in our
* [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
*
* @example
* ```ts
* const betaMessageBatch =
* await client.beta.messages.batches.create({
* requests: [
* {
* custom_id: 'my-custom-id-1',
* params: {
* max_tokens: 1024,
* messages: [
* { content: 'Hello, world', role: 'user' },
* ],
* model: 'claude-opus-4-6',
* },
* },
* ],
* });
* ```
*/
create(params: BatchCreateParams, options?: RequestOptions): APIPromise<BetaMessageBatch>;
/**
* This endpoint is idempotent and can be used to poll for Message Batch
* completion. To access the results of a Message Batch, make a request to the
* `results_url` field in the response.
*
* Learn more about the Message Batches API in our
* [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
*
* @example
* ```ts
* const betaMessageBatch =
* await client.beta.messages.batches.retrieve(
* 'message_batch_id',
* );
* ```
*/
retrieve(messageBatchID: string, params?: BatchRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<BetaMessageBatch>;
/**
* List all Message Batches within a Workspace. Most recently created batches are
* returned first.
*
* Learn more about the Message Batches API in our
* [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const betaMessageBatch of client.beta.messages.batches.list()) {
* // ...
* }
* ```
*/
list(params?: BatchListParams | null | undefined, options?: RequestOptions): PagePromise<BetaMessageBatchesPage, BetaMessageBatch>;
/**
* Delete a Message Batch.
*
* Message Batches can only be deleted once they've finished processing. If you'd
* like to delete an in-progress batch, you must first cancel it.
*
* Learn more about the Message Batches API in our
* [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
*
* @example
* ```ts
* const betaDeletedMessageBatch =
* await client.beta.messages.batches.delete(
* 'message_batch_id',
* );
* ```
*/
delete(messageBatchID: string, params?: BatchDeleteParams | null | undefined, options?: RequestOptions): APIPromise<BetaDeletedMessageBatch>;
/**
* Batches may be canceled any time before processing ends. Once cancellation is
* initiated, the batch enters a `canceling` state, at which time the system may
* complete any in-progress, non-interruptible requests before finalizing
* cancellation.
*
* The number of canceled requests is specified in `request_counts`. To determine
* which requests were canceled, check the individual results within the batch.
* Note that cancellation may not result in any canceled requests if they were
* non-interruptible.
*
* Learn more about the Message Batches API in our
* [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
*
* @example
* ```ts
* const betaMessageBatch =
* await client.beta.messages.batches.cancel(
* 'message_batch_id',
* );
* ```
*/
cancel(messageBatchID: string, params?: BatchCancelParams | null | undefined, options?: RequestOptions): APIPromise<BetaMessageBatch>;
/**
* Streams the results of a Message Batch as a `.jsonl` file.
*
* Each line in the file is a JSON object containing the result of a single request
* in the Message Batch. Results are not guaranteed to be in the same order as
* requests. Use the `custom_id` field to match results to requests.
*
* Learn more about the Message Batches API in our
* [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
*
* @example
* ```ts
* const betaMessageBatchIndividualResponse =
* await client.beta.messages.batches.results(
* 'message_batch_id',
* );
* ```
*/
results(messageBatchID: string, params?: BatchResultsParams | undefined, options?: RequestOptions): Promise<JSONLDecoder<BetaMessageBatchIndividualResponse>>;
}
export type BetaMessageBatchesPage = Page<BetaMessageBatch>;
export interface BetaDeletedMessageBatch {
/**
* ID of the Message Batch.
*/
id: string;
/**
* Deleted object type.
*
* For Message Batches, this is always `"message_batch_deleted"`.
*/
type: 'message_batch_deleted';
}
export interface BetaMessageBatch {
/**
* Unique object identifier.
*
* The format and length of IDs may change over time.
*/
id: string;
/**
* RFC 3339 datetime string representing the time at which the Message Batch was
* archived and its results became unavailable.
*/
archived_at: string | null;
/**
* RFC 3339 datetime string representing the time at which cancellation was
* initiated for the Message Batch. Specified only if cancellation was initiated.
*/
cancel_initiated_at: string | null;
/**
* RFC 3339 datetime string representing the time at which the Message Batch was
* created.
*/
created_at: string;
/**
* RFC 3339 datetime string representing the time at which processing for the
* Message Batch ended. Specified only once processing ends.
*
* Processing ends when every request in a Message Batch has either succeeded,
* errored, canceled, or expired.
*/
ended_at: string | null;
/**
* RFC 3339 datetime string representing the time at which the Message Batch will
* expire and end processing, which is 24 hours after creation.
*/
expires_at: string;
/**
* Processing status of the Message Batch.
*/
processing_status: 'in_progress' | 'canceling' | 'ended';
/**
* Tallies requests within the Message Batch, categorized by their status.
*
* Requests start as `processing` and move to one of the other statuses only once
* processing of the entire batch ends. The sum of all values always matches the
* total number of requests in the batch.
*/
request_counts: BetaMessageBatchRequestCounts;
/**
* URL to a `.jsonl` file containing the results of the Message Batch requests.
* Specified only once processing ends.
*
* Results in the file are not guaranteed to be in the same order as requests. Use
* the `custom_id` field to match results to requests.
*/
results_url: string | null;
/**
* Object type.
*
* For Message Batches, this is always `"message_batch"`.
*/
type: 'message_batch';
}
export interface BetaMessageBatchCanceledResult {
type: 'canceled';
}
export interface BetaMessageBatchErroredResult {
error: BetaAPI.BetaErrorResponse;
type: 'errored';
}
export interface BetaMessageBatchExpiredResult {
type: 'expired';
}
/**
* This is a single line in the response `.jsonl` file and does not represent the
* response as a whole.
*/
export interface BetaMessageBatchIndividualResponse {
/**
* Developer-provided ID created for each request in a Message Batch. Useful for
* matching results to requests, as results may be given out of request order.
*
* Must be unique for each request within the Message Batch.
*/
custom_id: string;
/**
* Processing result for this request.
*
* Contains a Message output if processing was successful, an error response if
* processing failed, or the reason why processing was not attempted, such as
* cancellation or expiration.
*/
result: BetaMessageBatchResult;
}
export interface BetaMessageBatchRequestCounts {
/**
* Number of requests in the Message Batch that have been canceled.
*
* This is zero until processing of the entire Message Batch has ended.
*/
canceled: number;
/**
* Number of requests in the Message Batch that encountered an error.
*
* This is zero until processing of the entire Message Batch has ended.
*/
errored: number;
/**
* Number of requests in the Message Batch that have expired.
*
* This is zero until processing of the entire Message Batch has ended.
*/
expired: number;
/**
* Number of requests in the Message Batch that are processing.
*/
processing: number;
/**
* Number of requests in the Message Batch that have completed successfully.
*
* This is zero until processing of the entire Message Batch has ended.
*/
succeeded: number;
}
/**
* Processing result for this request.
*
* Contains a Message output if processing was successful, an error response if
* processing failed, or the reason why processing was not attempted, such as
* cancellation or expiration.
*/
export type BetaMessageBatchResult = BetaMessageBatchSucceededResult | BetaMessageBatchErroredResult | BetaMessageBatchCanceledResult | BetaMessageBatchExpiredResult;
export interface BetaMessageBatchSucceededResult {
message: BetaMessagesAPI.BetaMessage;
type: 'succeeded';
}
export interface BatchCreateParams {
/**
* Body param: List of requests for prompt completion. Each is an individual
* request to create a Message.
*/
requests: Array<BatchCreateParams.Request>;
/**
* Header param: Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export declare namespace BatchCreateParams {
interface Request {
/**
* Developer-provided ID created for each request in a Message Batch. Useful for
* matching results to requests, as results may be given out of request order.
*
* Must be unique for each request within the Message Batch.
*/
custom_id: string;
/**
* Messages API creation parameters for the individual request.
*
* See the [Messages API reference](https://docs.claude.com/en/api/messages) for
* full documentation on available parameters.
*/
params: Request.Params;
}
namespace Request {
/**
* Messages API creation parameters for the individual request.
*
* See the [Messages API reference](https://docs.claude.com/en/api/messages) for
* full documentation on available parameters.
*/
interface Params {
/**
* The maximum number of tokens to generate before stopping.
*
* Note that our models may stop _before_ reaching this maximum. This parameter
* only specifies the absolute maximum number of tokens to generate.
*
* Different models have different maximum values for this parameter. See
* [models](https://docs.claude.com/en/docs/models-overview) for details.
*/
max_tokens: number;
/**
* Input messages.
*
* Our models are trained to operate on alternating `user` and `assistant`
* conversational turns. When creating a new `Message`, you specify the prior
* conversational turns with the `messages` parameter, and the model then generates
* the next `Message` in the conversation. Consecutive `user` or `assistant` turns
* in your request will be combined into a single turn.
*
* Each input message must be an object with a `role` and `content`. You can
* specify a single `user`-role message, or you can include multiple `user` and
* `assistant` messages.
*
* If the final message uses the `assistant` role, the response content will
* continue immediately from the content in that message. This can be used to
* constrain part of the model's response.
*
* Example with a single `user` message:
*
* ```json
* [{ "role": "user", "content": "Hello, Claude" }]
* ```
*
* Example with multiple conversational turns:
*
* ```json
* [
* { "role": "user", "content": "Hello there." },
* { "role": "assistant", "content": "Hi, I'm Claude. How can I help you?" },
* { "role": "user", "content": "Can you explain LLMs in plain English?" }
* ]
* ```
*
* Example with a partially-filled response from Claude:
*
* ```json
* [
* {
* "role": "user",
* "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
* },
* { "role": "assistant", "content": "The best answer is (" }
* ]
* ```
*
* Each input message `content` may be either a single `string` or an array of
* content blocks, where each block has a specific `type`. Using a `string` for
* `content` is shorthand for an array of one content block of type `"text"`. The
* following input messages are equivalent:
*
* ```json
* { "role": "user", "content": "Hello, Claude" }
* ```
*
* ```json
* { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
* ```
*
* See [input examples](https://docs.claude.com/en/api/messages-examples).
*
* Note that if you want to include a
* [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the
* top-level `system` parameter — there is no `"system"` role for input messages in
* the Messages API.
*
* There is a limit of 100,000 messages in a single request.
*/
messages: Array<BetaMessagesAPI.BetaMessageParam>;
/**
* The model that will complete your prompt.\n\nSee
* [models](https://docs.anthropic.com/en/docs/models-overview) for additional
* details and options.
*/
model: MessagesApi.Model;
/**
* Top-level cache control automatically applies a cache_control marker to the last
* cacheable block in the request.
*/
cache_control?: BetaMessagesAPI.BetaCacheControlEphemeral | null;
/**
* Container identifier for reuse across requests.
*/
container?: BetaMessagesAPI.BetaContainerParams | string | null;
/**
* Context management configuration.
*
* This allows you to control how Claude manages context across multiple requests,
* such as whether to clear function results or not.
*/
context_management?: BetaMessagesAPI.BetaContextManagementConfig | null;
/**
* Specifies the geographic region for inference processing. If not specified, the
* workspace's `default_inference_geo` is used.
*/
inference_geo?: string | null;
/**
* MCP servers to be utilized in this request
*/
mcp_servers?: Array<BetaMessagesAPI.BetaRequestMCPServerURLDefinition>;
/**
* An object describing metadata about the request.
*/
metadata?: BetaMessagesAPI.BetaMetadata;
/**
* Configuration options for the model's output, such as the output format.
*/
output_config?: BetaMessagesAPI.BetaOutputConfig;
/**
* @deprecated Deprecated: Use `output_config.format` instead. See
* [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)
*
* A schema to specify Claude's output format in responses. This parameter will be
* removed in a future release.
*/
output_format?: BetaMessagesAPI.BetaJSONOutputFormat | null;
/**
* Determines whether to use priority capacity (if available) or standard capacity
* for this request.
*
* Anthropic offers different levels of service for your API requests. See
* [service-tiers](https://docs.claude.com/en/api/service-tiers) for details.
*/
service_tier?: 'auto' | 'standard_only';
/**
* The inference speed mode for this request. `"fast"` enables high
* output-tokens-per-second inference.
*/
speed?: 'standard' | 'fast' | null;
/**
* Custom text sequences that will cause the model to stop generating.
*
* Our models will normally stop when they have naturally completed their turn,
* which will result in a response `stop_reason` of `"end_turn"`.
*
* If you want the model to stop generating when it encounters custom strings of
* text, you can use the `stop_sequences` parameter. If the model encounters one of
* the custom sequences, the response `stop_reason` value will be `"stop_sequence"`
* and the response `stop_sequence` value will contain the matched stop sequence.
*/
stop_sequences?: Array<string>;
/**
* Whether to incrementally stream the response using server-sent events.
*
* See [streaming](https://docs.claude.com/en/api/messages-streaming) for details.
*/
stream?: boolean;
/**
* System prompt.
*
* A system prompt is a way of providing context and instructions to Claude, such
* as specifying a particular goal or role. See our
* [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
*/
system?: string | Array<BetaMessagesAPI.BetaTextBlockParam>;
/**
* Amount of randomness injected into the response.
*
* Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0`
* for analytical / multiple choice, and closer to `1.0` for creative and
* generative tasks.
*
* Note that even with `temperature` of `0.0`, the results will not be fully
* deterministic.
*/
temperature?: number;
/**
* Configuration for enabling Claude's extended thinking.
*
* When enabled, responses include `thinking` content blocks showing Claude's
* thinking process before the final answer. Requires a minimum budget of 1,024
* tokens and counts towards your `max_tokens` limit.
*
* See
* [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
* for details.
*/
thinking?: BetaMessagesAPI.BetaThinkingConfigParam;
/**
* How the model should use the provided tools. The model can use a specific tool,
* any available tool, decide by itself, or not use tools at all.
*/
tool_choice?: BetaMessagesAPI.BetaToolChoice;
/**
* Definitions of tools that the model may use.
*
* If you include `tools` in your API request, the model may return `tool_use`
* content blocks that represent the model's use of those tools. You can then run
* those tools using the tool input generated by the model and then optionally
* return results back to the model using `tool_result` content blocks.
*
* There are two types of tools: **client tools** and **server tools**. The
* behavior described below applies to client tools. For
* [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
* see their individual documentation as each has its own behavior (e.g., the
* [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
*
* Each tool definition includes:
*
* - `name`: Name of the tool.
* - `description`: Optional, but strongly-recommended description of the tool.
* - `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the
* tool `input` shape that the model will produce in `tool_use` output content
* blocks.
*
* For example, if you defined `tools` as:
*
* ```json
* [
* {
* "name": "get_stock_price",
* "description": "Get the current stock price for a given ticker symbol.",
* "input_schema": {
* "type": "object",
* "properties": {
* "ticker": {
* "type": "string",
* "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
* }
* },
* "required": ["ticker"]
* }
* }
* ]
* ```
*
* And then asked the model "What's the S&P 500 at today?", the model might produce
* `tool_use` content blocks in the response like this:
*
* ```json
* [
* {
* "type": "tool_use",
* "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
* "name": "get_stock_price",
* "input": { "ticker": "^GSPC" }
* }
* ]
* ```
*
* You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an
* input, and return the following back to the model in a subsequent `user`
* message:
*
* ```json
* [
* {
* "type": "tool_result",
* "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
* "content": "259.75 USD"
* }
* ]
* ```
*
* Tools can be used for workflows that include running client-side tools and
* functions, or more generally whenever you want the model to produce a particular
* JSON structure of output.
*
* See our [guide](https://docs.claude.com/en/docs/tool-use) for more details.
*/
tools?: Array<BetaMessagesAPI.BetaToolUnion>;
/**
* Only sample from the top K options for each subsequent token.
*
* Used to remove "long tail" low probability responses.
* [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
*
* Recommended for advanced use cases only. You usually only need to use
* `temperature`.
*/
top_k?: number;
/**
* Use nucleus sampling.
*
* In nucleus sampling, we compute the cumulative distribution over all the options
* for each subsequent token in decreasing probability order and cut it off once it
* reaches a particular probability specified by `top_p`. You should either alter
* `temperature` or `top_p`, but not both.
*
* Recommended for advanced use cases only. You usually only need to use
* `temperature`.
*/
top_p?: number;
}
}
}
export interface BatchRetrieveParams {
/**
* Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export interface BatchListParams extends PageParams {
/**
* Header param: Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export interface BatchDeleteParams {
/**
* Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export interface BatchCancelParams {
/**
* Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export interface BatchResultsParams {
/**
* Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export declare namespace Batches {
export { type BetaDeletedMessageBatch as BetaDeletedMessageBatch, type BetaMessageBatch as BetaMessageBatch, type BetaMessageBatchCanceledResult as BetaMessageBatchCanceledResult, type BetaMessageBatchErroredResult as BetaMessageBatchErroredResult, type BetaMessageBatchExpiredResult as BetaMessageBatchExpiredResult, type BetaMessageBatchIndividualResponse as BetaMessageBatchIndividualResponse, type BetaMessageBatchRequestCounts as BetaMessageBatchRequestCounts, type BetaMessageBatchResult as BetaMessageBatchResult, type BetaMessageBatchSucceededResult as BetaMessageBatchSucceededResult, type BetaMessageBatchesPage as BetaMessageBatchesPage, type BatchCreateParams as BatchCreateParams, type BatchRetrieveParams as BatchRetrieveParams, type BatchListParams as BatchListParams, type BatchDeleteParams as BatchDeleteParams, type BatchCancelParams as BatchCancelParams, type BatchResultsParams as BatchResultsParams, };
}
//# sourceMappingURL=batches.d.mts.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,646 @@
import { APIResource } from "../../../core/resource.js";
import * as BetaAPI from "../beta.js";
import { APIPromise } from "../../../core/api-promise.js";
import * as BetaMessagesAPI from "./messages.js";
import { Page, type PageParams, PagePromise } from "../../../core/pagination.js";
import { RequestOptions } from "../../../internal/request-options.js";
import { JSONLDecoder } from "../../../internal/decoders/jsonl.js";
import * as MessagesApi from "../../messages/messages.js";
export declare class Batches extends APIResource {
/**
* Send a batch of Message creation requests.
*
* The Message Batches API can be used to process multiple Messages API requests at
* once. Once a Message Batch is created, it begins processing immediately. Batches
* can take up to 24 hours to complete.
*
* Learn more about the Message Batches API in our
* [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
*
* @example
* ```ts
* const betaMessageBatch =
* await client.beta.messages.batches.create({
* requests: [
* {
* custom_id: 'my-custom-id-1',
* params: {
* max_tokens: 1024,
* messages: [
* { content: 'Hello, world', role: 'user' },
* ],
* model: 'claude-opus-4-6',
* },
* },
* ],
* });
* ```
*/
create(params: BatchCreateParams, options?: RequestOptions): APIPromise<BetaMessageBatch>;
/**
* This endpoint is idempotent and can be used to poll for Message Batch
* completion. To access the results of a Message Batch, make a request to the
* `results_url` field in the response.
*
* Learn more about the Message Batches API in our
* [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
*
* @example
* ```ts
* const betaMessageBatch =
* await client.beta.messages.batches.retrieve(
* 'message_batch_id',
* );
* ```
*/
retrieve(messageBatchID: string, params?: BatchRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<BetaMessageBatch>;
/**
* List all Message Batches within a Workspace. Most recently created batches are
* returned first.
*
* Learn more about the Message Batches API in our
* [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const betaMessageBatch of client.beta.messages.batches.list()) {
* // ...
* }
* ```
*/
list(params?: BatchListParams | null | undefined, options?: RequestOptions): PagePromise<BetaMessageBatchesPage, BetaMessageBatch>;
/**
* Delete a Message Batch.
*
* Message Batches can only be deleted once they've finished processing. If you'd
* like to delete an in-progress batch, you must first cancel it.
*
* Learn more about the Message Batches API in our
* [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
*
* @example
* ```ts
* const betaDeletedMessageBatch =
* await client.beta.messages.batches.delete(
* 'message_batch_id',
* );
* ```
*/
delete(messageBatchID: string, params?: BatchDeleteParams | null | undefined, options?: RequestOptions): APIPromise<BetaDeletedMessageBatch>;
/**
* Batches may be canceled any time before processing ends. Once cancellation is
* initiated, the batch enters a `canceling` state, at which time the system may
* complete any in-progress, non-interruptible requests before finalizing
* cancellation.
*
* The number of canceled requests is specified in `request_counts`. To determine
* which requests were canceled, check the individual results within the batch.
* Note that cancellation may not result in any canceled requests if they were
* non-interruptible.
*
* Learn more about the Message Batches API in our
* [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
*
* @example
* ```ts
* const betaMessageBatch =
* await client.beta.messages.batches.cancel(
* 'message_batch_id',
* );
* ```
*/
cancel(messageBatchID: string, params?: BatchCancelParams | null | undefined, options?: RequestOptions): APIPromise<BetaMessageBatch>;
/**
* Streams the results of a Message Batch as a `.jsonl` file.
*
* Each line in the file is a JSON object containing the result of a single request
* in the Message Batch. Results are not guaranteed to be in the same order as
* requests. Use the `custom_id` field to match results to requests.
*
* Learn more about the Message Batches API in our
* [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
*
* @example
* ```ts
* const betaMessageBatchIndividualResponse =
* await client.beta.messages.batches.results(
* 'message_batch_id',
* );
* ```
*/
results(messageBatchID: string, params?: BatchResultsParams | undefined, options?: RequestOptions): Promise<JSONLDecoder<BetaMessageBatchIndividualResponse>>;
}
export type BetaMessageBatchesPage = Page<BetaMessageBatch>;
export interface BetaDeletedMessageBatch {
/**
* ID of the Message Batch.
*/
id: string;
/**
* Deleted object type.
*
* For Message Batches, this is always `"message_batch_deleted"`.
*/
type: 'message_batch_deleted';
}
export interface BetaMessageBatch {
/**
* Unique object identifier.
*
* The format and length of IDs may change over time.
*/
id: string;
/**
* RFC 3339 datetime string representing the time at which the Message Batch was
* archived and its results became unavailable.
*/
archived_at: string | null;
/**
* RFC 3339 datetime string representing the time at which cancellation was
* initiated for the Message Batch. Specified only if cancellation was initiated.
*/
cancel_initiated_at: string | null;
/**
* RFC 3339 datetime string representing the time at which the Message Batch was
* created.
*/
created_at: string;
/**
* RFC 3339 datetime string representing the time at which processing for the
* Message Batch ended. Specified only once processing ends.
*
* Processing ends when every request in a Message Batch has either succeeded,
* errored, canceled, or expired.
*/
ended_at: string | null;
/**
* RFC 3339 datetime string representing the time at which the Message Batch will
* expire and end processing, which is 24 hours after creation.
*/
expires_at: string;
/**
* Processing status of the Message Batch.
*/
processing_status: 'in_progress' | 'canceling' | 'ended';
/**
* Tallies requests within the Message Batch, categorized by their status.
*
* Requests start as `processing` and move to one of the other statuses only once
* processing of the entire batch ends. The sum of all values always matches the
* total number of requests in the batch.
*/
request_counts: BetaMessageBatchRequestCounts;
/**
* URL to a `.jsonl` file containing the results of the Message Batch requests.
* Specified only once processing ends.
*
* Results in the file are not guaranteed to be in the same order as requests. Use
* the `custom_id` field to match results to requests.
*/
results_url: string | null;
/**
* Object type.
*
* For Message Batches, this is always `"message_batch"`.
*/
type: 'message_batch';
}
export interface BetaMessageBatchCanceledResult {
type: 'canceled';
}
export interface BetaMessageBatchErroredResult {
error: BetaAPI.BetaErrorResponse;
type: 'errored';
}
export interface BetaMessageBatchExpiredResult {
type: 'expired';
}
/**
* This is a single line in the response `.jsonl` file and does not represent the
* response as a whole.
*/
export interface BetaMessageBatchIndividualResponse {
/**
* Developer-provided ID created for each request in a Message Batch. Useful for
* matching results to requests, as results may be given out of request order.
*
* Must be unique for each request within the Message Batch.
*/
custom_id: string;
/**
* Processing result for this request.
*
* Contains a Message output if processing was successful, an error response if
* processing failed, or the reason why processing was not attempted, such as
* cancellation or expiration.
*/
result: BetaMessageBatchResult;
}
export interface BetaMessageBatchRequestCounts {
/**
* Number of requests in the Message Batch that have been canceled.
*
* This is zero until processing of the entire Message Batch has ended.
*/
canceled: number;
/**
* Number of requests in the Message Batch that encountered an error.
*
* This is zero until processing of the entire Message Batch has ended.
*/
errored: number;
/**
* Number of requests in the Message Batch that have expired.
*
* This is zero until processing of the entire Message Batch has ended.
*/
expired: number;
/**
* Number of requests in the Message Batch that are processing.
*/
processing: number;
/**
* Number of requests in the Message Batch that have completed successfully.
*
* This is zero until processing of the entire Message Batch has ended.
*/
succeeded: number;
}
/**
* Processing result for this request.
*
* Contains a Message output if processing was successful, an error response if
* processing failed, or the reason why processing was not attempted, such as
* cancellation or expiration.
*/
export type BetaMessageBatchResult = BetaMessageBatchSucceededResult | BetaMessageBatchErroredResult | BetaMessageBatchCanceledResult | BetaMessageBatchExpiredResult;
export interface BetaMessageBatchSucceededResult {
message: BetaMessagesAPI.BetaMessage;
type: 'succeeded';
}
export interface BatchCreateParams {
/**
* Body param: List of requests for prompt completion. Each is an individual
* request to create a Message.
*/
requests: Array<BatchCreateParams.Request>;
/**
* Header param: Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export declare namespace BatchCreateParams {
interface Request {
/**
* Developer-provided ID created for each request in a Message Batch. Useful for
* matching results to requests, as results may be given out of request order.
*
* Must be unique for each request within the Message Batch.
*/
custom_id: string;
/**
* Messages API creation parameters for the individual request.
*
* See the [Messages API reference](https://docs.claude.com/en/api/messages) for
* full documentation on available parameters.
*/
params: Request.Params;
}
namespace Request {
/**
* Messages API creation parameters for the individual request.
*
* See the [Messages API reference](https://docs.claude.com/en/api/messages) for
* full documentation on available parameters.
*/
interface Params {
/**
* The maximum number of tokens to generate before stopping.
*
* Note that our models may stop _before_ reaching this maximum. This parameter
* only specifies the absolute maximum number of tokens to generate.
*
* Different models have different maximum values for this parameter. See
* [models](https://docs.claude.com/en/docs/models-overview) for details.
*/
max_tokens: number;
/**
* Input messages.
*
* Our models are trained to operate on alternating `user` and `assistant`
* conversational turns. When creating a new `Message`, you specify the prior
* conversational turns with the `messages` parameter, and the model then generates
* the next `Message` in the conversation. Consecutive `user` or `assistant` turns
* in your request will be combined into a single turn.
*
* Each input message must be an object with a `role` and `content`. You can
* specify a single `user`-role message, or you can include multiple `user` and
* `assistant` messages.
*
* If the final message uses the `assistant` role, the response content will
* continue immediately from the content in that message. This can be used to
* constrain part of the model's response.
*
* Example with a single `user` message:
*
* ```json
* [{ "role": "user", "content": "Hello, Claude" }]
* ```
*
* Example with multiple conversational turns:
*
* ```json
* [
* { "role": "user", "content": "Hello there." },
* { "role": "assistant", "content": "Hi, I'm Claude. How can I help you?" },
* { "role": "user", "content": "Can you explain LLMs in plain English?" }
* ]
* ```
*
* Example with a partially-filled response from Claude:
*
* ```json
* [
* {
* "role": "user",
* "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
* },
* { "role": "assistant", "content": "The best answer is (" }
* ]
* ```
*
* Each input message `content` may be either a single `string` or an array of
* content blocks, where each block has a specific `type`. Using a `string` for
* `content` is shorthand for an array of one content block of type `"text"`. The
* following input messages are equivalent:
*
* ```json
* { "role": "user", "content": "Hello, Claude" }
* ```
*
* ```json
* { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
* ```
*
* See [input examples](https://docs.claude.com/en/api/messages-examples).
*
* Note that if you want to include a
* [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the
* top-level `system` parameter — there is no `"system"` role for input messages in
* the Messages API.
*
* There is a limit of 100,000 messages in a single request.
*/
messages: Array<BetaMessagesAPI.BetaMessageParam>;
/**
* The model that will complete your prompt.\n\nSee
* [models](https://docs.anthropic.com/en/docs/models-overview) for additional
* details and options.
*/
model: MessagesApi.Model;
/**
* Top-level cache control automatically applies a cache_control marker to the last
* cacheable block in the request.
*/
cache_control?: BetaMessagesAPI.BetaCacheControlEphemeral | null;
/**
* Container identifier for reuse across requests.
*/
container?: BetaMessagesAPI.BetaContainerParams | string | null;
/**
* Context management configuration.
*
* This allows you to control how Claude manages context across multiple requests,
* such as whether to clear function results or not.
*/
context_management?: BetaMessagesAPI.BetaContextManagementConfig | null;
/**
* Specifies the geographic region for inference processing. If not specified, the
* workspace's `default_inference_geo` is used.
*/
inference_geo?: string | null;
/**
* MCP servers to be utilized in this request
*/
mcp_servers?: Array<BetaMessagesAPI.BetaRequestMCPServerURLDefinition>;
/**
* An object describing metadata about the request.
*/
metadata?: BetaMessagesAPI.BetaMetadata;
/**
* Configuration options for the model's output, such as the output format.
*/
output_config?: BetaMessagesAPI.BetaOutputConfig;
/**
* @deprecated Deprecated: Use `output_config.format` instead. See
* [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)
*
* A schema to specify Claude's output format in responses. This parameter will be
* removed in a future release.
*/
output_format?: BetaMessagesAPI.BetaJSONOutputFormat | null;
/**
* Determines whether to use priority capacity (if available) or standard capacity
* for this request.
*
* Anthropic offers different levels of service for your API requests. See
* [service-tiers](https://docs.claude.com/en/api/service-tiers) for details.
*/
service_tier?: 'auto' | 'standard_only';
/**
* The inference speed mode for this request. `"fast"` enables high
* output-tokens-per-second inference.
*/
speed?: 'standard' | 'fast' | null;
/**
* Custom text sequences that will cause the model to stop generating.
*
* Our models will normally stop when they have naturally completed their turn,
* which will result in a response `stop_reason` of `"end_turn"`.
*
* If you want the model to stop generating when it encounters custom strings of
* text, you can use the `stop_sequences` parameter. If the model encounters one of
* the custom sequences, the response `stop_reason` value will be `"stop_sequence"`
* and the response `stop_sequence` value will contain the matched stop sequence.
*/
stop_sequences?: Array<string>;
/**
* Whether to incrementally stream the response using server-sent events.
*
* See [streaming](https://docs.claude.com/en/api/messages-streaming) for details.
*/
stream?: boolean;
/**
* System prompt.
*
* A system prompt is a way of providing context and instructions to Claude, such
* as specifying a particular goal or role. See our
* [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
*/
system?: string | Array<BetaMessagesAPI.BetaTextBlockParam>;
/**
* Amount of randomness injected into the response.
*
* Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0`
* for analytical / multiple choice, and closer to `1.0` for creative and
* generative tasks.
*
* Note that even with `temperature` of `0.0`, the results will not be fully
* deterministic.
*/
temperature?: number;
/**
* Configuration for enabling Claude's extended thinking.
*
* When enabled, responses include `thinking` content blocks showing Claude's
* thinking process before the final answer. Requires a minimum budget of 1,024
* tokens and counts towards your `max_tokens` limit.
*
* See
* [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
* for details.
*/
thinking?: BetaMessagesAPI.BetaThinkingConfigParam;
/**
* How the model should use the provided tools. The model can use a specific tool,
* any available tool, decide by itself, or not use tools at all.
*/
tool_choice?: BetaMessagesAPI.BetaToolChoice;
/**
* Definitions of tools that the model may use.
*
* If you include `tools` in your API request, the model may return `tool_use`
* content blocks that represent the model's use of those tools. You can then run
* those tools using the tool input generated by the model and then optionally
* return results back to the model using `tool_result` content blocks.
*
* There are two types of tools: **client tools** and **server tools**. The
* behavior described below applies to client tools. For
* [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
* see their individual documentation as each has its own behavior (e.g., the
* [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
*
* Each tool definition includes:
*
* - `name`: Name of the tool.
* - `description`: Optional, but strongly-recommended description of the tool.
* - `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the
* tool `input` shape that the model will produce in `tool_use` output content
* blocks.
*
* For example, if you defined `tools` as:
*
* ```json
* [
* {
* "name": "get_stock_price",
* "description": "Get the current stock price for a given ticker symbol.",
* "input_schema": {
* "type": "object",
* "properties": {
* "ticker": {
* "type": "string",
* "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
* }
* },
* "required": ["ticker"]
* }
* }
* ]
* ```
*
* And then asked the model "What's the S&P 500 at today?", the model might produce
* `tool_use` content blocks in the response like this:
*
* ```json
* [
* {
* "type": "tool_use",
* "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
* "name": "get_stock_price",
* "input": { "ticker": "^GSPC" }
* }
* ]
* ```
*
* You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an
* input, and return the following back to the model in a subsequent `user`
* message:
*
* ```json
* [
* {
* "type": "tool_result",
* "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
* "content": "259.75 USD"
* }
* ]
* ```
*
* Tools can be used for workflows that include running client-side tools and
* functions, or more generally whenever you want the model to produce a particular
* JSON structure of output.
*
* See our [guide](https://docs.claude.com/en/docs/tool-use) for more details.
*/
tools?: Array<BetaMessagesAPI.BetaToolUnion>;
/**
* Only sample from the top K options for each subsequent token.
*
* Used to remove "long tail" low probability responses.
* [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
*
* Recommended for advanced use cases only. You usually only need to use
* `temperature`.
*/
top_k?: number;
/**
* Use nucleus sampling.
*
* In nucleus sampling, we compute the cumulative distribution over all the options
* for each subsequent token in decreasing probability order and cut it off once it
* reaches a particular probability specified by `top_p`. You should either alter
* `temperature` or `top_p`, but not both.
*
* Recommended for advanced use cases only. You usually only need to use
* `temperature`.
*/
top_p?: number;
}
}
}
export interface BatchRetrieveParams {
/**
* Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export interface BatchListParams extends PageParams {
/**
* Header param: Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export interface BatchDeleteParams {
/**
* Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export interface BatchCancelParams {
/**
* Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export interface BatchResultsParams {
/**
* Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export declare namespace Batches {
export { type BetaDeletedMessageBatch as BetaDeletedMessageBatch, type BetaMessageBatch as BetaMessageBatch, type BetaMessageBatchCanceledResult as BetaMessageBatchCanceledResult, type BetaMessageBatchErroredResult as BetaMessageBatchErroredResult, type BetaMessageBatchExpiredResult as BetaMessageBatchExpiredResult, type BetaMessageBatchIndividualResponse as BetaMessageBatchIndividualResponse, type BetaMessageBatchRequestCounts as BetaMessageBatchRequestCounts, type BetaMessageBatchResult as BetaMessageBatchResult, type BetaMessageBatchSucceededResult as BetaMessageBatchSucceededResult, type BetaMessageBatchesPage as BetaMessageBatchesPage, type BatchCreateParams as BatchCreateParams, type BatchRetrieveParams as BatchRetrieveParams, type BatchListParams as BatchListParams, type BatchDeleteParams as BatchDeleteParams, type BatchCancelParams as BatchCancelParams, type BatchResultsParams as BatchResultsParams, };
}
//# sourceMappingURL=batches.d.ts.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,204 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Batches = void 0;
const resource_1 = require("../../../core/resource.js");
const pagination_1 = require("../../../core/pagination.js");
const headers_1 = require("../../../internal/headers.js");
const jsonl_1 = require("../../../internal/decoders/jsonl.js");
const error_1 = require("../../../error.js");
const path_1 = require("../../../internal/utils/path.js");
class Batches extends resource_1.APIResource {
/**
* Send a batch of Message creation requests.
*
* The Message Batches API can be used to process multiple Messages API requests at
* once. Once a Message Batch is created, it begins processing immediately. Batches
* can take up to 24 hours to complete.
*
* Learn more about the Message Batches API in our
* [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
*
* @example
* ```ts
* const betaMessageBatch =
* await client.beta.messages.batches.create({
* requests: [
* {
* custom_id: 'my-custom-id-1',
* params: {
* max_tokens: 1024,
* messages: [
* { content: 'Hello, world', role: 'user' },
* ],
* model: 'claude-opus-4-6',
* },
* },
* ],
* });
* ```
*/
create(params, options) {
const { betas, ...body } = params;
return this._client.post('/v1/messages/batches?beta=true', {
body,
...options,
headers: (0, headers_1.buildHeaders)([
{ 'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString() },
options?.headers,
]),
});
}
/**
* This endpoint is idempotent and can be used to poll for Message Batch
* completion. To access the results of a Message Batch, make a request to the
* `results_url` field in the response.
*
* Learn more about the Message Batches API in our
* [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
*
* @example
* ```ts
* const betaMessageBatch =
* await client.beta.messages.batches.retrieve(
* 'message_batch_id',
* );
* ```
*/
retrieve(messageBatchID, params = {}, options) {
const { betas } = params ?? {};
return this._client.get((0, path_1.path) `/v1/messages/batches/${messageBatchID}?beta=true`, {
...options,
headers: (0, headers_1.buildHeaders)([
{ 'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString() },
options?.headers,
]),
});
}
/**
* List all Message Batches within a Workspace. Most recently created batches are
* returned first.
*
* Learn more about the Message Batches API in our
* [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const betaMessageBatch of client.beta.messages.batches.list()) {
* // ...
* }
* ```
*/
list(params = {}, options) {
const { betas, ...query } = params ?? {};
return this._client.getAPIList('/v1/messages/batches?beta=true', (pagination_1.Page), {
query,
...options,
headers: (0, headers_1.buildHeaders)([
{ 'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString() },
options?.headers,
]),
});
}
/**
* Delete a Message Batch.
*
* Message Batches can only be deleted once they've finished processing. If you'd
* like to delete an in-progress batch, you must first cancel it.
*
* Learn more about the Message Batches API in our
* [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
*
* @example
* ```ts
* const betaDeletedMessageBatch =
* await client.beta.messages.batches.delete(
* 'message_batch_id',
* );
* ```
*/
delete(messageBatchID, params = {}, options) {
const { betas } = params ?? {};
return this._client.delete((0, path_1.path) `/v1/messages/batches/${messageBatchID}?beta=true`, {
...options,
headers: (0, headers_1.buildHeaders)([
{ 'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString() },
options?.headers,
]),
});
}
/**
* Batches may be canceled any time before processing ends. Once cancellation is
* initiated, the batch enters a `canceling` state, at which time the system may
* complete any in-progress, non-interruptible requests before finalizing
* cancellation.
*
* The number of canceled requests is specified in `request_counts`. To determine
* which requests were canceled, check the individual results within the batch.
* Note that cancellation may not result in any canceled requests if they were
* non-interruptible.
*
* Learn more about the Message Batches API in our
* [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
*
* @example
* ```ts
* const betaMessageBatch =
* await client.beta.messages.batches.cancel(
* 'message_batch_id',
* );
* ```
*/
cancel(messageBatchID, params = {}, options) {
const { betas } = params ?? {};
return this._client.post((0, path_1.path) `/v1/messages/batches/${messageBatchID}/cancel?beta=true`, {
...options,
headers: (0, headers_1.buildHeaders)([
{ 'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString() },
options?.headers,
]),
});
}
/**
* Streams the results of a Message Batch as a `.jsonl` file.
*
* Each line in the file is a JSON object containing the result of a single request
* in the Message Batch. Results are not guaranteed to be in the same order as
* requests. Use the `custom_id` field to match results to requests.
*
* Learn more about the Message Batches API in our
* [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
*
* @example
* ```ts
* const betaMessageBatchIndividualResponse =
* await client.beta.messages.batches.results(
* 'message_batch_id',
* );
* ```
*/
async results(messageBatchID, params = {}, options) {
const batch = await this.retrieve(messageBatchID);
if (!batch.results_url) {
throw new error_1.AnthropicError(`No batch \`results_url\`; Has it finished processing? ${batch.processing_status} - ${batch.id}`);
}
const { betas } = params ?? {};
return this._client
.get(batch.results_url, {
...options,
headers: (0, headers_1.buildHeaders)([
{
'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString(),
Accept: 'application/binary',
},
options?.headers,
]),
stream: true,
__binaryResponse: true,
})
._thenUnwrap((_, props) => jsonl_1.JSONLDecoder.fromResponse(props.response, props.controller));
}
}
exports.Batches = Batches;
//# sourceMappingURL=batches.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"batches.js","sourceRoot":"","sources":["../../../src/resources/beta/messages/batches.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAIrD,4DAA8E;AAC9E,0DAAyD;AAEzD,+DAAgE;AAChE,6CAAgD;AAChD,0DAAoD;AAGpD,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,MAAM,CAAC,MAAyB,EAAE,OAAwB;QACxD,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAClC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gCAAgC,EAAE;YACzD,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC;gBACpB,EAAE,gBAAgB,EAAE,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,4BAA4B,CAAC,CAAC,QAAQ,EAAE,EAAE;gBACjF,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CACN,cAAsB,EACtB,SAAiD,EAAE,EACnD,OAAwB;QAExB,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,wBAAwB,cAAc,YAAY,EAAE;YAC9E,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC;gBACpB,EAAE,gBAAgB,EAAE,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,4BAA4B,CAAC,CAAC,QAAQ,EAAE,EAAE;gBACjF,OAAO,EAAE,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our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../core/resource.mjs";
import { Page } from "../../../core/pagination.mjs";
import { buildHeaders } from "../../../internal/headers.mjs";
import { JSONLDecoder } from "../../../internal/decoders/jsonl.mjs";
import { AnthropicError } from "../../../error.mjs";
import { path } from "../../../internal/utils/path.mjs";
export class Batches extends APIResource {
/**
* Send a batch of Message creation requests.
*
* The Message Batches API can be used to process multiple Messages API requests at
* once. Once a Message Batch is created, it begins processing immediately. Batches
* can take up to 24 hours to complete.
*
* Learn more about the Message Batches API in our
* [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
*
* @example
* ```ts
* const betaMessageBatch =
* await client.beta.messages.batches.create({
* requests: [
* {
* custom_id: 'my-custom-id-1',
* params: {
* max_tokens: 1024,
* messages: [
* { content: 'Hello, world', role: 'user' },
* ],
* model: 'claude-opus-4-6',
* },
* },
* ],
* });
* ```
*/
create(params, options) {
const { betas, ...body } = params;
return this._client.post('/v1/messages/batches?beta=true', {
body,
...options,
headers: buildHeaders([
{ 'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString() },
options?.headers,
]),
});
}
/**
* This endpoint is idempotent and can be used to poll for Message Batch
* completion. To access the results of a Message Batch, make a request to the
* `results_url` field in the response.
*
* Learn more about the Message Batches API in our
* [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
*
* @example
* ```ts
* const betaMessageBatch =
* await client.beta.messages.batches.retrieve(
* 'message_batch_id',
* );
* ```
*/
retrieve(messageBatchID, params = {}, options) {
const { betas } = params ?? {};
return this._client.get(path `/v1/messages/batches/${messageBatchID}?beta=true`, {
...options,
headers: buildHeaders([
{ 'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString() },
options?.headers,
]),
});
}
/**
* List all Message Batches within a Workspace. Most recently created batches are
* returned first.
*
* Learn more about the Message Batches API in our
* [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const betaMessageBatch of client.beta.messages.batches.list()) {
* // ...
* }
* ```
*/
list(params = {}, options) {
const { betas, ...query } = params ?? {};
return this._client.getAPIList('/v1/messages/batches?beta=true', (Page), {
query,
...options,
headers: buildHeaders([
{ 'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString() },
options?.headers,
]),
});
}
/**
* Delete a Message Batch.
*
* Message Batches can only be deleted once they've finished processing. If you'd
* like to delete an in-progress batch, you must first cancel it.
*
* Learn more about the Message Batches API in our
* [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
*
* @example
* ```ts
* const betaDeletedMessageBatch =
* await client.beta.messages.batches.delete(
* 'message_batch_id',
* );
* ```
*/
delete(messageBatchID, params = {}, options) {
const { betas } = params ?? {};
return this._client.delete(path `/v1/messages/batches/${messageBatchID}?beta=true`, {
...options,
headers: buildHeaders([
{ 'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString() },
options?.headers,
]),
});
}
/**
* Batches may be canceled any time before processing ends. Once cancellation is
* initiated, the batch enters a `canceling` state, at which time the system may
* complete any in-progress, non-interruptible requests before finalizing
* cancellation.
*
* The number of canceled requests is specified in `request_counts`. To determine
* which requests were canceled, check the individual results within the batch.
* Note that cancellation may not result in any canceled requests if they were
* non-interruptible.
*
* Learn more about the Message Batches API in our
* [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
*
* @example
* ```ts
* const betaMessageBatch =
* await client.beta.messages.batches.cancel(
* 'message_batch_id',
* );
* ```
*/
cancel(messageBatchID, params = {}, options) {
const { betas } = params ?? {};
return this._client.post(path `/v1/messages/batches/${messageBatchID}/cancel?beta=true`, {
...options,
headers: buildHeaders([
{ 'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString() },
options?.headers,
]),
});
}
/**
* Streams the results of a Message Batch as a `.jsonl` file.
*
* Each line in the file is a JSON object containing the result of a single request
* in the Message Batch. Results are not guaranteed to be in the same order as
* requests. Use the `custom_id` field to match results to requests.
*
* Learn more about the Message Batches API in our
* [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
*
* @example
* ```ts
* const betaMessageBatchIndividualResponse =
* await client.beta.messages.batches.results(
* 'message_batch_id',
* );
* ```
*/
async results(messageBatchID, params = {}, options) {
const batch = await this.retrieve(messageBatchID);
if (!batch.results_url) {
throw new AnthropicError(`No batch \`results_url\`; Has it finished processing? ${batch.processing_status} - ${batch.id}`);
}
const { betas } = params ?? {};
return this._client
.get(batch.results_url, {
...options,
headers: buildHeaders([
{
'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString(),
Accept: 'application/binary',
},
options?.headers,
]),
stream: true,
__binaryResponse: true,
})
._thenUnwrap((_, props) => JSONLDecoder.fromResponse(props.response, props.controller));
}
}
//# sourceMappingURL=batches.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"batches.mjs","sourceRoot":"","sources":["../../../src/resources/beta/messages/batches.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAIf,EAAE,IAAI,EAAgC;OACtC,EAAE,YAAY,EAAE;OAEhB,EAAE,YAAY,EAAE;OAChB,EAAE,cAAc,EAAE;OAClB,EAAE,IAAI,EAAE;AAGf,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,MAAM,CAAC,MAAyB,EAAE,OAAwB;QACxD,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAClC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gCAAgC,EAAE;YACzD,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;gBACpB,EAAE,gBAAgB,EAAE,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,4BAA4B,CAAC,CAAC,QAAQ,EAAE,EAAE;gBACjF,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,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AE,CAAC,EAAE,4BAA4B,CAAC,CAAC,QAAQ,EAAE;oBAC7E,MAAM,EAAE,oBAAoB;iBAC7B;gBACD,OAAO,EAAE,OAAO;aACjB,CAAC;YACF,MAAM,EAAE,IAAI;YACZ,gBAAgB,EAAE,IAAI;SACvB,CAAC;aACD,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,CAEvF,CAAC;IACJ,CAAC;CACF"}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/resources/beta/messages/index.ts"],"names":[],"mappings":"OAEO,EACL,OAAO,EACP,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,EACrB,KAAK,8BAA8B,EACnC,KAAK,6BAA6B,EAClC,KAAK,6BAA6B,EAClC,KAAK,kCAAkC,EACvC,KAAK,6BAA6B,EAClC,KAAK,sBAAsB,EAC3B,KAAK,+BAA+B,EACpC,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,GAC5B;OACM,EACL,QAAQ,EACR,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,gCAAgC,EACrC,KAAK,qCAAqC,EAC1C,KAAK,gCAAgC,EACrC,KAAK,qCAAqC,EAC1C,KAAK,oCAAoC,EACzC,KAAK,yCAAyC,EAC9C,KAAK,oCAAoC,EACzC,KAAK,yCAAyC,EAC9C,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,6BAA6B,EAClC,KAAK,kBAAkB,EACvB,KAAK,gCAAgC,EACrC,KAAK,qCAAqC,EAC1C,KAAK,wBAAwB,EAC7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kC,EACvC,KAAK,mCAAmC,EACxC,KAAK,wCAAwC,EAC7C,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,+BAA+B,GACrC;OACM,EAAE,cAAc,EAAE,KAAK,oBAAoB,EAAE,SAAS,EAAE"}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/messages/index.ts"],"names":[],"mappings":"OAEO,EACL,OAAO,EACP,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,EACrB,KAAK,8BAA8B,EACnC,KAAK,6BAA6B,EAClC,KAAK,6BAA6B,EAClC,KAAK,kCAAkC,EACvC,KAAK,6BAA6B,EAClC,KAAK,sBAAsB,EAC3B,KAAK,+BAA+B,EACpC,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,GAC5B;OACM,EACL,QAAQ,EACR,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,gCAAgC,EACrC,KAAK,qCAAqC,EAC1C,KAAK,gCAAgC,EACrC,KAAK,qCAAqC,EAC1C,KAAK,oCAAoC,EACzC,KAAK,yCAAyC,EAC9C,KAAK,oCAAoC,EACzC,KAAK,yCAAyC,EAC9C,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,6BAA6B,EAClC,KAAK,kBAAkB,EACvB,KAAK,gCAAgC,EACrC,KAAK,qCAAqC,EAC1C,KAAK,wBAAwB,EAC7B,KAAK,6BAA6B,EAClC,KAAK,gCAAgC,EACrC,KAAK,qCAAqC,EAC1C,KAAK,wCAAwC,EAC7C,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EACvB,KAAK,oCAAoC,EACzC,KAAK,6BAA6B,EAClC,KAAK,q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@ -0,0 +1,12 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.ToolError = exports.BetaToolRunner = exports.Messages = exports.Batches = void 0;
var batches_1 = require("./batches.js");
Object.defineProperty(exports, "Batches", { enumerable: true, get: function () { return batches_1.Batches; } });
var messages_1 = require("./messages.js");
Object.defineProperty(exports, "Messages", { enumerable: true, get: function () { return messages_1.Messages; } });
var messages_2 = require("./messages.js");
Object.defineProperty(exports, "BetaToolRunner", { enumerable: true, get: function () { return messages_2.BetaToolRunner; } });
Object.defineProperty(exports, "ToolError", { enumerable: true, get: function () { return messages_2.ToolError; } });
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/beta/messages/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wCAkBmB;AAjBjB,kGAAA,OAAO,OAAA;AAkBT,0CA6MoB;AA5MlB,oGAAA,QAAQ,OAAA;AA6MV,0CAAkF;AAAzE,0GAAA,cAAc,OAAA;AAA6B,qGAAA,SAAS,OAAA"}

View File

@@ -0,0 +1,5 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
export { Batches, } from "./batches.mjs";
export { Messages, } from "./messages.mjs";
export { BetaToolRunner, ToolError } from "./messages.mjs";
//# sourceMappingURL=index.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/resources/beta/messages/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,OAAO,GAiBR;OACM,EACL,QAAQ,GA4MT;OACM,EAAE,cAAc,EAA6B,SAAS,EAAE"}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,163 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.ToolError = exports.BetaToolRunner = exports.Messages = void 0;
const tslib_1 = require("../../../internal/tslib.js");
const error_1 = require("../../../error.js");
const resource_1 = require("../../../core/resource.js");
const constants_1 = require("../../../internal/constants.js");
const headers_1 = require("../../../internal/headers.js");
const stainless_helper_header_1 = require("../../../lib/stainless-helper-header.js");
const beta_parser_1 = require("../../../lib/beta-parser.js");
const BetaMessageStream_1 = require("../../../lib/BetaMessageStream.js");
const BetaToolRunner_1 = require("../../../lib/tools/BetaToolRunner.js");
const ToolError_1 = require("../../../lib/tools/ToolError.js");
const BatchesAPI = tslib_1.__importStar(require("./batches.js"));
const batches_1 = require("./batches.js");
const DEPRECATED_MODELS = {
'claude-1.3': 'November 6th, 2024',
'claude-1.3-100k': 'November 6th, 2024',
'claude-instant-1.1': 'November 6th, 2024',
'claude-instant-1.1-100k': 'November 6th, 2024',
'claude-instant-1.2': 'November 6th, 2024',
'claude-3-sonnet-20240229': 'July 21st, 2025',
'claude-3-opus-20240229': 'January 5th, 2026',
'claude-2.1': 'July 21st, 2025',
'claude-2.0': 'July 21st, 2025',
'claude-3-7-sonnet-latest': 'February 19th, 2026',
'claude-3-7-sonnet-20250219': 'February 19th, 2026',
};
const MODELS_TO_WARN_WITH_THINKING_ENABLED = ['claude-opus-4-6'];
class Messages extends resource_1.APIResource {
constructor() {
super(...arguments);
this.batches = new BatchesAPI.Batches(this._client);
}
create(params, options) {
// Transform deprecated output_format to output_config.format
const modifiedParams = transformOutputFormat(params);
const { betas, ...body } = modifiedParams;
if (body.model in DEPRECATED_MODELS) {
console.warn(`The model '${body.model}' is deprecated and will reach end-of-life on ${DEPRECATED_MODELS[body.model]}\nPlease migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);
}
if (body.model in MODELS_TO_WARN_WITH_THINKING_ENABLED &&
body.thinking &&
body.thinking.type === 'enabled') {
console.warn(`Using Claude with ${body.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);
}
let timeout = this._client._options.timeout;
if (!body.stream && timeout == null) {
const maxNonstreamingTokens = constants_1.MODEL_NONSTREAMING_TOKENS[body.model] ?? undefined;
timeout = this._client.calculateNonstreamingTimeout(body.max_tokens, maxNonstreamingTokens);
}
// Collect helper info from tools and messages
const helperHeader = (0, stainless_helper_header_1.stainlessHelperHeader)(body.tools, body.messages);
return this._client.post('/v1/messages?beta=true', {
body,
timeout: timeout ?? 600000,
...options,
headers: (0, headers_1.buildHeaders)([
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
helperHeader,
options?.headers,
]),
stream: modifiedParams.stream ?? false,
});
}
/**
* Send a structured list of input messages with text and/or image content, along with an expected `output_format` and
* the response will be automatically parsed and available in the `parsed_output` property of the message.
*
* @example
* ```ts
* const message = await client.beta.messages.parse({
* model: 'claude-3-5-sonnet-20241022',
* max_tokens: 1024,
* messages: [{ role: 'user', content: 'What is 2+2?' }],
* output_format: zodOutputFormat(z.object({ answer: z.number() }), 'math'),
* });
*
* console.log(message.parsed_output?.answer); // 4
* ```
*/
parse(params, options) {
options = {
...options,
headers: (0, headers_1.buildHeaders)([
{ 'anthropic-beta': [...(params.betas ?? []), 'structured-outputs-2025-12-15'].toString() },
options?.headers,
]),
};
return this.create(params, options).then((message) => (0, beta_parser_1.parseBetaMessage)(message, params, { logger: this._client.logger ?? console }));
}
/**
* Create a Message stream
*/
stream(body, options) {
return BetaMessageStream_1.BetaMessageStream.createMessage(this, body, options);
}
/**
* Count the number of tokens in a Message.
*
* The Token Count API can be used to count the number of tokens in a Message,
* including tools, images, and documents, without creating it.
*
* Learn more about token counting in our
* [user guide](https://docs.claude.com/en/docs/build-with-claude/token-counting)
*
* @example
* ```ts
* const betaMessageTokensCount =
* await client.beta.messages.countTokens({
* messages: [{ content: 'string', role: 'user' }],
* model: 'claude-opus-4-6',
* });
* ```
*/
countTokens(params, options) {
// Transform deprecated output_format to output_config.format
const modifiedParams = transformOutputFormat(params);
const { betas, ...body } = modifiedParams;
return this._client.post('/v1/messages/count_tokens?beta=true', {
body,
...options,
headers: (0, headers_1.buildHeaders)([
{ 'anthropic-beta': [...(betas ?? []), 'token-counting-2024-11-01'].toString() },
options?.headers,
]),
});
}
toolRunner(body, options) {
return new BetaToolRunner_1.BetaToolRunner(this._client, body, options);
}
}
exports.Messages = Messages;
/**
* Transform deprecated output_format to output_config.format
* Returns a modified copy of the params without mutating the original
*/
function transformOutputFormat(params) {
if (!params.output_format) {
return params;
}
if (params.output_config?.format) {
throw new error_1.AnthropicError('Both output_format and output_config.format were provided. ' +
'Please use only output_config.format (output_format is deprecated).');
}
const { output_format, ...rest } = params;
return {
...rest,
output_config: {
...params.output_config,
format: output_format,
},
};
}
var BetaToolRunner_2 = require("../../../lib/tools/BetaToolRunner.js");
Object.defineProperty(exports, "BetaToolRunner", { enumerable: true, get: function () { return BetaToolRunner_2.BetaToolRunner; } });
var ToolError_2 = require("../../../lib/tools/ToolError.js");
Object.defineProperty(exports, "ToolError", { enumerable: true, get: function () { return ToolError_2.ToolError; } });
Messages.Batches = batches_1.Batches;
Messages.BetaToolRunner = BetaToolRunner_1.BetaToolRunner;
Messages.ToolError = ToolError_1.ToolError;
//# sourceMappingURL=messages.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/resources/beta/messages/messages.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,6CAAgD;AAGhD,wDAAqD;AAErD,8DAAwE;AACxE,0DAAyD;AAEzD,qFAA6E;AAC7E,6DAIkC;AAClC,yEAAmE;AACnE,yEAI2C;AAC3C,+DAAyD;AAKzD,iEAAwC;AACxC,0CAkBmB;AAEnB,MAAM,iBAAiB,GAEnB;IACF,YAAY,EAAE,oBAAoB;IAClC,iBAAiB,EAAE,oBAAoB;IACvC,oBAAoB,EAAE,oBAAoB;IAC1C,yBAAyB,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,aAAa;YACvB,MAAM,EAAE,aAAa;SACtB;KACG,CAAC;AACT,CAAC;AA6vHD,uEAA8F;AAArF,gHAAA,cAAc,OAAA;AACvB,6DAAyD;AAAhD,sGAAA,SAAS,OAAA;AAElB,QAAQ,CAAC,OAAO,GAAG,iBAAO,CAAC;AAE3B,QAAQ,CAAC,cAAc,GAAG,+BAAc,CAAC;AACzC,QAAQ,CAAC,SAAS,GAAG,qBAAS,CAAC"}

View File

@@ -0,0 +1,156 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { AnthropicError } from "../../../error.mjs";
import { APIResource } from "../../../core/resource.mjs";
import { MODEL_NONSTREAMING_TOKENS } from "../../../internal/constants.mjs";
import { buildHeaders } from "../../../internal/headers.mjs";
import { stainlessHelperHeader } from "../../../lib/stainless-helper-header.mjs";
import { parseBetaMessage, } from "../../../lib/beta-parser.mjs";
import { BetaMessageStream } from "../../../lib/BetaMessageStream.mjs";
import { BetaToolRunner, } from "../../../lib/tools/BetaToolRunner.mjs";
import { ToolError } from "../../../lib/tools/ToolError.mjs";
import * as BatchesAPI from "./batches.mjs";
import { Batches, } from "./batches.mjs";
const DEPRECATED_MODELS = {
'claude-1.3': 'November 6th, 2024',
'claude-1.3-100k': 'November 6th, 2024',
'claude-instant-1.1': 'November 6th, 2024',
'claude-instant-1.1-100k': 'November 6th, 2024',
'claude-instant-1.2': 'November 6th, 2024',
'claude-3-sonnet-20240229': 'July 21st, 2025',
'claude-3-opus-20240229': 'January 5th, 2026',
'claude-2.1': 'July 21st, 2025',
'claude-2.0': 'July 21st, 2025',
'claude-3-7-sonnet-latest': 'February 19th, 2026',
'claude-3-7-sonnet-20250219': 'February 19th, 2026',
};
const MODELS_TO_WARN_WITH_THINKING_ENABLED = ['claude-opus-4-6'];
export class Messages extends APIResource {
constructor() {
super(...arguments);
this.batches = new BatchesAPI.Batches(this._client);
}
create(params, options) {
// Transform deprecated output_format to output_config.format
const modifiedParams = transformOutputFormat(params);
const { betas, ...body } = modifiedParams;
if (body.model in DEPRECATED_MODELS) {
console.warn(`The model '${body.model}' is deprecated and will reach end-of-life on ${DEPRECATED_MODELS[body.model]}\nPlease migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);
}
if (body.model in MODELS_TO_WARN_WITH_THINKING_ENABLED &&
body.thinking &&
body.thinking.type === 'enabled') {
console.warn(`Using Claude with ${body.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);
}
let timeout = this._client._options.timeout;
if (!body.stream && timeout == null) {
const maxNonstreamingTokens = MODEL_NONSTREAMING_TOKENS[body.model] ?? undefined;
timeout = this._client.calculateNonstreamingTimeout(body.max_tokens, maxNonstreamingTokens);
}
// Collect helper info from tools and messages
const helperHeader = stainlessHelperHeader(body.tools, body.messages);
return this._client.post('/v1/messages?beta=true', {
body,
timeout: timeout ?? 600000,
...options,
headers: buildHeaders([
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
helperHeader,
options?.headers,
]),
stream: modifiedParams.stream ?? false,
});
}
/**
* Send a structured list of input messages with text and/or image content, along with an expected `output_format` and
* the response will be automatically parsed and available in the `parsed_output` property of the message.
*
* @example
* ```ts
* const message = await client.beta.messages.parse({
* model: 'claude-3-5-sonnet-20241022',
* max_tokens: 1024,
* messages: [{ role: 'user', content: 'What is 2+2?' }],
* output_format: zodOutputFormat(z.object({ answer: z.number() }), 'math'),
* });
*
* console.log(message.parsed_output?.answer); // 4
* ```
*/
parse(params, options) {
options = {
...options,
headers: buildHeaders([
{ 'anthropic-beta': [...(params.betas ?? []), 'structured-outputs-2025-12-15'].toString() },
options?.headers,
]),
};
return this.create(params, options).then((message) => parseBetaMessage(message, params, { logger: this._client.logger ?? console }));
}
/**
* Create a Message stream
*/
stream(body, options) {
return BetaMessageStream.createMessage(this, body, options);
}
/**
* Count the number of tokens in a Message.
*
* The Token Count API can be used to count the number of tokens in a Message,
* including tools, images, and documents, without creating it.
*
* Learn more about token counting in our
* [user guide](https://docs.claude.com/en/docs/build-with-claude/token-counting)
*
* @example
* ```ts
* const betaMessageTokensCount =
* await client.beta.messages.countTokens({
* messages: [{ content: 'string', role: 'user' }],
* model: 'claude-opus-4-6',
* });
* ```
*/
countTokens(params, options) {
// Transform deprecated output_format to output_config.format
const modifiedParams = transformOutputFormat(params);
const { betas, ...body } = modifiedParams;
return this._client.post('/v1/messages/count_tokens?beta=true', {
body,
...options,
headers: buildHeaders([
{ 'anthropic-beta': [...(betas ?? []), 'token-counting-2024-11-01'].toString() },
options?.headers,
]),
});
}
toolRunner(body, options) {
return new BetaToolRunner(this._client, body, options);
}
}
/**
* Transform deprecated output_format to output_config.format
* Returns a modified copy of the params without mutating the original
*/
function transformOutputFormat(params) {
if (!params.output_format) {
return params;
}
if (params.output_config?.format) {
throw new AnthropicError('Both output_format and output_config.format were provided. ' +
'Please use only output_config.format (output_format is deprecated).');
}
const { output_format, ...rest } = params;
return {
...rest,
output_config: {
...params.output_config,
format: output_format,
},
};
}
export { BetaToolRunner } from "../../../lib/tools/BetaToolRunner.mjs";
export { ToolError } from "../../../lib/tools/ToolError.mjs";
Messages.Batches = Batches;
Messages.BetaToolRunner = BetaToolRunner;
Messages.ToolError = ToolError;
//# sourceMappingURL=messages.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"messages.mjs","sourceRoot":"","sources":["../../../src/resources/beta/messages/messages.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,cAAc,EAAE;OAGlB,EAAE,WAAW,EAAE;OAEf,EAAE,yBAAyB,EAAE;OAC7B,EAAE,YAAY,EAAE;OAEhB,EAAE,qBAAqB,EAAE;OACzB,EACL,gBAAgB,GAGjB;OACM,EAAE,iBAAiB,EAAE;OACrB,EACL,cAAc,GAGf;OACM,EAAE,SAAS,EAAE;OAKb,KAAK,UAAU;OACf,EAOL,OAAO,GAWR;AAED,MAAM,iB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1C,OAAO;QACL,GAAG,IAAI;QACP,aAAa,EAAE;YACb,GAAG,MAAM,CAAC,aAAa;YACvB,MAAM,EAAE,aAAa;SACtB;KACG,CAAC;AACT,CAAC;OA6vHM,EAAE,cAAc,EAA6B;OAC7C,EAAE,SAAS,EAAE;AAEpB,QAAQ,CAAC,OAAO,GAAG,OAAO,CAAC;AAE3B,QAAQ,CAAC,cAAc,GAAG,cAAc,CAAC;AACzC,QAAQ,CAAC,SAAS,GAAG,SAAS,CAAC"}

View File

@@ -0,0 +1,208 @@
import { APIResource } from "../../core/resource.mjs";
import * as BetaAPI from "./beta.mjs";
import { APIPromise } from "../../core/api-promise.mjs";
import { Page, type PageParams, PagePromise } from "../../core/pagination.mjs";
import { RequestOptions } from "../../internal/request-options.mjs";
export declare class Models extends APIResource {
/**
* Get a specific model.
*
* The Models API response can be used to determine information about a specific
* model or resolve a model alias to a model ID.
*
* @example
* ```ts
* const betaModelInfo = await client.beta.models.retrieve(
* 'model_id',
* );
* ```
*/
retrieve(modelID: string, params?: ModelRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<BetaModelInfo>;
/**
* List available models.
*
* The Models API response can be used to determine which models are available for
* use in the API. More recently released models are listed first.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const betaModelInfo of client.beta.models.list()) {
* // ...
* }
* ```
*/
list(params?: ModelListParams | null | undefined, options?: RequestOptions): PagePromise<BetaModelInfosPage, BetaModelInfo>;
}
export type BetaModelInfosPage = Page<BetaModelInfo>;
/**
* Indicates whether a capability is supported.
*/
export interface BetaCapabilitySupport {
/**
* Whether this capability is supported by the model.
*/
supported: boolean;
}
/**
* Context management capability details.
*/
export interface BetaContextManagementCapability {
/**
* Indicates whether a capability is supported.
*/
clear_thinking_20251015: BetaCapabilitySupport | null;
/**
* Indicates whether a capability is supported.
*/
clear_tool_uses_20250919: BetaCapabilitySupport | null;
/**
* Indicates whether a capability is supported.
*/
compact_20260112: BetaCapabilitySupport | null;
/**
* Whether this capability is supported by the model.
*/
supported: boolean;
}
/**
* Effort (reasoning_effort) capability details.
*/
export interface BetaEffortCapability {
/**
* Whether the model supports high effort level.
*/
high: BetaCapabilitySupport;
/**
* Whether the model supports low effort level.
*/
low: BetaCapabilitySupport;
/**
* Whether the model supports max effort level.
*/
max: BetaCapabilitySupport;
/**
* Whether the model supports medium effort level.
*/
medium: BetaCapabilitySupport;
/**
* Whether this capability is supported by the model.
*/
supported: boolean;
}
/**
* Model capability information.
*/
export interface BetaModelCapabilities {
/**
* Whether the model supports the Batch API.
*/
batch: BetaCapabilitySupport;
/**
* Whether the model supports citation generation.
*/
citations: BetaCapabilitySupport;
/**
* Whether the model supports code execution tools.
*/
code_execution: BetaCapabilitySupport;
/**
* Context management support and available strategies.
*/
context_management: BetaContextManagementCapability;
/**
* Effort (reasoning_effort) support and available levels.
*/
effort: BetaEffortCapability;
/**
* Whether the model accepts image content blocks.
*/
image_input: BetaCapabilitySupport;
/**
* Whether the model accepts PDF content blocks.
*/
pdf_input: BetaCapabilitySupport;
/**
* Whether the model supports structured output / JSON mode / strict tool schemas.
*/
structured_outputs: BetaCapabilitySupport;
/**
* Thinking capability and supported type configurations.
*/
thinking: BetaThinkingCapability;
}
export interface BetaModelInfo {
/**
* Unique model identifier.
*/
id: string;
/**
* Model capability information.
*/
capabilities: BetaModelCapabilities | null;
/**
* RFC 3339 datetime string representing the time at which the model was released.
* May be set to an epoch value if the release date is unknown.
*/
created_at: string;
/**
* A human-readable name for the model.
*/
display_name: string;
/**
* Maximum input context window size in tokens for this model.
*/
max_input_tokens: number | null;
/**
* Maximum value for the `max_tokens` parameter when using this model.
*/
max_tokens: number | null;
/**
* Object type.
*
* For Models, this is always `"model"`.
*/
type: 'model';
}
/**
* Thinking capability details.
*/
export interface BetaThinkingCapability {
/**
* Whether this capability is supported by the model.
*/
supported: boolean;
/**
* Supported thinking type configurations.
*/
types: BetaThinkingTypes;
}
/**
* Supported thinking type configurations.
*/
export interface BetaThinkingTypes {
/**
* Whether the model supports thinking with type 'adaptive' (auto).
*/
adaptive: BetaCapabilitySupport;
/**
* Whether the model supports thinking with type 'enabled'.
*/
enabled: BetaCapabilitySupport;
}
export interface ModelRetrieveParams {
/**
* Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export interface ModelListParams extends PageParams {
/**
* Header param: Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export declare namespace Models {
export { type BetaCapabilitySupport as BetaCapabilitySupport, type BetaContextManagementCapability as BetaContextManagementCapability, type BetaEffortCapability as BetaEffortCapability, type BetaModelCapabilities as BetaModelCapabilities, type BetaModelInfo as BetaModelInfo, type BetaThinkingCapability as BetaThinkingCapability, type BetaThinkingTypes as BetaThinkingTypes, type BetaModelInfosPage as BetaModelInfosPage, type ModelRetrieveParams as ModelRetrieveParams, type ModelListParams as ModelListParams, };
}
//# sourceMappingURL=models.d.mts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"models.d.mts","sourceRoot":"","sources":["../../src/resources/beta/models.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,OAAO;OACZ,EAAE,UAAU,EAAE;OACd,EAAE,IAAI,EAAE,KAAK,UAAU,EAAE,WAAW,EAAE;OAEtC,EAAE,cAAc,EAAE;AAGzB,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;OAYG;IACH,QAAQ,CACN,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,mBAAmB,GAAG,IAAI,GAAG,SAAc,EACnD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,aAAa,CAAC;IAW5B;;;;;;;;;;;;;OAaG;IACH,IAAI,CACF,MAAM,GAAE,eAAe,GAAG,IAAI,GAAG,SAAc,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,kBAAkB,EAAE,aAAa,CAAC;CAWlD;AAED,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC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;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC;;OAEG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B;;;;OAIG;IACH,IAAI,EAAE,OAAO,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,KAAK,EAAE,iBAAiB,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,QAAQ,EAAE,qBAAqB,CAAC;IAEhC;;OAEG;IACH,OAAO,EAAE,qBAAqB,CAAC;CAChC;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,eAAgB,SAAQ,UAAU;IACjD;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;CACtC;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,eAAe,IAAI,eAAe,GACxC,CAAC;CACH"}

View File

@@ -0,0 +1,208 @@
import { APIResource } from "../../core/resource.js";
import * as BetaAPI from "./beta.js";
import { APIPromise } from "../../core/api-promise.js";
import { Page, type PageParams, PagePromise } from "../../core/pagination.js";
import { RequestOptions } from "../../internal/request-options.js";
export declare class Models extends APIResource {
/**
* Get a specific model.
*
* The Models API response can be used to determine information about a specific
* model or resolve a model alias to a model ID.
*
* @example
* ```ts
* const betaModelInfo = await client.beta.models.retrieve(
* 'model_id',
* );
* ```
*/
retrieve(modelID: string, params?: ModelRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<BetaModelInfo>;
/**
* List available models.
*
* The Models API response can be used to determine which models are available for
* use in the API. More recently released models are listed first.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const betaModelInfo of client.beta.models.list()) {
* // ...
* }
* ```
*/
list(params?: ModelListParams | null | undefined, options?: RequestOptions): PagePromise<BetaModelInfosPage, BetaModelInfo>;
}
export type BetaModelInfosPage = Page<BetaModelInfo>;
/**
* Indicates whether a capability is supported.
*/
export interface BetaCapabilitySupport {
/**
* Whether this capability is supported by the model.
*/
supported: boolean;
}
/**
* Context management capability details.
*/
export interface BetaContextManagementCapability {
/**
* Indicates whether a capability is supported.
*/
clear_thinking_20251015: BetaCapabilitySupport | null;
/**
* Indicates whether a capability is supported.
*/
clear_tool_uses_20250919: BetaCapabilitySupport | null;
/**
* Indicates whether a capability is supported.
*/
compact_20260112: BetaCapabilitySupport | null;
/**
* Whether this capability is supported by the model.
*/
supported: boolean;
}
/**
* Effort (reasoning_effort) capability details.
*/
export interface BetaEffortCapability {
/**
* Whether the model supports high effort level.
*/
high: BetaCapabilitySupport;
/**
* Whether the model supports low effort level.
*/
low: BetaCapabilitySupport;
/**
* Whether the model supports max effort level.
*/
max: BetaCapabilitySupport;
/**
* Whether the model supports medium effort level.
*/
medium: BetaCapabilitySupport;
/**
* Whether this capability is supported by the model.
*/
supported: boolean;
}
/**
* Model capability information.
*/
export interface BetaModelCapabilities {
/**
* Whether the model supports the Batch API.
*/
batch: BetaCapabilitySupport;
/**
* Whether the model supports citation generation.
*/
citations: BetaCapabilitySupport;
/**
* Whether the model supports code execution tools.
*/
code_execution: BetaCapabilitySupport;
/**
* Context management support and available strategies.
*/
context_management: BetaContextManagementCapability;
/**
* Effort (reasoning_effort) support and available levels.
*/
effort: BetaEffortCapability;
/**
* Whether the model accepts image content blocks.
*/
image_input: BetaCapabilitySupport;
/**
* Whether the model accepts PDF content blocks.
*/
pdf_input: BetaCapabilitySupport;
/**
* Whether the model supports structured output / JSON mode / strict tool schemas.
*/
structured_outputs: BetaCapabilitySupport;
/**
* Thinking capability and supported type configurations.
*/
thinking: BetaThinkingCapability;
}
export interface BetaModelInfo {
/**
* Unique model identifier.
*/
id: string;
/**
* Model capability information.
*/
capabilities: BetaModelCapabilities | null;
/**
* RFC 3339 datetime string representing the time at which the model was released.
* May be set to an epoch value if the release date is unknown.
*/
created_at: string;
/**
* A human-readable name for the model.
*/
display_name: string;
/**
* Maximum input context window size in tokens for this model.
*/
max_input_tokens: number | null;
/**
* Maximum value for the `max_tokens` parameter when using this model.
*/
max_tokens: number | null;
/**
* Object type.
*
* For Models, this is always `"model"`.
*/
type: 'model';
}
/**
* Thinking capability details.
*/
export interface BetaThinkingCapability {
/**
* Whether this capability is supported by the model.
*/
supported: boolean;
/**
* Supported thinking type configurations.
*/
types: BetaThinkingTypes;
}
/**
* Supported thinking type configurations.
*/
export interface BetaThinkingTypes {
/**
* Whether the model supports thinking with type 'adaptive' (auto).
*/
adaptive: BetaCapabilitySupport;
/**
* Whether the model supports thinking with type 'enabled'.
*/
enabled: BetaCapabilitySupport;
}
export interface ModelRetrieveParams {
/**
* Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export interface ModelListParams extends PageParams {
/**
* Header param: Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export declare namespace Models {
export { type BetaCapabilitySupport as BetaCapabilitySupport, type BetaContextManagementCapability as BetaContextManagementCapability, type BetaEffortCapability as BetaEffortCapability, type BetaModelCapabilities as BetaModelCapabilities, type BetaModelInfo as BetaModelInfo, type BetaThinkingCapability as BetaThinkingCapability, type BetaThinkingTypes as BetaThinkingTypes, type BetaModelInfosPage as BetaModelInfosPage, type ModelRetrieveParams as ModelRetrieveParams, type ModelListParams as ModelListParams, };
}
//# sourceMappingURL=models.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/resources/beta/models.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,OAAO;OACZ,EAAE,UAAU,EAAE;OACd,EAAE,IAAI,EAAE,KAAK,UAAU,EAAE,WAAW,EAAE;OAEtC,EAAE,cAAc,EAAE;AAGzB,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;OAYG;IACH,QAAQ,CACN,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,mBAAmB,GAAG,IAAI,GAAG,SAAc,EACnD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,aAAa,CAAC;IAW5B;;;;;;;;;;;;;OAaG;IACH,IAAI,CACF,MAAM,GAAE,eAAe,GAAG,IAAI,GAAG,SAAc,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,kBAAkB,EAAE,aAAa,CAAC;CAWlD;AAED,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC9C;;OAEG;IACH,uBAAuB,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAEtD;;OAEG;IACH,wBAAwB,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAEvD;;OAEG;IACH,gBAAgB,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAE/C;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW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W,iBAAiB;IAChC;;OAEG;IACH,QAAQ,EAAE,qBAAqB,CAAC;IAEhC;;OAEG;IACH,OAAO,EAAE,qBAAqB,CAAC;CAChC;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,eAAgB,SAAQ,UAAU;IACjD;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;CACtC;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,eAAe,IAAI,eAAe,GACxC,CAAC;CACH"}

View File

@@ -0,0 +1,60 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Models = void 0;
const resource_1 = require("../../core/resource.js");
const pagination_1 = require("../../core/pagination.js");
const headers_1 = require("../../internal/headers.js");
const path_1 = require("../../internal/utils/path.js");
class Models extends resource_1.APIResource {
/**
* Get a specific model.
*
* The Models API response can be used to determine information about a specific
* model or resolve a model alias to a model ID.
*
* @example
* ```ts
* const betaModelInfo = await client.beta.models.retrieve(
* 'model_id',
* );
* ```
*/
retrieve(modelID, params = {}, options) {
const { betas } = params ?? {};
return this._client.get((0, path_1.path) `/v1/models/${modelID}?beta=true`, {
...options,
headers: (0, headers_1.buildHeaders)([
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
options?.headers,
]),
});
}
/**
* List available models.
*
* The Models API response can be used to determine which models are available for
* use in the API. More recently released models are listed first.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const betaModelInfo of client.beta.models.list()) {
* // ...
* }
* ```
*/
list(params = {}, options) {
const { betas, ...query } = params ?? {};
return this._client.getAPIList('/v1/models?beta=true', (pagination_1.Page), {
query,
...options,
headers: (0, headers_1.buildHeaders)([
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
options?.headers,
]),
});
}
}
exports.Models = Models;
//# sourceMappingURL=models.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/resources/beta/models.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAGlD,yDAA2E;AAC3E,uDAAsD;AAEtD,uDAAiD;AAEjD,MAAa,MAAO,SAAQ,sBAAW;IACrC;;;;;;;;;;;;OAYG;IACH,QAAQ,CACN,OAAe,EACf,SAAiD,EAAE,EACnD,OAAwB;QAExB,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,cAAc,OAAO,YAAY,EAAE;YAC7D,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC;gBACpB,EAAE,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE;gBACxF,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,IAAI,CACF,SAA6C,EAAE,EAC/C,OAAwB;QAExB,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,sBAAsB,EAAE,CAAA,iBAAmB,CAAA,EAAE;YAC1E,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC;gBACpB,EAAE,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE;gBACxF,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;CACF;AAzDD,wBAyDC"}

View File

@@ -0,0 +1,56 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../core/resource.mjs";
import { Page } from "../../core/pagination.mjs";
import { buildHeaders } from "../../internal/headers.mjs";
import { path } from "../../internal/utils/path.mjs";
export class Models extends APIResource {
/**
* Get a specific model.
*
* The Models API response can be used to determine information about a specific
* model or resolve a model alias to a model ID.
*
* @example
* ```ts
* const betaModelInfo = await client.beta.models.retrieve(
* 'model_id',
* );
* ```
*/
retrieve(modelID, params = {}, options) {
const { betas } = params ?? {};
return this._client.get(path `/v1/models/${modelID}?beta=true`, {
...options,
headers: buildHeaders([
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
options?.headers,
]),
});
}
/**
* List available models.
*
* The Models API response can be used to determine which models are available for
* use in the API. More recently released models are listed first.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const betaModelInfo of client.beta.models.list()) {
* // ...
* }
* ```
*/
list(params = {}, options) {
const { betas, ...query } = params ?? {};
return this._client.getAPIList('/v1/models?beta=true', (Page), {
query,
...options,
headers: buildHeaders([
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
options?.headers,
]),
});
}
}
//# sourceMappingURL=models.mjs.map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O;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;CACF"}

View File

@@ -0,0 +1,2 @@
export * from "./skills/index.mjs";
//# sourceMappingURL=skills.d.mts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"skills.d.mts","sourceRoot":"","sources":["../../src/resources/beta/skills.ts"],"names":[],"mappings":""}

View File

@@ -0,0 +1,2 @@
export * from "./skills/index.js";
//# sourceMappingURL=skills.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/resources/beta/skills.ts"],"names":[],"mappings":""}

View File

@@ -0,0 +1,6 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("../../internal/tslib.js");
tslib_1.__exportStar(require("./skills/index.js"), exports);
//# sourceMappingURL=skills.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"skills.js","sourceRoot":"","sources":["../../src/resources/beta/skills.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,4DAA+B"}

View File

@@ -0,0 +1,3 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
export * from "./skills/index.mjs";
//# sourceMappingURL=skills.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"skills.mjs","sourceRoot":"","sources":["../../src/resources/beta/skills.ts"],"names":[],"mappings":"AAAA,sFAAsF"}

View File

@@ -0,0 +1,3 @@
export { Skills, type SkillCreateResponse, type SkillRetrieveResponse, type SkillListResponse, type SkillDeleteResponse, type SkillCreateParams, type SkillRetrieveParams, type SkillListParams, type SkillDeleteParams, type SkillListResponsesPageCursor, } from "./skills.mjs";
export { Versions, type VersionCreateResponse, type VersionRetrieveResponse, type VersionListResponse, type VersionDeleteResponse, type VersionCreateParams, type VersionRetrieveParams, type VersionListParams, type VersionDeleteParams, type VersionListResponsesPageCursor, } from "./versions.mjs";
//# sourceMappingURL=index.d.mts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/resources/beta/skills/index.ts"],"names":[],"mappings":"OAEO,EACL,MAAM,EACN,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,4BAA4B,GAClC;OACM,EACL,QAAQ,EACR,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,8BAA8B,GACpC"}

View File

@@ -0,0 +1,3 @@
export { Skills, type SkillCreateResponse, type SkillRetrieveResponse, type SkillListResponse, type SkillDeleteResponse, type SkillCreateParams, type SkillRetrieveParams, type SkillListParams, type SkillDeleteParams, type SkillListResponsesPageCursor, } from "./skills.js";
export { Versions, type VersionCreateResponse, type VersionRetrieveResponse, type VersionListResponse, type VersionDeleteResponse, type VersionCreateParams, type VersionRetrieveParams, type VersionListParams, type VersionDeleteParams, type VersionListResponsesPageCursor, } from "./versions.js";
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/skills/index.ts"],"names":[],"mappings":"OAEO,EACL,MAAM,EACN,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,4BAA4B,GAClC;OACM,EACL,QAAQ,EACR,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,8BAA8B,GACpC"}

View File

@@ -0,0 +1,9 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Versions = exports.Skills = void 0;
var skills_1 = require("./skills.js");
Object.defineProperty(exports, "Skills", { enumerable: true, get: function () { return skills_1.Skills; } });
var versions_1 = require("./versions.js");
Object.defineProperty(exports, "Versions", { enumerable: true, get: function () { return versions_1.Versions; } });
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/beta/skills/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,sCAWkB;AAVhB,gGAAA,MAAM,OAAA;AAWR,0CAWoB;AAVlB,oGAAA,QAAQ,OAAA"}

View File

@@ -0,0 +1,4 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
export { Skills, } from "./skills.mjs";
export { Versions, } from "./versions.mjs";
//# sourceMappingURL=index.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/resources/beta/skills/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,MAAM,GAUP;OACM,EACL,QAAQ,GAUT"}

View File

@@ -0,0 +1,249 @@
import { APIResource } from "../../../core/resource.mjs";
import * as BetaAPI from "../beta.mjs";
import * as VersionsAPI from "./versions.mjs";
import { VersionCreateParams, VersionCreateResponse, VersionDeleteParams, VersionDeleteResponse, VersionListParams, VersionListResponse, VersionListResponsesPageCursor, VersionRetrieveParams, VersionRetrieveResponse, Versions } from "./versions.mjs";
import { APIPromise } from "../../../core/api-promise.mjs";
import { PageCursor, type PageCursorParams, PagePromise } from "../../../core/pagination.mjs";
import { type Uploadable } from "../../../core/uploads.mjs";
import { RequestOptions } from "../../../internal/request-options.mjs";
export declare class Skills extends APIResource {
versions: VersionsAPI.Versions;
/**
* Create Skill
*
* @example
* ```ts
* const skill = await client.beta.skills.create();
* ```
*/
create(params?: SkillCreateParams | null | undefined, options?: RequestOptions): APIPromise<SkillCreateResponse>;
/**
* Get Skill
*
* @example
* ```ts
* const skill = await client.beta.skills.retrieve('skill_id');
* ```
*/
retrieve(skillID: string, params?: SkillRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<SkillRetrieveResponse>;
/**
* List Skills
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const skillListResponse of client.beta.skills.list()) {
* // ...
* }
* ```
*/
list(params?: SkillListParams | null | undefined, options?: RequestOptions): PagePromise<SkillListResponsesPageCursor, SkillListResponse>;
/**
* Delete Skill
*
* @example
* ```ts
* const skill = await client.beta.skills.delete('skill_id');
* ```
*/
delete(skillID: string, params?: SkillDeleteParams | null | undefined, options?: RequestOptions): APIPromise<SkillDeleteResponse>;
}
export type SkillListResponsesPageCursor = PageCursor<SkillListResponse>;
export interface SkillCreateResponse {
/**
* Unique identifier for the skill.
*
* The format and length of IDs may change over time.
*/
id: string;
/**
* ISO 8601 timestamp of when the skill was created.
*/
created_at: string;
/**
* Display title for the skill.
*
* This is a human-readable label that is not included in the prompt sent to the
* model.
*/
display_title: string | null;
/**
* The latest version identifier for the skill.
*
* This represents the most recent version of the skill that has been created.
*/
latest_version: string | null;
/**
* Source of the skill.
*
* This may be one of the following values:
*
* - `"custom"`: the skill was created by a user
* - `"anthropic"`: the skill was created by Anthropic
*/
source: string;
/**
* Object type.
*
* For Skills, this is always `"skill"`.
*/
type: string;
/**
* ISO 8601 timestamp of when the skill was last updated.
*/
updated_at: string;
}
export interface SkillRetrieveResponse {
/**
* Unique identifier for the skill.
*
* The format and length of IDs may change over time.
*/
id: string;
/**
* ISO 8601 timestamp of when the skill was created.
*/
created_at: string;
/**
* Display title for the skill.
*
* This is a human-readable label that is not included in the prompt sent to the
* model.
*/
display_title: string | null;
/**
* The latest version identifier for the skill.
*
* This represents the most recent version of the skill that has been created.
*/
latest_version: string | null;
/**
* Source of the skill.
*
* This may be one of the following values:
*
* - `"custom"`: the skill was created by a user
* - `"anthropic"`: the skill was created by Anthropic
*/
source: string;
/**
* Object type.
*
* For Skills, this is always `"skill"`.
*/
type: string;
/**
* ISO 8601 timestamp of when the skill was last updated.
*/
updated_at: string;
}
export interface SkillListResponse {
/**
* Unique identifier for the skill.
*
* The format and length of IDs may change over time.
*/
id: string;
/**
* ISO 8601 timestamp of when the skill was created.
*/
created_at: string;
/**
* Display title for the skill.
*
* This is a human-readable label that is not included in the prompt sent to the
* model.
*/
display_title: string | null;
/**
* The latest version identifier for the skill.
*
* This represents the most recent version of the skill that has been created.
*/
latest_version: string | null;
/**
* Source of the skill.
*
* This may be one of the following values:
*
* - `"custom"`: the skill was created by a user
* - `"anthropic"`: the skill was created by Anthropic
*/
source: string;
/**
* Object type.
*
* For Skills, this is always `"skill"`.
*/
type: string;
/**
* ISO 8601 timestamp of when the skill was last updated.
*/
updated_at: string;
}
export interface SkillDeleteResponse {
/**
* Unique identifier for the skill.
*
* The format and length of IDs may change over time.
*/
id: string;
/**
* Deleted object type.
*
* For Skills, this is always `"skill_deleted"`.
*/
type: string;
}
export interface SkillCreateParams {
/**
* Body param: Display title for the skill.
*
* This is a human-readable label that is not included in the prompt sent to the
* model.
*/
display_title?: string | null;
/**
* Body param: Files to upload for the skill.
*
* All files must be in the same top-level directory and must include a SKILL.md
* file at the root of that directory.
*/
files?: Array<Uploadable> | null;
/**
* Header param: Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export interface SkillRetrieveParams {
/**
* Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export interface SkillListParams extends PageCursorParams {
/**
* Query param: Filter skills by source.
*
* If provided, only skills from the specified source will be returned:
*
* - `"custom"`: only return user-created skills
* - `"anthropic"`: only return Anthropic-created skills
*/
source?: string | null;
/**
* Header param: Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export interface SkillDeleteParams {
/**
* Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export declare namespace Skills {
export { type SkillCreateResponse as SkillCreateResponse, type SkillRetrieveResponse as SkillRetrieveResponse, type SkillListResponse as SkillListResponse, type SkillDeleteResponse as SkillDeleteResponse, type SkillListResponsesPageCursor as SkillListResponsesPageCursor, type SkillCreateParams as SkillCreateParams, type SkillRetrieveParams as SkillRetrieveParams, type SkillListParams as SkillListParams, type SkillDeleteParams as SkillDeleteParams, };
export { Versions as Versions, type VersionCreateResponse as VersionCreateResponse, type VersionRetrieveResponse as VersionRetrieveResponse, type VersionListResponse as VersionListResponse, type VersionDeleteResponse as VersionDeleteResponse, type VersionListResponsesPageCursor as VersionListResponsesPageCursor, type VersionCreateParams as VersionCreateParams, type VersionRetrieveParams as VersionRetrieveParams, type VersionListParams as VersionListParams, type VersionDeleteParams as VersionDeleteParams, };
}
//# sourceMappingURL=skills.d.mts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"skills.d.mts","sourceRoot":"","sources":["../../../src/resources/beta/skills/skills.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,OAAO;OACZ,KAAK,WAAW;OAChB,EACL,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,8BAA8B,EAC9B,qBAAqB,EACrB,uBAAuB,EACvB,QAAQ,EACT;OACM,EAAE,UAAU,EAAE;OACd,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE;OAClD,EAAE,KAAK,UAAU,EAAE;OAEnB,EAAE,cAAc,EAAE;AAIzB,qBAAa,MAAO,SAAQ,WAAW;IACrC,QAAQ,EAAE,WAAW,CAAC,QAAQ,CAA0C;IAExE;;;;;;;OAOG;IACH,MAA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AC;CACtC;AAED,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;CACtC;AAID,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;IAEF,OAAO,EACL,QAAQ,IAAI,QAAQ,EACpB,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}

View File

@@ -0,0 +1,249 @@
import { APIResource } from "../../../core/resource.js";
import * as BetaAPI from "../beta.js";
import * as VersionsAPI from "./versions.js";
import { VersionCreateParams, VersionCreateResponse, VersionDeleteParams, VersionDeleteResponse, VersionListParams, VersionListResponse, VersionListResponsesPageCursor, VersionRetrieveParams, VersionRetrieveResponse, Versions } from "./versions.js";
import { APIPromise } from "../../../core/api-promise.js";
import { PageCursor, type PageCursorParams, PagePromise } from "../../../core/pagination.js";
import { type Uploadable } from "../../../core/uploads.js";
import { RequestOptions } from "../../../internal/request-options.js";
export declare class Skills extends APIResource {
versions: VersionsAPI.Versions;
/**
* Create Skill
*
* @example
* ```ts
* const skill = await client.beta.skills.create();
* ```
*/
create(params?: SkillCreateParams | null | undefined, options?: RequestOptions): APIPromise<SkillCreateResponse>;
/**
* Get Skill
*
* @example
* ```ts
* const skill = await client.beta.skills.retrieve('skill_id');
* ```
*/
retrieve(skillID: string, params?: SkillRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<SkillRetrieveResponse>;
/**
* List Skills
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const skillListResponse of client.beta.skills.list()) {
* // ...
* }
* ```
*/
list(params?: SkillListParams | null | undefined, options?: RequestOptions): PagePromise<SkillListResponsesPageCursor, SkillListResponse>;
/**
* Delete Skill
*
* @example
* ```ts
* const skill = await client.beta.skills.delete('skill_id');
* ```
*/
delete(skillID: string, params?: SkillDeleteParams | null | undefined, options?: RequestOptions): APIPromise<SkillDeleteResponse>;
}
export type SkillListResponsesPageCursor = PageCursor<SkillListResponse>;
export interface SkillCreateResponse {
/**
* Unique identifier for the skill.
*
* The format and length of IDs may change over time.
*/
id: string;
/**
* ISO 8601 timestamp of when the skill was created.
*/
created_at: string;
/**
* Display title for the skill.
*
* This is a human-readable label that is not included in the prompt sent to the
* model.
*/
display_title: string | null;
/**
* The latest version identifier for the skill.
*
* This represents the most recent version of the skill that has been created.
*/
latest_version: string | null;
/**
* Source of the skill.
*
* This may be one of the following values:
*
* - `"custom"`: the skill was created by a user
* - `"anthropic"`: the skill was created by Anthropic
*/
source: string;
/**
* Object type.
*
* For Skills, this is always `"skill"`.
*/
type: string;
/**
* ISO 8601 timestamp of when the skill was last updated.
*/
updated_at: string;
}
export interface SkillRetrieveResponse {
/**
* Unique identifier for the skill.
*
* The format and length of IDs may change over time.
*/
id: string;
/**
* ISO 8601 timestamp of when the skill was created.
*/
created_at: string;
/**
* Display title for the skill.
*
* This is a human-readable label that is not included in the prompt sent to the
* model.
*/
display_title: string | null;
/**
* The latest version identifier for the skill.
*
* This represents the most recent version of the skill that has been created.
*/
latest_version: string | null;
/**
* Source of the skill.
*
* This may be one of the following values:
*
* - `"custom"`: the skill was created by a user
* - `"anthropic"`: the skill was created by Anthropic
*/
source: string;
/**
* Object type.
*
* For Skills, this is always `"skill"`.
*/
type: string;
/**
* ISO 8601 timestamp of when the skill was last updated.
*/
updated_at: string;
}
export interface SkillListResponse {
/**
* Unique identifier for the skill.
*
* The format and length of IDs may change over time.
*/
id: string;
/**
* ISO 8601 timestamp of when the skill was created.
*/
created_at: string;
/**
* Display title for the skill.
*
* This is a human-readable label that is not included in the prompt sent to the
* model.
*/
display_title: string | null;
/**
* The latest version identifier for the skill.
*
* This represents the most recent version of the skill that has been created.
*/
latest_version: string | null;
/**
* Source of the skill.
*
* This may be one of the following values:
*
* - `"custom"`: the skill was created by a user
* - `"anthropic"`: the skill was created by Anthropic
*/
source: string;
/**
* Object type.
*
* For Skills, this is always `"skill"`.
*/
type: string;
/**
* ISO 8601 timestamp of when the skill was last updated.
*/
updated_at: string;
}
export interface SkillDeleteResponse {
/**
* Unique identifier for the skill.
*
* The format and length of IDs may change over time.
*/
id: string;
/**
* Deleted object type.
*
* For Skills, this is always `"skill_deleted"`.
*/
type: string;
}
export interface SkillCreateParams {
/**
* Body param: Display title for the skill.
*
* This is a human-readable label that is not included in the prompt sent to the
* model.
*/
display_title?: string | null;
/**
* Body param: Files to upload for the skill.
*
* All files must be in the same top-level directory and must include a SKILL.md
* file at the root of that directory.
*/
files?: Array<Uploadable> | null;
/**
* Header param: Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export interface SkillRetrieveParams {
/**
* Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export interface SkillListParams extends PageCursorParams {
/**
* Query param: Filter skills by source.
*
* If provided, only skills from the specified source will be returned:
*
* - `"custom"`: only return user-created skills
* - `"anthropic"`: only return Anthropic-created skills
*/
source?: string | null;
/**
* Header param: Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export interface SkillDeleteParams {
/**
* Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export declare namespace Skills {
export { type SkillCreateResponse as SkillCreateResponse, type SkillRetrieveResponse as SkillRetrieveResponse, type SkillListResponse as SkillListResponse, type SkillDeleteResponse as SkillDeleteResponse, type SkillListResponsesPageCursor as SkillListResponsesPageCursor, type SkillCreateParams as SkillCreateParams, type SkillRetrieveParams as SkillRetrieveParams, type SkillListParams as SkillListParams, type SkillDeleteParams as SkillDeleteParams, };
export { Versions as Versions, type VersionCreateResponse as VersionCreateResponse, type VersionRetrieveResponse as VersionRetrieveResponse, type VersionListResponse as VersionListResponse, type VersionDeleteResponse as VersionDeleteResponse, type VersionListResponsesPageCursor as VersionListResponsesPageCursor, type VersionCreateParams as VersionCreateParams, type VersionRetrieveParams as VersionRetrieveParams, type VersionListParams as VersionListParams, type VersionDeleteParams as VersionDeleteParams, };
}
//# sourceMappingURL=skills.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/skills/skills.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,OAAO;OACZ,KAAK,WAAW;OAChB,EACL,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,8BAA8B,EAC9B,qBAAqB,EACrB,uBAAuB,EACvB,QAAQ,EACT;OACM,EAAE,UAAU,EAAE;OACd,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE;OAClD,EAAE,KAAK,UAAU,EAAE;OAEnB,EAAE,cAAc,EAAE;AAIzB,qBAAa,MAAO,SAAQ,WAAW;IACrC,QAAQ,EAAE,WAAW,CAAC,QAAQ,CAA0C;IAExE;;;;;;;OAOG;IACH,MAAM,CACJ,MAAM,GAAE,iB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AW,iBAAiB;IAChC;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;CACtC;AAID,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;IAEF,OAAO,EACL,QAAQ,IAAI,QAAQ,EACpB,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}

View File

@@ -0,0 +1,98 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Skills = void 0;
const tslib_1 = require("../../../internal/tslib.js");
const resource_1 = require("../../../core/resource.js");
const VersionsAPI = tslib_1.__importStar(require("./versions.js"));
const versions_1 = require("./versions.js");
const pagination_1 = require("../../../core/pagination.js");
const headers_1 = require("../../../internal/headers.js");
const uploads_1 = require("../../../internal/uploads.js");
const path_1 = require("../../../internal/utils/path.js");
class Skills extends resource_1.APIResource {
constructor() {
super(...arguments);
this.versions = new VersionsAPI.Versions(this._client);
}
/**
* Create Skill
*
* @example
* ```ts
* const skill = await client.beta.skills.create();
* ```
*/
create(params = {}, options) {
const { betas, ...body } = params ?? {};
return this._client.post('/v1/skills?beta=true', (0, uploads_1.multipartFormRequestOptions)({
body,
...options,
headers: (0, headers_1.buildHeaders)([
{ 'anthropic-beta': [...(betas ?? []), 'skills-2025-10-02'].toString() },
options?.headers,
]),
}, this._client, false));
}
/**
* Get Skill
*
* @example
* ```ts
* const skill = await client.beta.skills.retrieve('skill_id');
* ```
*/
retrieve(skillID, params = {}, options) {
const { betas } = params ?? {};
return this._client.get((0, path_1.path) `/v1/skills/${skillID}?beta=true`, {
...options,
headers: (0, headers_1.buildHeaders)([
{ 'anthropic-beta': [...(betas ?? []), 'skills-2025-10-02'].toString() },
options?.headers,
]),
});
}
/**
* List Skills
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const skillListResponse of client.beta.skills.list()) {
* // ...
* }
* ```
*/
list(params = {}, options) {
const { betas, ...query } = params ?? {};
return this._client.getAPIList('/v1/skills?beta=true', (pagination_1.PageCursor), {
query,
...options,
headers: (0, headers_1.buildHeaders)([
{ 'anthropic-beta': [...(betas ?? []), 'skills-2025-10-02'].toString() },
options?.headers,
]),
});
}
/**
* Delete Skill
*
* @example
* ```ts
* const skill = await client.beta.skills.delete('skill_id');
* ```
*/
delete(skillID, params = {}, options) {
const { betas } = params ?? {};
return this._client.delete((0, path_1.path) `/v1/skills/${skillID}?beta=true`, {
...options,
headers: (0, headers_1.buildHeaders)([
{ 'anthropic-beta': [...(betas ?? []), 'skills-2025-10-02'].toString() },
options?.headers,
]),
});
}
}
exports.Skills = Skills;
Skills.Versions = versions_1.Versions;
//# sourceMappingURL=skills.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"skills.js","sourceRoot":"","sources":["../../../src/resources/beta/skills/skills.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,wDAAqD;AAErD,mEAA0C;AAC1C,4CAWoB;AAE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B,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,sBAAsB,EAAE,CAAA,uBAA6B,CAAA,EAAE;YACpF,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC;gBACpB,EAAE,gBAAgB,EAAE,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,mBAAmB,CAAC,CAAC,QAAQ,EAAE,EAAE;gBACxE,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CACJ,OAAe,EACf,SAA+C,EAAE,EACjD,OAAwB;QAExB,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,cAAc,OAAO,YAAY,EAAE;YAChE,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC;gBACpB,EAAE,gBAAgB,EAAE,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,mBAAmB,CAAC,CAAC,QAAQ,EAAE,EAAE;gBACxE,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;CACF;AAxGD,wBAwGC;AAmOD,MAAM,CAAC,QAAQ,GAAG,mBAAQ,CAAC"}

View File

@@ -0,0 +1,93 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../core/resource.mjs";
import * as VersionsAPI from "./versions.mjs";
import { Versions, } from "./versions.mjs";
import { PageCursor } from "../../../core/pagination.mjs";
import { buildHeaders } from "../../../internal/headers.mjs";
import { multipartFormRequestOptions } from "../../../internal/uploads.mjs";
import { path } from "../../../internal/utils/path.mjs";
export class Skills extends APIResource {
constructor() {
super(...arguments);
this.versions = new VersionsAPI.Versions(this._client);
}
/**
* Create Skill
*
* @example
* ```ts
* const skill = await client.beta.skills.create();
* ```
*/
create(params = {}, options) {
const { betas, ...body } = params ?? {};
return this._client.post('/v1/skills?beta=true', multipartFormRequestOptions({
body,
...options,
headers: buildHeaders([
{ 'anthropic-beta': [...(betas ?? []), 'skills-2025-10-02'].toString() },
options?.headers,
]),
}, this._client, false));
}
/**
* Get Skill
*
* @example
* ```ts
* const skill = await client.beta.skills.retrieve('skill_id');
* ```
*/
retrieve(skillID, params = {}, options) {
const { betas } = params ?? {};
return this._client.get(path `/v1/skills/${skillID}?beta=true`, {
...options,
headers: buildHeaders([
{ 'anthropic-beta': [...(betas ?? []), 'skills-2025-10-02'].toString() },
options?.headers,
]),
});
}
/**
* List Skills
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const skillListResponse of client.beta.skills.list()) {
* // ...
* }
* ```
*/
list(params = {}, options) {
const { betas, ...query } = params ?? {};
return this._client.getAPIList('/v1/skills?beta=true', (PageCursor), {
query,
...options,
headers: buildHeaders([
{ 'anthropic-beta': [...(betas ?? []), 'skills-2025-10-02'].toString() },
options?.headers,
]),
});
}
/**
* Delete Skill
*
* @example
* ```ts
* const skill = await client.beta.skills.delete('skill_id');
* ```
*/
delete(skillID, params = {}, options) {
const { betas } = params ?? {};
return this._client.delete(path `/v1/skills/${skillID}?beta=true`, {
...options,
headers: buildHeaders([
{ 'anthropic-beta': [...(betas ?? []), 'skills-2025-10-02'].toString() },
options?.headers,
]),
});
}
}
Skills.Versions = Versions;
//# sourceMappingURL=skills.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"skills.mjs","sourceRoot":"","sources":["../../../src/resources/beta/skills/skills.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,KAAK,WAAW;OAChB,EAUL,QAAQ,GACT;OAEM,EAAE,UAAU,EAAsC;OAElD,EAAE,YAAY,EAAE;OAEhB,EAAE,2BAA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AAG,MAAM,IAAI,EAAE,CAAC;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,sBAAsB,EAAE,CAAA,UAA6B,CAAA,EAAE;YACpF,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;gBACpB,EAAE,gBAAgB,EAAE,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,mBAAmB,CAAC,CAAC,QAAQ,EAAE,EAAE;gBACxE,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CACJ,OAAe,EACf,SAA+C,EAAE,EACjD,OAAwB;QAExB,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,cAAc,OAAO,YAAY,EAAE;YAChE,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;gBACpB,EAAE,gBAAgB,EAAE,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,mBAAmB,CAAC,CAAC,QAAQ,EAAE,EAAE;gBACxE,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;CACF;AAmOD,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC"}

View File

@@ -0,0 +1,257 @@
import { APIResource } from "../../../core/resource.mjs";
import * as BetaAPI from "../beta.mjs";
import { APIPromise } from "../../../core/api-promise.mjs";
import { PageCursor, type PageCursorParams, PagePromise } from "../../../core/pagination.mjs";
import { type Uploadable } from "../../../core/uploads.mjs";
import { RequestOptions } from "../../../internal/request-options.mjs";
export declare class Versions extends APIResource {
/**
* Create Skill Version
*
* @example
* ```ts
* const version = await client.beta.skills.versions.create(
* 'skill_id',
* );
* ```
*/
create(skillID: string, params?: VersionCreateParams | null | undefined, options?: RequestOptions): APIPromise<VersionCreateResponse>;
/**
* Get Skill Version
*
* @example
* ```ts
* const version = await client.beta.skills.versions.retrieve(
* 'version',
* { skill_id: 'skill_id' },
* );
* ```
*/
retrieve(version: string, params: VersionRetrieveParams, options?: RequestOptions): APIPromise<VersionRetrieveResponse>;
/**
* List Skill Versions
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const versionListResponse of client.beta.skills.versions.list(
* 'skill_id',
* )) {
* // ...
* }
* ```
*/
list(skillID: string, params?: VersionListParams | null | undefined, options?: RequestOptions): PagePromise<VersionListResponsesPageCursor, VersionListResponse>;
/**
* Delete Skill Version
*
* @example
* ```ts
* const version = await client.beta.skills.versions.delete(
* 'version',
* { skill_id: 'skill_id' },
* );
* ```
*/
delete(version: string, params: VersionDeleteParams, options?: RequestOptions): APIPromise<VersionDeleteResponse>;
}
export type VersionListResponsesPageCursor = PageCursor<VersionListResponse>;
export interface VersionCreateResponse {
/**
* Unique identifier for the skill version.
*
* The format and length of IDs may change over time.
*/
id: string;
/**
* ISO 8601 timestamp of when the skill version was created.
*/
created_at: string;
/**
* Description of the skill version.
*
* This is extracted from the SKILL.md file in the skill upload.
*/
description: string;
/**
* Directory name of the skill version.
*
* This is the top-level directory name that was extracted from the uploaded files.
*/
directory: string;
/**
* Human-readable name of the skill version.
*
* This is extracted from the SKILL.md file in the skill upload.
*/
name: string;
/**
* Identifier for the skill that this version belongs to.
*/
skill_id: string;
/**
* Object type.
*
* For Skill Versions, this is always `"skill_version"`.
*/
type: string;
/**
* Version identifier for the skill.
*
* Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
*/
version: string;
}
export interface VersionRetrieveResponse {
/**
* Unique identifier for the skill version.
*
* The format and length of IDs may change over time.
*/
id: string;
/**
* ISO 8601 timestamp of when the skill version was created.
*/
created_at: string;
/**
* Description of the skill version.
*
* This is extracted from the SKILL.md file in the skill upload.
*/
description: string;
/**
* Directory name of the skill version.
*
* This is the top-level directory name that was extracted from the uploaded files.
*/
directory: string;
/**
* Human-readable name of the skill version.
*
* This is extracted from the SKILL.md file in the skill upload.
*/
name: string;
/**
* Identifier for the skill that this version belongs to.
*/
skill_id: string;
/**
* Object type.
*
* For Skill Versions, this is always `"skill_version"`.
*/
type: string;
/**
* Version identifier for the skill.
*
* Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
*/
version: string;
}
export interface VersionListResponse {
/**
* Unique identifier for the skill version.
*
* The format and length of IDs may change over time.
*/
id: string;
/**
* ISO 8601 timestamp of when the skill version was created.
*/
created_at: string;
/**
* Description of the skill version.
*
* This is extracted from the SKILL.md file in the skill upload.
*/
description: string;
/**
* Directory name of the skill version.
*
* This is the top-level directory name that was extracted from the uploaded files.
*/
directory: string;
/**
* Human-readable name of the skill version.
*
* This is extracted from the SKILL.md file in the skill upload.
*/
name: string;
/**
* Identifier for the skill that this version belongs to.
*/
skill_id: string;
/**
* Object type.
*
* For Skill Versions, this is always `"skill_version"`.
*/
type: string;
/**
* Version identifier for the skill.
*
* Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
*/
version: string;
}
export interface VersionDeleteResponse {
/**
* Version identifier for the skill.
*
* Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
*/
id: string;
/**
* Deleted object type.
*
* For Skill Versions, this is always `"skill_version_deleted"`.
*/
type: string;
}
export interface VersionCreateParams {
/**
* Body param: Files to upload for the skill.
*
* All files must be in the same top-level directory and must include a SKILL.md
* file at the root of that directory.
*/
files?: Array<Uploadable> | null;
/**
* Header param: Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export interface VersionRetrieveParams {
/**
* Path param: Unique identifier for the skill.
*
* The format and length of IDs may change over time.
*/
skill_id: string;
/**
* Header param: Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export interface VersionListParams extends PageCursorParams {
/**
* Header param: Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export interface VersionDeleteParams {
/**
* Path param: Unique identifier for the skill.
*
* The format and length of IDs may change over time.
*/
skill_id: string;
/**
* Header param: Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export declare namespace Versions {
export { type VersionCreateResponse as VersionCreateResponse, type VersionRetrieveResponse as VersionRetrieveResponse, type VersionListResponse as VersionListResponse, type VersionDeleteResponse as VersionDeleteResponse, type VersionListResponsesPageCursor as VersionListResponsesPageCursor, type VersionCreateParams as VersionCreateParams, type VersionRetrieveParams as VersionRetrieveParams, type VersionListParams as VersionListParams, type VersionDeleteParams as VersionDeleteParams, };
}
//# sourceMappingURL=versions.d.mts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"versions.d.mts","sourceRoot":"","sources":["../../../src/resources/beta/skills/versions.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,OAAO;OACZ,EAAE,UAAU,EAAE;OACd,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE;OAClD,EAAE,KAAK,UAAU,EAAE;OAEnB,EAAE,cAAc,EAAE;AAIzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;OASG;IACH,MAAM,CACJ,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,mBAAmB,GAAG,IAAI,GAAG,SAAc,EACnD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,qBAAqB,CAAC;IAkBpC;;;;;;;;;;OAUG;IACH,QAAQ,CACN,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,qBAAqB,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,uBAAuB,CAAC;IAWtC;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,iBAAiB,GAAG,IAAI,GAAG,SAAc,EACjD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,8BAA8B,EAAE,mBAAmB,CAAC;IAgBnE;;;;;;;;;;OAUG;IACH,MAAM,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AmB,GAChD,CAAC;CACH"}

View File

@@ -0,0 +1,257 @@
import { APIResource } from "../../../core/resource.js";
import * as BetaAPI from "../beta.js";
import { APIPromise } from "../../../core/api-promise.js";
import { PageCursor, type PageCursorParams, PagePromise } from "../../../core/pagination.js";
import { type Uploadable } from "../../../core/uploads.js";
import { RequestOptions } from "../../../internal/request-options.js";
export declare class Versions extends APIResource {
/**
* Create Skill Version
*
* @example
* ```ts
* const version = await client.beta.skills.versions.create(
* 'skill_id',
* );
* ```
*/
create(skillID: string, params?: VersionCreateParams | null | undefined, options?: RequestOptions): APIPromise<VersionCreateResponse>;
/**
* Get Skill Version
*
* @example
* ```ts
* const version = await client.beta.skills.versions.retrieve(
* 'version',
* { skill_id: 'skill_id' },
* );
* ```
*/
retrieve(version: string, params: VersionRetrieveParams, options?: RequestOptions): APIPromise<VersionRetrieveResponse>;
/**
* List Skill Versions
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const versionListResponse of client.beta.skills.versions.list(
* 'skill_id',
* )) {
* // ...
* }
* ```
*/
list(skillID: string, params?: VersionListParams | null | undefined, options?: RequestOptions): PagePromise<VersionListResponsesPageCursor, VersionListResponse>;
/**
* Delete Skill Version
*
* @example
* ```ts
* const version = await client.beta.skills.versions.delete(
* 'version',
* { skill_id: 'skill_id' },
* );
* ```
*/
delete(version: string, params: VersionDeleteParams, options?: RequestOptions): APIPromise<VersionDeleteResponse>;
}
export type VersionListResponsesPageCursor = PageCursor<VersionListResponse>;
export interface VersionCreateResponse {
/**
* Unique identifier for the skill version.
*
* The format and length of IDs may change over time.
*/
id: string;
/**
* ISO 8601 timestamp of when the skill version was created.
*/
created_at: string;
/**
* Description of the skill version.
*
* This is extracted from the SKILL.md file in the skill upload.
*/
description: string;
/**
* Directory name of the skill version.
*
* This is the top-level directory name that was extracted from the uploaded files.
*/
directory: string;
/**
* Human-readable name of the skill version.
*
* This is extracted from the SKILL.md file in the skill upload.
*/
name: string;
/**
* Identifier for the skill that this version belongs to.
*/
skill_id: string;
/**
* Object type.
*
* For Skill Versions, this is always `"skill_version"`.
*/
type: string;
/**
* Version identifier for the skill.
*
* Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
*/
version: string;
}
export interface VersionRetrieveResponse {
/**
* Unique identifier for the skill version.
*
* The format and length of IDs may change over time.
*/
id: string;
/**
* ISO 8601 timestamp of when the skill version was created.
*/
created_at: string;
/**
* Description of the skill version.
*
* This is extracted from the SKILL.md file in the skill upload.
*/
description: string;
/**
* Directory name of the skill version.
*
* This is the top-level directory name that was extracted from the uploaded files.
*/
directory: string;
/**
* Human-readable name of the skill version.
*
* This is extracted from the SKILL.md file in the skill upload.
*/
name: string;
/**
* Identifier for the skill that this version belongs to.
*/
skill_id: string;
/**
* Object type.
*
* For Skill Versions, this is always `"skill_version"`.
*/
type: string;
/**
* Version identifier for the skill.
*
* Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
*/
version: string;
}
export interface VersionListResponse {
/**
* Unique identifier for the skill version.
*
* The format and length of IDs may change over time.
*/
id: string;
/**
* ISO 8601 timestamp of when the skill version was created.
*/
created_at: string;
/**
* Description of the skill version.
*
* This is extracted from the SKILL.md file in the skill upload.
*/
description: string;
/**
* Directory name of the skill version.
*
* This is the top-level directory name that was extracted from the uploaded files.
*/
directory: string;
/**
* Human-readable name of the skill version.
*
* This is extracted from the SKILL.md file in the skill upload.
*/
name: string;
/**
* Identifier for the skill that this version belongs to.
*/
skill_id: string;
/**
* Object type.
*
* For Skill Versions, this is always `"skill_version"`.
*/
type: string;
/**
* Version identifier for the skill.
*
* Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
*/
version: string;
}
export interface VersionDeleteResponse {
/**
* Version identifier for the skill.
*
* Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
*/
id: string;
/**
* Deleted object type.
*
* For Skill Versions, this is always `"skill_version_deleted"`.
*/
type: string;
}
export interface VersionCreateParams {
/**
* Body param: Files to upload for the skill.
*
* All files must be in the same top-level directory and must include a SKILL.md
* file at the root of that directory.
*/
files?: Array<Uploadable> | null;
/**
* Header param: Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export interface VersionRetrieveParams {
/**
* Path param: Unique identifier for the skill.
*
* The format and length of IDs may change over time.
*/
skill_id: string;
/**
* Header param: Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export interface VersionListParams extends PageCursorParams {
/**
* Header param: Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export interface VersionDeleteParams {
/**
* Path param: Unique identifier for the skill.
*
* The format and length of IDs may change over time.
*/
skill_id: string;
/**
* Header param: Optional header to specify the beta version(s) you want to use.
*/
betas?: Array<BetaAPI.AnthropicBeta>;
}
export declare namespace Versions {
export { type VersionCreateResponse as VersionCreateResponse, type VersionRetrieveResponse as VersionRetrieveResponse, type VersionListResponse as VersionListResponse, type VersionDeleteResponse as VersionDeleteResponse, type VersionListResponsesPageCursor as VersionListResponsesPageCursor, type VersionCreateParams as VersionCreateParams, type VersionRetrieveParams as VersionRetrieveParams, type VersionListParams as VersionListParams, type VersionDeleteParams as VersionDeleteParams, };
}
//# sourceMappingURL=versions.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/skills/versions.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,OAAO;OACZ,EAAE,UAAU,EAAE;OACd,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE;OAClD,EAAE,KAAK,UAAU,EAAE;OAEnB,EAAE,cAAc,EAAE;AAIzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;OASG;IACH,MAAM,CACJ,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,mBAAmB,GAAG,IAAI,GAAG,SAAc,EACnD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAA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