Add all the original files from the deleted 0.2.8 npm package

This commit is contained in:
daniel nakov
2025-02-26 19:31:54 -05:00
parent 8bf1bb8913
commit ca97a02201
323 changed files with 26218 additions and 2 deletions

57
vendor/sdk/resources/beta/beta.d.ts vendored Normal file
View File

@@ -0,0 +1,57 @@
import { APIResource } from "../../resource.js";
import * as ModelsAPI from "./models.js";
import { BetaModelInfo, BetaModelInfosPage, ModelListParams, Models } from "./models.js";
import * as MessagesAPI from "./messages/messages.js";
import { BetaBase64PDFBlock, BetaBase64PDFSource, BetaCacheControlEphemeral, BetaCitationCharLocation, BetaCitationCharLocationParam, BetaCitationContentBlockLocation, BetaCitationContentBlockLocationParam, BetaCitationPageLocation, BetaCitationPageLocationParam, BetaCitationsConfigParam, BetaCitationsDelta, BetaContentBlock, BetaContentBlockParam, BetaContentBlockSource, BetaContentBlockSourceContent, BetaImageBlockParam, BetaInputJSONDelta, BetaMessage, BetaMessageDeltaUsage, BetaMessageParam, BetaMessageTokensCount, BetaMetadata, BetaPlainTextSource, BetaRawContentBlockDeltaEvent, BetaRawContentBlockStartEvent, BetaRawContentBlockStopEvent, BetaRawMessageDeltaEvent, BetaRawMessageStartEvent, BetaRawMessageStopEvent, BetaRawMessageStreamEvent, BetaRedactedThinkingBlock, BetaRedactedThinkingBlockParam, BetaSignatureDelta, BetaTextBlock, BetaTextBlockParam, BetaTextCitation, BetaTextCitationParam, BetaTextDelta, BetaThinkingBlock, BetaThinkingBlockParam, BetaThinkingConfigDisabled, BetaThinkingConfigEnabled, BetaThinkingDelta, BetaTool, BetaToolBash20241022, BetaToolBash20250124, BetaToolChoice, BetaToolChoiceAny, BetaToolChoiceAuto, BetaToolChoiceTool, BetaToolComputerUse20241022, BetaToolResultBlockParam, BetaToolTextEditor20241022, BetaToolTextEditor20250124, BetaToolUnion, BetaToolUseBlock, BetaToolUseBlockParam, BetaUsage, MessageCountTokensParams, MessageCreateParams, MessageCreateParamsNonStreaming, MessageCreateParamsStreaming, Messages } from "./messages/messages.js";
export declare class Beta extends APIResource {
models: ModelsAPI.Models;
messages: MessagesAPI.Messages;
}
export type AnthropicBeta = (string & {}) | 'message-batches-2024-09-24' | 'prompt-caching-2024-07-31' | 'computer-use-2024-10-22' | 'pdfs-2024-09-25' | 'token-counting-2024-11-01';
export interface BetaAPIError {
message: string;
type: 'api_error';
}
export interface BetaAuthenticationError {
message: string;
type: 'authentication_error';
}
export interface BetaBillingError {
message: string;
type: 'billing_error';
}
export type BetaError = BetaInvalidRequestError | BetaAuthenticationError | BetaBillingError | BetaPermissionError | BetaNotFoundError | BetaRateLimitError | BetaGatewayTimeoutError | BetaAPIError | BetaOverloadedError;
export interface BetaErrorResponse {
error: BetaError;
type: 'error';
}
export interface BetaGatewayTimeoutError {
message: string;
type: 'timeout_error';
}
export interface BetaInvalidRequestError {
message: string;
type: 'invalid_request_error';
}
export interface BetaNotFoundError {
message: string;
type: 'not_found_error';
}
export interface BetaOverloadedError {
message: string;
type: 'overloaded_error';
}
export interface BetaPermissionError {
message: string;
type: 'permission_error';
}
export interface BetaRateLimitError {
message: string;
type: 'rate_limit_error';
}
export declare namespace Beta {
export { type AnthropicBeta as AnthropicBeta, type BetaAPIError as BetaAPIError, type BetaAuthenticationError as BetaAuthenticationError, type BetaBillingError as BetaBillingError, type BetaError as BetaError, type BetaErrorResponse as BetaErrorResponse, type BetaGatewayTimeoutError as BetaGatewayTimeoutError, type BetaInvalidRequestError as BetaInvalidRequestError, type BetaNotFoundError as BetaNotFoundError, type BetaOverloadedError as BetaOverloadedError, type BetaPermissionError as BetaPermissionError, type BetaRateLimitError as BetaRateLimitError, };
export { Models as Models, type BetaModelInfo as BetaModelInfo, BetaModelInfosPage as BetaModelInfosPage, type ModelListParams as ModelListParams, };
export { Messages as Messages, type BetaBase64PDFBlock as BetaBase64PDFBlock, type BetaBase64PDFSource as BetaBase64PDFSource, type BetaCacheControlEphemeral as BetaCacheControlEphemeral, type BetaCitationCharLocation as BetaCitationCharLocation, type BetaCitationCharLocationParam as BetaCitationCharLocationParam, type BetaCitationContentBlockLocation as BetaCitationContentBlockLocation, type BetaCitationContentBlockLocationParam as BetaCitationContentBlockLocationParam, type BetaCitationPageLocation as BetaCitationPageLocation, type BetaCitationPageLocationParam as BetaCitationPageLocationParam, type BetaCitationsConfigParam as BetaCitationsConfigParam, type BetaCitationsDelta as BetaCitationsDelta, type BetaContentBlock as BetaContentBlock, type BetaContentBlockParam as BetaContentBlockParam, type BetaContentBlockSource as BetaContentBlockSource, type BetaContentBlockSourceContent as BetaContentBlockSourceContent, type BetaImageBlockParam as BetaImageBlockParam, type BetaInputJSONDelta as BetaInputJSONDelta, type BetaMessage as BetaMessage, type BetaMessageDeltaUsage as BetaMessageDeltaUsage, type BetaMessageParam as BetaMessageParam, type BetaMessageTokensCount as BetaMessageTokensCount, type BetaMetadata as BetaMetadata, type BetaPlainTextSource as BetaPlainTextSource, type BetaRawContentBlockDeltaEvent as BetaRawContentBlockDeltaEvent, type BetaRawContentBlockStartEvent as BetaRawContentBlockStartEvent, type BetaRawContentBlockStopEvent as BetaRawContentBlockStopEvent, type BetaRawMessageDeltaEvent as BetaRawMessageDeltaEvent, type BetaRawMessageStartEvent as BetaRawMessageStartEvent, type BetaRawMessageStopEvent as BetaRawMessageStopEvent, type BetaRawMessageStreamEvent as BetaRawMessageStreamEvent, type BetaRedactedThinkingBlock as BetaRedactedThinkingBlock, type BetaRedactedThinkingBlockParam as BetaRedactedThinkingBlockParam, type BetaSignatureDelta as BetaSignatureDelta, type BetaTextBlock as BetaTextBlock, type BetaTextBlockParam as BetaTextBlockParam, type BetaTextCitation as BetaTextCitation, type BetaTextCitationParam as BetaTextCitationParam, type BetaTextDelta as BetaTextDelta, type BetaThinkingBlock as BetaThinkingBlock, type BetaThinkingBlockParam as BetaThinkingBlockParam, type BetaThinkingConfigDisabled as BetaThinkingConfigDisabled, type BetaThinkingConfigEnabled as BetaThinkingConfigEnabled, type BetaThinkingDelta as BetaThinkingDelta, type BetaTool as BetaTool, type BetaToolBash20241022 as BetaToolBash20241022, type BetaToolBash20250124 as BetaToolBash20250124, type BetaToolChoice as BetaToolChoice, type BetaToolChoiceAny as BetaToolChoiceAny, type BetaToolChoiceAuto as BetaToolChoiceAuto, type BetaToolChoiceTool as BetaToolChoiceTool, type BetaToolComputerUse20241022 as BetaToolComputerUse20241022, type BetaToolResultBlockParam as BetaToolResultBlockParam, type BetaToolTextEditor20241022 as BetaToolTextEditor20241022, type BetaToolTextEditor20250124 as BetaToolTextEditor20250124, type BetaToolUnion as BetaToolUnion, type BetaToolUseBlock as BetaToolUseBlock, type BetaToolUseBlockParam as BetaToolUseBlockParam, type BetaUsage as BetaUsage, type MessageCreateParams as MessageCreateParams, type MessageCreateParamsNonStreaming as MessageCreateParamsNonStreaming, type MessageCreateParamsStreaming as MessageCreateParamsStreaming, type MessageCountTokensParams as MessageCountTokensParams, };
}
//# sourceMappingURL=beta.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"beta.d.ts","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,SAAS,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACtF,OAAO,KAAK,WAAW,MAAM,qBAAqB,CAAC;AACnD,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,wBAAwB,EACxB,6BAA6B,EAC7B,gCAAgC,EAChC,qCAAqC,EACrC,wBAAwB,EACxB,6BAA6B,EAC7B,wBAAwB,EACxB,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EACrB,sBAAsB,EACtB,6BAA6B,EAC7B,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,qBAAqB,EACrB,gBAAgB,EAChB,sBAAsB,EACtB,YAAY,EACZ,mBAAmB,EACnB,6BAA6B,EA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,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,QAAQ,IAAI,QAAQ,EACzB,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,SAAS,IAAI,SAAS,EAC3B,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;CACH"}

44
vendor/sdk/resources/beta/beta.js vendored Normal file
View File

@@ -0,0 +1,44 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Beta = void 0;
const resource_1 = require("../../resource.js");
const ModelsAPI = __importStar(require("./models.js"));
const models_1 = require("./models.js");
const MessagesAPI = __importStar(require("./messages/messages.js"));
const messages_1 = require("./messages/messages.js");
class Beta extends resource_1.APIResource {
constructor() {
super(...arguments);
this.models = new ModelsAPI.Models(this._client);
this.messages = new MessagesAPI.Messages(this._client);
}
}
exports.Beta = Beta;
Beta.Models = models_1.Models;
Beta.BetaModelInfosPage = models_1.BetaModelInfosPage;
Beta.Messages = messages_1.Messages;
//# sourceMappingURL=beta.js.map

1
vendor/sdk/resources/beta/beta.js.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"beta.js","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtF,gDAA6C;AAC7C,uDAAsC;AACtC,wCAAsF;AACtF,oEAAmD;AACnD,qDAgE6B;AAE7B,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;IAC1E,CAAC;CAAA;AAHD,oBAGC;AAiFD,IAAI,CAAC,MAAM,GAAG,eAAM,CAAC;AACrB,IAAI,CAAC,kBAAkB,GAAG,2BAAkB,CAAC;AAC7C,IAAI,CAAC,QAAQ,GAAG,mBAAQ,CAAC"}

17
vendor/sdk/resources/beta/beta.mjs vendored Normal file
View File

@@ -0,0 +1,17 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../resource.mjs";
import * as ModelsAPI from "./models.mjs";
import { BetaModelInfosPage, Models } from "./models.mjs";
import * as MessagesAPI from "./messages/messages.mjs";
import { Messages, } from "./messages/messages.mjs";
export class Beta extends APIResource {
constructor() {
super(...arguments);
this.models = new ModelsAPI.Models(this._client);
this.messages = new MessagesAPI.Messages(this._client);
}
}
Beta.Models = Models;
Beta.BetaModelInfosPage = BetaModelInfosPage;
Beta.Messages = Messages;
//# 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,SAAS;OACd,EAAiB,kBAAkB,EAAmB,MAAM,EAAE;OAC9D,KAAK,WAAW;OAChB,EA+DL,QAAQ,GACT;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;IAC1E,CAAC;CAAA;AAiFD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;AACrB,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;AAC7C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC"}

4
vendor/sdk/resources/beta/index.d.ts vendored Normal file
View File

@@ -0,0 +1,4 @@
export { Beta, type AnthropicBeta, type BetaAPIError, type BetaAuthenticationError, type BetaBillingError, type BetaError, type BetaErrorResponse, type BetaGatewayTimeoutError, type BetaInvalidRequestError, type BetaNotFoundError, type BetaOverloadedError, type BetaPermissionError, type BetaRateLimitError, } from "./beta.js";
export { BetaModelInfosPage, Models, type BetaModelInfo, type ModelListParams } from "./models.js";
export { Messages, type BetaBase64PDFBlock, type BetaBase64PDFSource, type BetaCacheControlEphemeral, type BetaCitationCharLocation, type BetaCitationCharLocationParam, type BetaCitationContentBlockLocation, type BetaCitationContentBlockLocationParam, type BetaCitationPageLocation, type BetaCitationPageLocationParam, type BetaCitationsConfigParam, type BetaCitationsDelta, type BetaContentBlock, type BetaContentBlockParam, type BetaContentBlockSource, type BetaContentBlockSourceContent, type BetaImageBlockParam, type BetaInputJSONDelta, type BetaMessage, type BetaMessageDeltaUsage, type BetaMessageParam, type BetaMessageTokensCount, type BetaMetadata, type BetaPlainTextSource, type BetaRawContentBlockDeltaEvent, type BetaRawContentBlockStartEvent, type BetaRawContentBlockStopEvent, type BetaRawMessageDeltaEvent, type BetaRawMessageStartEvent, type BetaRawMessageStopEvent, type BetaRawMessageStreamEvent, type BetaRedactedThinkingBlock, type BetaRedactedThinkingBlockParam, type BetaSignatureDelta, type BetaTextBlock, type BetaTextBlockParam, type BetaTextCitation, type BetaTextCitationParam, type BetaTextDelta, type BetaThinkingBlock, type BetaThinkingBlockParam, type BetaThinkingConfigDisabled, type BetaThinkingConfigEnabled, type BetaThinkingDelta, type BetaTool, type BetaToolBash20241022, type BetaToolBash20250124, type BetaToolChoice, type BetaToolChoiceAny, type BetaToolChoiceAuto, type BetaToolChoiceTool, type BetaToolComputerUse20241022, type BetaToolResultBlockParam, type BetaToolTextEditor20241022, type BetaToolTextEditor20250124, type BetaToolUnion, type BetaToolUseBlock, type BetaToolUseBlockParam, type BetaUsage, type MessageCreateParams, type MessageCreateParamsNonStreaming, type MessageCreateParamsStreaming, type MessageCountTokensParams, } from "./messages/index.js";
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":"AAEA,OAAO,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,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAChG,OAAO,EACL,QAAQ,EACR,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,6BAA6B,EAClC,KAAK,gCAAgC,EACrC,KAAK,qCAAqC,EAC1C,KAAK,wBAAwB,EAC7B,KAAK,6BAA6B,EAClC,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,EAClC,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,6BAA6B,EAClC,KAAK,6BAA6B,EAClC,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,8BAA8B,EACnC,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,EAC/B,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACd,KAAK,mBAAmB,EACxB,KAAK,+BAA+B,EACpC,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,GAC9B,MAAM,kBAAkB,CAAC"}

12
vendor/sdk/resources/beta/index.js vendored Normal file
View File

@@ -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.Messages = exports.Models = exports.BetaModelInfosPage = exports.Beta = void 0;
var beta_1 = require("./beta.js");
Object.defineProperty(exports, "Beta", { enumerable: true, get: function () { return beta_1.Beta; } });
var models_1 = require("./models.js");
Object.defineProperty(exports, "BetaModelInfosPage", { enumerable: true, get: function () { return models_1.BetaModelInfosPage; } });
Object.defineProperty(exports, "Models", { enumerable: true, get: function () { return models_1.Models; } });
var index_1 = require("./messages/index.js");
Object.defineProperty(exports, "Messages", { enumerable: true, get: function () { return index_1.Messages; } });
//# 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,sCAAgG;AAAvF,4GAAA,kBAAkB,OAAA;AAAE,gGAAA,MAAM,OAAA;AACnC,6CAgE0B;AA/DxB,iGAAA,QAAQ,OAAA"}

5
vendor/sdk/resources/beta/index.mjs vendored Normal file
View File

@@ -0,0 +1,5 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
export { Beta, } from "./beta.mjs";
export { BetaModelInfosPage, Models } from "./models.mjs";
export { Messages, } from "./messages/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,EAAE,kBAAkB,EAAE,MAAM,EAA4C;OACxE,EACL,QAAQ,GA+DT"}

View File

@@ -0,0 +1,289 @@
import { APIResource } from "../../../resource.js";
import * as Core from "../../../core.js";
import * as BetaAPI from "../beta.js";
import * as BetaMessagesAPI from "./messages.js";
import { Page, type PageParams } from "../../../pagination.js";
import { JSONLDecoder } from "../../../internal/decoders/jsonl.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](/en/docs/build-with-claude/batch-processing)
*/
create(params: BatchCreateParams, options?: Core.RequestOptions): Core.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](/en/docs/build-with-claude/batch-processing)
*/
retrieve(messageBatchId: string, params?: BatchRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<BetaMessageBatch>;
retrieve(messageBatchId: string, options?: Core.RequestOptions): Core.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](/en/docs/build-with-claude/batch-processing)
*/
list(params?: BatchListParams, options?: Core.RequestOptions): Core.PagePromise<BetaMessageBatchesPage, BetaMessageBatch>;
list(options?: Core.RequestOptions): Core.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](/en/docs/build-with-claude/batch-processing)
*/
delete(messageBatchId: string, params?: BatchDeleteParams, options?: Core.RequestOptions): Core.APIPromise<BetaDeletedMessageBatch>;
delete(messageBatchId: string, options?: Core.RequestOptions): Core.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](/en/docs/build-with-claude/batch-processing)
*/
cancel(messageBatchId: string, params?: BatchCancelParams, options?: Core.RequestOptions): Core.APIPromise<BetaMessageBatch>;
cancel(messageBatchId: string, options?: Core.RequestOptions): Core.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](/en/docs/build-with-claude/batch-processing)
*/
results(messageBatchId: string, params?: BatchResultsParams, options?: Core.RequestOptions): Promise<JSONLDecoder<BetaMessageBatchIndividualResponse>>;
results(messageBatchId: string, options?: Core.RequestOptions): Promise<JSONLDecoder<BetaMessageBatchIndividualResponse>>;
}
export declare class BetaMessageBatchesPage extends 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](/en/api/messages) for full documentation on
* available parameters.
*/
params: Omit<BetaMessagesAPI.MessageCreateParamsNonStreaming, 'betas'>;
}
}
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, 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

View File

@@ -0,0 +1 @@
{"version":3,"file":"batches.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/messages/batches.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AACtC,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,eAAe,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,kC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BUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.BetaMessageBatchesPage = exports.Batches = void 0;
const resource_1 = require("../../../resource.js");
const core_1 = require("../../../core.js");
const pagination_1 = require("../../../pagination.js");
const jsonl_1 = require("../../../internal/decoders/jsonl.js");
const error_1 = require("../../../error.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](/en/docs/build-with-claude/batch-processing)
*/
create(params, options) {
const { betas, ...body } = params;
return this._client.post('/v1/messages/batches?beta=true', {
body,
...options,
headers: {
'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString(),
...options?.headers,
},
});
}
retrieve(messageBatchId, params = {}, options) {
if ((0, core_1.isRequestOptions)(params)) {
return this.retrieve(messageBatchId, {}, params);
}
const { betas } = params;
return this._client.get(`/v1/messages/batches/${messageBatchId}?beta=true`, {
...options,
headers: {
'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString(),
...options?.headers,
},
});
}
list(params = {}, options) {
if ((0, core_1.isRequestOptions)(params)) {
return this.list({}, params);
}
const { betas, ...query } = params;
return this._client.getAPIList('/v1/messages/batches?beta=true', BetaMessageBatchesPage, {
query,
...options,
headers: {
'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString(),
...options?.headers,
},
});
}
delete(messageBatchId, params = {}, options) {
if ((0, core_1.isRequestOptions)(params)) {
return this.delete(messageBatchId, {}, params);
}
const { betas } = params;
return this._client.delete(`/v1/messages/batches/${messageBatchId}?beta=true`, {
...options,
headers: {
'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString(),
...options?.headers,
},
});
}
cancel(messageBatchId, params = {}, options) {
if ((0, core_1.isRequestOptions)(params)) {
return this.cancel(messageBatchId, {}, params);
}
const { betas } = params;
return this._client.post(`/v1/messages/batches/${messageBatchId}/cancel?beta=true`, {
...options,
headers: {
'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString(),
...options?.headers,
},
});
}
async results(messageBatchId, params = {}, options) {
if ((0, core_1.isRequestOptions)(params)) {
return this.results(messageBatchId, {}, params);
}
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: {
'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString(),
Accept: 'application/binary',
...options?.headers,
},
__binaryResponse: true,
})
._thenUnwrap((_, props) => jsonl_1.JSONLDecoder.fromResponse(props.response, props.controller));
}
}
exports.Batches = Batches;
class BetaMessageBatchesPage extends pagination_1.Page {
}
exports.BetaMessageBatchesPage = BetaMessageBatchesPage;
Batches.BetaMessageBatchesPage = BetaMessageBatchesPage;
//# 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,mDAAgD;AAChD,2CAAiD;AAIjD,uDAA4D;AAC5D,+DAAgE;AAChE,6CAAgD;AAEhD,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;;;;;;OASG;IACH,MAAM,CAAC,MAAyB,EAAE,OAA6B;QAC7D,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;gBACP,gBAAgB,EAAE,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,4BAA4B,CAAC,CAAC,QAAQ,EAAE;gBAC7E,GAAG,OAAO,EAAE,OAAO;aACpB;SACF,CAAC,CAAC;IACL,CAA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CAAC,iBAAiB,MAAM,KAAK,CAAC,EAAE,EAAE,CACjG,CAAC;SACH;QAED,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;QACzB,OAAO,IAAI,CAAC,OAAO;aAChB,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE;YACtB,GAAG,OAAO;YACV,OAAO,EAAE;gBACP,gBAAgB,EAAE,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,4BAA4B,CAAC,CAAC,QAAQ,EAAE;gBAC7E,MAAM,EAAE,oBAAoB;gBAC5B,GAAG,OAAO,EAAE,OAAO;aACpB;YACD,gBAAgB,EAAE,IAAI;SACvB,CAAC;aACD,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,oBAAY,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IAC5F,CAAC;CACF;AA5MD,0BA4MC;AAED,MAAa,sBAAuB,SAAQ,iBAAsB;CAAG;AAArE,wDAAqE;AAuPrE,OAAO,CAAC,sBAAsB,GAAG,sBAAsB,CAAC"}

View File

@@ -0,0 +1,107 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../resource.mjs";
import { isRequestOptions } from "../../../core.mjs";
import { Page } from "../../../pagination.mjs";
import { JSONLDecoder } from "../../../internal/decoders/jsonl.mjs";
import { AnthropicError } from "../../../error.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](/en/docs/build-with-claude/batch-processing)
*/
create(params, options) {
const { betas, ...body } = params;
return this._client.post('/v1/messages/batches?beta=true', {
body,
...options,
headers: {
'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString(),
...options?.headers,
},
});
}
retrieve(messageBatchId, params = {}, options) {
if (isRequestOptions(params)) {
return this.retrieve(messageBatchId, {}, params);
}
const { betas } = params;
return this._client.get(`/v1/messages/batches/${messageBatchId}?beta=true`, {
...options,
headers: {
'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString(),
...options?.headers,
},
});
}
list(params = {}, options) {
if (isRequestOptions(params)) {
return this.list({}, params);
}
const { betas, ...query } = params;
return this._client.getAPIList('/v1/messages/batches?beta=true', BetaMessageBatchesPage, {
query,
...options,
headers: {
'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString(),
...options?.headers,
},
});
}
delete(messageBatchId, params = {}, options) {
if (isRequestOptions(params)) {
return this.delete(messageBatchId, {}, params);
}
const { betas } = params;
return this._client.delete(`/v1/messages/batches/${messageBatchId}?beta=true`, {
...options,
headers: {
'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString(),
...options?.headers,
},
});
}
cancel(messageBatchId, params = {}, options) {
if (isRequestOptions(params)) {
return this.cancel(messageBatchId, {}, params);
}
const { betas } = params;
return this._client.post(`/v1/messages/batches/${messageBatchId}/cancel?beta=true`, {
...options,
headers: {
'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString(),
...options?.headers,
},
});
}
async results(messageBatchId, params = {}, options) {
if (isRequestOptions(params)) {
return this.results(messageBatchId, {}, params);
}
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: {
'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString(),
Accept: 'application/binary',
...options?.headers,
},
__binaryResponse: true,
})
._thenUnwrap((_, props) => JSONLDecoder.fromResponse(props.response, props.controller));
}
}
export class BetaMessageBatchesPage extends Page {
}
Batches.BetaMessageBatchesPage = BetaMessageBatchesPage;
//# sourceMappingURL=batches.mjs.map

View File

@@ -0,0 +1 @@
{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SAAQ,IAAsB;CAAG;AAuPrE,OAAO,CAAC,sBAAsB,GAAG,sBAAsB,CAAC"}

View File

@@ -0,0 +1,3 @@
export { BetaMessageBatchesPage, Batches, type BetaDeletedMessageBatch, type BetaMessageBatch, type BetaMessageBatchCanceledResult, type BetaMessageBatchErroredResult, type BetaMessageBatchExpiredResult, type BetaMessageBatchIndividualResponse, type BetaMessageBatchRequestCounts, type BetaMessageBatchResult, type BetaMessageBatchSucceededResult, type BatchCreateParams, type BatchRetrieveParams, type BatchListParams, type BatchDeleteParams, type BatchCancelParams, type BatchResultsParams, } from "./batches.js";
export { Messages, type BetaBase64PDFBlock, type BetaBase64PDFSource, type BetaCacheControlEphemeral, type BetaCitationCharLocation, type BetaCitationCharLocationParam, type BetaCitationContentBlockLocation, type BetaCitationContentBlockLocationParam, type BetaCitationPageLocation, type BetaCitationPageLocationParam, type BetaCitationsConfigParam, type BetaCitationsDelta, type BetaContentBlock, type BetaContentBlockParam, type BetaContentBlockSource, type BetaContentBlockSourceContent, type BetaImageBlockParam, type BetaInputJSONDelta, type BetaMessage, type BetaMessageDeltaUsage, type BetaMessageParam, type BetaMessageTokensCount, type BetaMetadata, type BetaPlainTextSource, type BetaRawContentBlockDeltaEvent, type BetaRawContentBlockStartEvent, type BetaRawContentBlockStopEvent, type BetaRawMessageDeltaEvent, type BetaRawMessageStartEvent, type BetaRawMessageStopEvent, type BetaRawMessageStreamEvent, type BetaRedactedThinkingBlock, type BetaRedactedThinkingBlockParam, type BetaSignatureDelta, type BetaTextBlock, type BetaTextBlockParam, type BetaTextCitation, type BetaTextCitationParam, type BetaTextDelta, type BetaThinkingBlock, type BetaThinkingBlockParam, type BetaThinkingConfigDisabled, type BetaThinkingConfigEnabled, type BetaThinkingDelta, type BetaTool, type BetaToolBash20241022, type BetaToolBash20250124, type BetaToolChoice, type BetaToolChoiceAny, type BetaToolChoiceAuto, type BetaToolChoiceTool, type BetaToolComputerUse20241022, type BetaToolResultBlockParam, type BetaToolTextEditor20241022, type BetaToolTextEditor20250124, type BetaToolUnion, type BetaToolUseBlock, type BetaToolUseBlockParam, type BetaUsage, type MessageCreateParams, type MessageCreateParamsNonStreaming, type MessageCreateParamsStreaming, type MessageCountTokensParams, type BetaMessageStreamParams, } from "./messages.js";
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/messages/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,sBAAsB,EACtB,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,GACxB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,QAAQ,EACR,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,6BAA6B,EAClC,KAAK,gCAAgC,EACrC,KAAK,qCAAqC,EAC1C,KAAK,wBAAwB,EAC7B,KAAK,6BAA6B,EAClC,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,EAClC,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,6BAA6B,EAClC,KAAK,6BAA6B,EAClC,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,8BAA8B,EACnC,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,EAC/B,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACd,KAAK,mBAAmB,EACxB,KAAK,+BAA+B,EACpC,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,GAC7B,MAAM,YAAY,CAAC"}

View File

@@ -0,0 +1,10 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Messages = exports.Batches = exports.BetaMessageBatchesPage = void 0;
var batches_1 = require("./batches.js");
Object.defineProperty(exports, "BetaMessageBatchesPage", { enumerable: true, get: function () { return batches_1.BetaMessageBatchesPage; } });
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; } });
//# 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,iHAAA,sBAAsB,OAAA;AACtB,kGAAA,OAAO,OAAA;AAiBT,0CAiEoB;AAhElB,oGAAA,QAAQ,OAAA"}

View File

@@ -0,0 +1,4 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
export { BetaMessageBatchesPage, Batches, } from "./batches.mjs";
export { Messages, } 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,sBAAsB,EACtB,OAAO,GAgBR;OACM,EACL,QAAQ,GAgET"}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,93 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Messages = void 0;
const resource_1 = require("../../../resource.js");
const BatchesAPI = __importStar(require("./batches.js"));
const batches_1 = require("./batches.js");
const BetaMessageStream_1 = require("../../../lib/BetaMessageStream.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-2.1': 'July 21st, 2025',
'claude-2.0': 'July 21st, 2025',
};
class Messages extends resource_1.APIResource {
constructor() {
super(...arguments);
this.batches = new BatchesAPI.Batches(this._client);
}
create(params, options) {
const { betas, ...body } = params;
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.`);
}
return this._client.post('/v1/messages?beta=true', {
body,
timeout: this._client._options.timeout ?? 600000,
...options,
headers: {
...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined),
...options?.headers,
},
stream: params.stream ?? false,
});
}
/**
* 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](/en/docs/build-with-claude/token-counting)
*/
countTokens(params, options) {
const { betas, ...body } = params;
return this._client.post('/v1/messages/count_tokens?beta=true', {
body,
...options,
headers: {
'anthropic-beta': [...(betas ?? []), 'token-counting-2024-11-01'].toString(),
...options?.headers,
},
});
}
}
exports.Messages = Messages;
Messages.Batches = batches_1.Batches;
Messages.BetaMessageBatchesPage = batches_1.BetaMessageBatchesPage;
//# 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,mDAA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,OAA6B;QACjE,OAAO,qCAAiB,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;IAED;;;;;;;;OAQG;IACH,WAAW,CACT,MAAgC,EAChC,OAA6B;QAE7B,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAClC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,qCAAqC,EAAE;YAC9D,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE;gBACP,gBAAgB,EAAE,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,2BAA2B,CAAC,CAAC,QAAQ,EAAE;gBAC5E,GAAG,OAAO,EAAE,OAAO;aACpB;SACF,CAAC,CAAC;IACL,CAAC;CACF;AA7ED,4BA6EC;AAitCD,QAAQ,CAAC,OAAO,GAAG,iBAAO,CAAC;AAC3B,QAAQ,CAAC,sBAAsB,GAAG,gCAAsB,CAAC"}

View File

@@ -0,0 +1,66 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../resource.mjs";
import * as BatchesAPI from "./batches.mjs";
import { Batches, BetaMessageBatchesPage, } from "./batches.mjs";
import { BetaMessageStream } from "../../../lib/BetaMessageStream.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-2.1': 'July 21st, 2025',
'claude-2.0': 'July 21st, 2025',
};
export class Messages extends APIResource {
constructor() {
super(...arguments);
this.batches = new BatchesAPI.Batches(this._client);
}
create(params, options) {
const { betas, ...body } = params;
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.`);
}
return this._client.post('/v1/messages?beta=true', {
body,
timeout: this._client._options.timeout ?? 600000,
...options,
headers: {
...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined),
...options?.headers,
},
stream: params.stream ?? false,
});
}
/**
* 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](/en/docs/build-with-claude/token-counting)
*/
countTokens(params, options) {
const { betas, ...body } = params;
return this._client.post('/v1/messages/count_tokens?beta=true', {
body,
...options,
headers: {
'anthropic-beta': [...(betas ?? []), 'token-counting-2024-11-01'].toString(),
...options?.headers,
},
});
}
}
Messages.Batches = Batches;
Messages.BetaMessageBatchesPage = BetaMessageBatchesPage;
//# 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,WAAW,EAAE;OAMf,KAAK,UAAU;OACf,EAOL,OAAO,EAUP,sBAAsB,GACvB;OAEM,EAAE,iBAAiB,EAAE;AAG5B,MAAM,iBAAiB,GAEnB;IACF,YAAY,EAAE,oBAAoB;IAClC,iBAAiB,EAAE,oBAAoB;IACvC,oBAAoB,EAAE,oBAAoB;IAC1C,yBAAyB,EAAE,oBAAoB;IAC/C,oBAAoB,EAAE,oBAAoB;IAC1C,0BAA0B,EAAE,iBAAiB;IAC7C,YAAY,EAAE,iBAAiB;IAC/B,YAAY,EAAE,iBAAiB;CAChC,CAAC;AAEF,MAAM,OAAO,QAAS,SAAQ,WAAW;IAAzC;;QACE,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA4ErE,CAAC;IAxD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EAAE,OAAO;aACpB;SACF,CAAC,CAAC;IACL,CAAC;CACF;AAitCD,QAAQ,CAAC,OAAO,GAAG,OAAO,CAAC;AAC3B,QAAQ,CAAC,sBAAsB,GAAG,sBAAsB,CAAC"}

49
vendor/sdk/resources/beta/models.d.ts vendored Normal file
View File

@@ -0,0 +1,49 @@
import { APIResource } from "../../resource.js";
import * as Core from "../../core.js";
import { Page, type PageParams } from "../../pagination.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.
*/
retrieve(modelId: string, options?: Core.RequestOptions): Core.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.
*/
list(query?: ModelListParams, options?: Core.RequestOptions): Core.PagePromise<BetaModelInfosPage, BetaModelInfo>;
list(options?: Core.RequestOptions): Core.PagePromise<BetaModelInfosPage, BetaModelInfo>;
}
export declare class BetaModelInfosPage extends Page<BetaModelInfo> {
}
export interface BetaModelInfo {
/**
* Unique model identifier.
*/
id: string;
/**
* 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;
/**
* Object type.
*
* For Models, this is always `"model"`.
*/
type: 'model';
}
export interface ModelListParams extends PageParams {
}
export declare namespace Models {
export { type BetaModelInfo as BetaModelInfo, BetaModelInfosPage as BetaModelInfosPage, 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":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEzD,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;IAIxF;;;;;OAKG;IACH,IAAI,CACF,KAAK,CAAC,EAAE,eAAe,EACvB,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,WAAW,CAAC,kBAAkB,EAAE,aAAa,CAAC;IACtD,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,WAAW,CAAC,kBAAkB,EAAE,aAAa,CAAC;CAUzF;AAED,qBAAa,kBAAmB,SAAQ,IAAI,CAAC,aAAa,CAAC;CAAG;AAE9D,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;;;OAIG;IACH,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,eAAgB,SAAQ,UAAU;CAAG;AAItD,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,aAAa,IAAI,aAAa,EACnC,kBAAkB,IAAI,kBAAkB,EACxC,KAAK,eAAe,IAAI,eAAe,GACxC,CAAC;CACH"}

30
vendor/sdk/resources/beta/models.js vendored Normal file
View File

@@ -0,0 +1,30 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.BetaModelInfosPage = exports.Models = void 0;
const resource_1 = require("../../resource.js");
const core_1 = require("../../core.js");
const pagination_1 = require("../../pagination.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.
*/
retrieve(modelId, options) {
return this._client.get(`/v1/models/${modelId}?beta=true`, options);
}
list(query = {}, options) {
if ((0, core_1.isRequestOptions)(query)) {
return this.list({}, query);
}
return this._client.getAPIList('/v1/models?beta=true', BetaModelInfosPage, { query, ...options });
}
}
exports.Models = Models;
class BetaModelInfosPage extends pagination_1.Page {
}
exports.BetaModelInfosPage = BetaModelInfosPage;
Models.BetaModelInfosPage = BetaModelInfosPage;
//# 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,gDAA6C;AAC7C,wCAA8C;AAE9C,oDAAyD;AAEzD,MAAa,MAAO,SAAQ,sBAAW;IACrC;;;;;OAKG;IACH,QAAQ,CAAC,OAAe,EAAE,OAA6B;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,OAAO,YAAY,EAAE,OAAO,CAAC,CAAC;IACtE,CAAC;IAaD,IAAI,CACF,QAA+C,EAAE,EACjD,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,sBAAsB,EAAE,kBAAkB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpG,CAAC;CACF;AA/BD,wBA+BC;AAED,MAAa,kBAAmB,SAAQ,iBAAmB;CAAG;AAA9D,gDAA8D;AA6B9D,MAAM,CAAC,kBAAkB,GAAG,kBAAkB,CAAC"}

25
vendor/sdk/resources/beta/models.mjs vendored Normal file
View File

@@ -0,0 +1,25 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../resource.mjs";
import { isRequestOptions } from "../../core.mjs";
import { Page } from "../../pagination.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.
*/
retrieve(modelId, options) {
return this._client.get(`/v1/models/${modelId}?beta=true`, options);
}
list(query = {}, options) {
if (isRequestOptions(query)) {
return this.list({}, query);
}
return this._client.getAPIList('/v1/models?beta=true', BetaModelInfosPage, { query, ...options });
}
}
export class BetaModelInfosPage extends Page {
}
Models.BetaModelInfosPage = BetaModelInfosPage;
//# sourceMappingURL=models.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"models.mjs","sourceRoot":"","sources":["../../src/resources/beta/models.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAEpB,EAAE,IAAI,EAAmB;AAEhC,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;;;;OAKG;IACH,QAAQ,CAAC,OAAe,EAAE,OAA6B;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,OAAO,YAAY,EAAE,OAAO,CAAC,CAAC;IACtE,CAAC;IAaD,IAAI,CACF,QAA+C,EAAE,EACjD,OAA6B;QAE7B,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,sBAAsB,EAAE,kBAAkB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpG,CAAC;CACF;AAED,MAAM,OAAO,kBAAmB,SAAQ,IAAmB;CAAG;AA6B9D,MAAM,CAAC,kBAAkB,GAAG,kBAAkB,CAAC"}

166
vendor/sdk/resources/completions.d.ts vendored Normal file
View File

@@ -0,0 +1,166 @@
import { APIResource } from "../resource.js";
import { APIPromise } from "../core.js";
import * as Core from "../core.js";
import * as CompletionsAPI from "./completions.js";
import * as MessagesAPI from "./messages/messages.js";
import { Stream } from "../streaming.js";
export declare class Completions extends APIResource {
/**
* [Legacy] Create a Text Completion.
*
* The Text Completions API is a legacy API. We recommend using the
* [Messages API](https://docs.anthropic.com/en/api/messages) going forward.
*
* Future models and features will not be compatible with Text Completions. See our
* [migration guide](https://docs.anthropic.com/en/api/migrating-from-text-completions-to-messages)
* for guidance in migrating from Text Completions to Messages.
*/
create(body: CompletionCreateParamsNonStreaming, options?: Core.RequestOptions): APIPromise<Completion>;
create(body: CompletionCreateParamsStreaming, options?: Core.RequestOptions): APIPromise<Stream<Completion>>;
create(body: CompletionCreateParamsBase, options?: Core.RequestOptions): APIPromise<Stream<Completion> | Completion>;
}
export interface Completion {
/**
* Unique object identifier.
*
* The format and length of IDs may change over time.
*/
id: string;
/**
* The resulting completion up to and excluding the stop sequences.
*/
completion: string;
/**
* 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;
/**
* The reason that we stopped.
*
* This may be one the following values:
*
* - `"stop_sequence"`: we reached a stop sequence — either provided by you via the
* `stop_sequences` parameter, or a stop sequence built into the model
* - `"max_tokens"`: we exceeded `max_tokens_to_sample` or the model's maximum
*/
stop_reason: string | null;
/**
* Object type.
*
* For Text Completions, this is always `"completion"`.
*/
type: 'completion';
}
export type CompletionCreateParams = CompletionCreateParamsNonStreaming | CompletionCreateParamsStreaming;
export interface CompletionCreateParamsBase {
/**
* 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.
*/
max_tokens_to_sample: number;
/**
* 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;
/**
* The prompt that you want Claude to complete.
*
* For proper response generation you will need to format your prompt using
* alternating `\n\nHuman:` and `\n\nAssistant:` conversational turns. For example:
*
* ```
* "\n\nHuman: {userQuestion}\n\nAssistant:"
* ```
*
* See [prompt validation](https://docs.anthropic.com/en/api/prompt-validation) and
* our guide to
* [prompt design](https://docs.anthropic.com/en/docs/intro-to-prompting) for more
* details.
*/
prompt: string;
/**
* An object describing metadata about the request.
*/
metadata?: MessagesAPI.Metadata;
/**
* Sequences that will cause the model to stop generating.
*
* Our models stop on `"\n\nHuman:"`, and may include additional built-in stop
* sequences in the future. By providing the stop_sequences parameter, you may
* include additional strings that will cause the model to stop generating.
*/
stop_sequences?: Array<string>;
/**
* Whether to incrementally stream the response using server-sent events.
*
* See [streaming](https://docs.anthropic.com/en/api/streaming) for details.
*/
stream?: boolean;
/**
* 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;
/**
* 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 declare namespace CompletionCreateParams {
/**
* @deprecated use `Anthropic.Messages.Metadata` instead
*/
type Metadata = MessagesAPI.Metadata;
type CompletionCreateParamsNonStreaming = CompletionsAPI.CompletionCreateParamsNonStreaming;
type CompletionCreateParamsStreaming = CompletionsAPI.CompletionCreateParamsStreaming;
}
export interface CompletionCreateParamsNonStreaming extends CompletionCreateParamsBase {
/**
* Whether to incrementally stream the response using server-sent events.
*
* See [streaming](https://docs.anthropic.com/en/api/streaming) for details.
*/
stream?: false;
}
export interface CompletionCreateParamsStreaming extends CompletionCreateParamsBase {
/**
* Whether to incrementally stream the response using server-sent events.
*
* See [streaming](https://docs.anthropic.com/en/api/streaming) for details.
*/
stream: true;
}
export declare namespace Completions {
export { type Completion as Completion, type CompletionCreateParams as CompletionCreateParams, type CompletionCreateParamsNonStreaming as CompletionCreateParamsNonStreaming, type CompletionCreateParamsStreaming as CompletionCreateParamsStreaming, };
}
//# sourceMappingURL=completions.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"completions.d.ts","sourceRoot":"","sources":["../src/resources/completions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAChC,OAAO,KAAK,cAAc,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,WAAW,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAI,EAAE,kCAAkC,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC;IACvG,MAAM,CACJ,IAAI,EAAE,+BAA+B,EACrC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACjC,MAAM,CACJ,IAAI,EAAE,0BAA0B,EAChC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC;CAY/C;AAED,MAAM,WAAW,UAAU;IACzB;;;;OAIG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC;IAEzB;;;;;;;;OAQG;IACH,WAAW,EAAE,MAAM,GAA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KAAK,+BAA+B,IAAI,+BAA+B,GACxE,CAAC;CACH"}

17
vendor/sdk/resources/completions.js vendored Normal file
View File

@@ -0,0 +1,17 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Completions = void 0;
const resource_1 = require("../resource.js");
class Completions extends resource_1.APIResource {
create(body, options) {
return this._client.post('/v1/complete', {
body,
timeout: this._client._options.timeout ?? 600000,
...options,
stream: body.stream ?? false,
});
}
}
exports.Completions = Completions;
//# sourceMappingURL=completions.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"completions.js","sourceRoot":"","sources":["../src/resources/completions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAO1C,MAAa,WAAY,SAAQ,sBAAW;IAoB1C,MAAM,CACJ,IAA4B,EAC5B,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE;YACvC,IAAI;YACJ,OAAO,EAAG,IAAI,CAAC,OAAe,CAAC,QAAQ,CAAC,OAAO,IAAI,MAAM;YACzD,GAAG,OAAO;YACV,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,KAAK;SAC7B,CAA4D,CAAC;IAChE,CAAC;CACF;AA/BD,kCA+BC"}

13
vendor/sdk/resources/completions.mjs vendored Normal file
View File

@@ -0,0 +1,13 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../resource.mjs";
export class Completions extends APIResource {
create(body, options) {
return this._client.post('/v1/complete', {
body,
timeout: this._client._options.timeout ?? 600000,
...options,
stream: body.stream ?? false,
});
}
}
//# sourceMappingURL=completions.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"completions.mjs","sourceRoot":"","sources":["../src/resources/completions.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAOtB,MAAM,OAAO,WAAY,SAAQ,WAAW;IAoB1C,MAAM,CACJ,IAA4B,EAC5B,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE;YACvC,IAAI;YACJ,OAAO,EAAG,IAAI,CAAC,OAAe,CAAC,QAAQ,CAAC,OAAO,IAAI,MAAM;YACzD,GAAG,OAAO;YACV,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,KAAK;SAC7B,CAA4D,CAAC;IAChE,CAAC;CACF"}

6
vendor/sdk/resources/index.d.ts vendored Normal file
View File

@@ -0,0 +1,6 @@
export * from "./shared.js";
export { Beta, type AnthropicBeta, type BetaAPIError, type BetaAuthenticationError, type BetaBillingError, type BetaError, type BetaErrorResponse, type BetaGatewayTimeoutError, type BetaInvalidRequestError, type BetaNotFoundError, type BetaOverloadedError, type BetaPermissionError, type BetaRateLimitError, } from "./beta/beta.js";
export { Completions, type Completion, type CompletionCreateParams, type CompletionCreateParamsNonStreaming, type CompletionCreateParamsStreaming, } from "./completions.js";
export { Messages, type Base64PDFSource, type CacheControlEphemeral, type CitationCharLocation, type CitationCharLocationParam, type CitationContentBlockLocation, type CitationContentBlockLocationParam, type CitationPageLocation, type CitationPageLocationParam, type CitationsConfigParam, type CitationsDelta, type ContentBlock, type ContentBlockDeltaEvent, type ContentBlockParam, type ContentBlockSource, type ContentBlockSourceContent, type ContentBlockStartEvent, type ContentBlockStopEvent, type DocumentBlockParam, type ImageBlockParam, type InputJsonDelta, type InputJSONDelta, type Message, type MessageDeltaEvent, type MessageDeltaUsage, type MessageParam, type MessageStartEvent, type MessageStopEvent, type MessageStreamEvent, type MessageStreamParams, type MessageTokensCount, type Metadata, type Model, type PlainTextSource, type RawContentBlockDeltaEvent, type RawContentBlockStartEvent, type RawContentBlockStopEvent, type RawMessageDeltaEvent, type RawMessageStartEvent, type RawMessageStopEvent, type RawMessageStreamEvent, type RedactedThinkingBlock, type RedactedThinkingBlockParam, type SignatureDelta, type TextBlock, type TextBlockParam, type TextCitation, type TextCitationParam, type TextDelta, type ThinkingBlock, type ThinkingBlockParam, type ThinkingConfigDisabled, type ThinkingConfigEnabled, type ThinkingDelta, type Tool, type ToolChoice, type ToolChoiceAny, type ToolChoiceAuto, type ToolChoiceTool, type ToolResultBlockParam, type ToolUseBlock, type ToolUseBlockParam, type Usage, type MessageCreateParams, type MessageCreateParamsNonStreaming, type MessageCreateParamsStreaming, type MessageCountTokensParams, } from "./messages/messages.js";
export { ModelInfosPage, Models, type ModelInfo, type ModelListParams } from "./models.js";
//# sourceMappingURL=index.d.ts.map

1
vendor/sdk/resources/index.d.ts.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAEA,cAAc,UAAU,CAAC;AACzB,OAAO,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,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,WAAW,EACX,KAAK,UAAU,EACf,KAAK,sBAAsB,EAC3B,KAAK,kCAAkC,EACvC,KAAK,+BAA+B,GACrC,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,QAAQ,EACR,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,4BAA4B,EACjC,KAAK,iCAAiC,EACtC,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,QAAQ,EACb,KAAK,KAAK,EACV,KAAK,eAAe,EACpB,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAClB,KAAK,IAAI,EACT,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,KAAK,EACV,KAAK,mBAAmB,EACxB,KAAK,+BAA+B,EACpC,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,GAC9B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC"}

29
vendor/sdk/resources/index.js vendored Normal file
View File

@@ -0,0 +1,29 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Models = exports.ModelInfosPage = exports.Messages = exports.Completions = exports.Beta = void 0;
__exportStar(require("./shared.js"), exports);
var beta_1 = require("./beta/beta.js");
Object.defineProperty(exports, "Beta", { enumerable: true, get: function () { return beta_1.Beta; } });
var completions_1 = require("./completions.js");
Object.defineProperty(exports, "Completions", { enumerable: true, get: function () { return completions_1.Completions; } });
var messages_1 = require("./messages/messages.js");
Object.defineProperty(exports, "Messages", { enumerable: true, get: function () { return messages_1.Messages; } });
var models_1 = require("./models.js");
Object.defineProperty(exports, "ModelInfosPage", { enumerable: true, get: function () { return models_1.ModelInfosPage; } });
Object.defineProperty(exports, "Models", { enumerable: true, get: function () { return models_1.Models; } });
//# sourceMappingURL=index.js.map

1
vendor/sdk/resources/index.js.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;AAEtF,8CAAyB;AACzB,uCAcqB;AAbnB,4FAAA,IAAI,OAAA;AAcN,gDAMuB;AALrB,0GAAA,WAAW,OAAA;AAMb,mDAoE6B;AAnE3B,oGAAA,QAAQ,OAAA;AAoEV,sCAAwF;AAA/E,wGAAA,cAAc,OAAA;AAAE,gGAAA,MAAM,OAAA"}

7
vendor/sdk/resources/index.mjs vendored Normal file
View File

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

1
vendor/sdk/resources/index.mjs.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;;OAG/E,EACL,IAAI,GAaL;OACM,EACL,WAAW,GAKZ;OACM,EACL,QAAQ,GAmET;OACM,EAAE,cAAc,EAAE,MAAM,EAAwC"}

View File

@@ -0,0 +1,253 @@
import { APIResource } from "../../resource.js";
import * as Core from "../../core.js";
import * as Shared from "../shared.js";
import * as MessagesAPI from "./messages.js";
import { Page, type PageParams } from "../../pagination.js";
import { JSONLDecoder } from "../../internal/decoders/jsonl.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](/en/docs/build-with-claude/batch-processing)
*/
create(body: BatchCreateParams, options?: Core.RequestOptions): Core.APIPromise<MessageBatch>;
/**
* 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](/en/docs/build-with-claude/batch-processing)
*/
retrieve(messageBatchId: string, options?: Core.RequestOptions): Core.APIPromise<MessageBatch>;
/**
* 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](/en/docs/build-with-claude/batch-processing)
*/
list(query?: BatchListParams, options?: Core.RequestOptions): Core.PagePromise<MessageBatchesPage, MessageBatch>;
list(options?: Core.RequestOptions): Core.PagePromise<MessageBatchesPage, MessageBatch>;
/**
* 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](/en/docs/build-with-claude/batch-processing)
*/
delete(messageBatchId: string, options?: Core.RequestOptions): Core.APIPromise<DeletedMessageBatch>;
/**
* 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](/en/docs/build-with-claude/batch-processing)
*/
cancel(messageBatchId: string, options?: Core.RequestOptions): Core.APIPromise<MessageBatch>;
/**
* 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](/en/docs/build-with-claude/batch-processing)
*/
results(messageBatchId: string, options?: Core.RequestOptions): Promise<JSONLDecoder<MessageBatchIndividualResponse>>;
}
export declare class MessageBatchesPage extends Page<MessageBatch> {
}
export interface DeletedMessageBatch {
/**
* 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 MessageBatch {
/**
* 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: MessageBatchRequestCounts;
/**
* 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 MessageBatchCanceledResult {
type: 'canceled';
}
export interface MessageBatchErroredResult {
error: Shared.ErrorResponse;
type: 'errored';
}
export interface MessageBatchExpiredResult {
type: 'expired';
}
/**
* This is a single line in the response `.jsonl` file and does not represent the
* response as a whole.
*/
export interface MessageBatchIndividualResponse {
/**
* 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: MessageBatchResult;
}
export interface MessageBatchRequestCounts {
/**
* 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 MessageBatchResult = MessageBatchSucceededResult | MessageBatchErroredResult | MessageBatchCanceledResult | MessageBatchExpiredResult;
export interface MessageBatchSucceededResult {
message: MessagesAPI.Message;
type: 'succeeded';
}
export interface BatchCreateParams {
/**
* List of requests for prompt completion. Each is an individual request to create
* a Message.
*/
requests: Array<BatchCreateParams.Request>;
}
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](/en/api/messages) for full documentation on
* available parameters.
*/
params: MessagesAPI.MessageCreateParamsNonStreaming;
}
}
export interface BatchListParams extends PageParams {
}
export declare namespace Batches {
export { type DeletedMessageBatch as DeletedMessageBatch, type MessageBatch as MessageBatch, type MessageBatchCanceledResult as MessageBatchCanceledResult, type MessageBatchErroredResult as MessageBatchErroredResult, type MessageBatchExpiredResult as MessageBatchExpiredResult, type MessageBatchIndividualResponse as MessageBatchIndividualResponse, type MessageBatchRequestCounts as MessageBatchRequestCounts, type MessageBatchResult as MessageBatchResult, type MessageBatchSucceededResult as MessageBatchSucceededResult, MessageBatchesPage as MessageBatchesPage, type BatchCreateParams as BatchCreateParams, type BatchListParams as BatchListParams, };
}
//# sourceMappingURL=batches.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"batches.d.ts","sourceRoot":"","sources":["../../src/resources/messages/batches.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,WAAW,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CA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2B,GAC3B,yBAAyB,GACzB,0BAA0B,GAC1B,yBAAyB,CAAC;AAE9B,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC;IAE7B,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,QAAQ,EAAE,KAAK,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;CAC5C;AAED,yBAAiB,iBAAiB,CAAC;IACjC,UAAiB,OAAO;QACtB;;;;;WAKG;QACH,SAAS,EAAE,MAAM,CAAC;QAElB;;;;;WAKG;QACH,MAAM,EAAE,WAAW,CAAC,+BAA+B,CAAC;KACrD;CACF;AAED,MAAM,WAAW,eAAgB,SAAQ,UAAU;CAAG;AAItD,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,kBAAkB,IAAI,kBAAkB,EACxC,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,eAAe,IAAI,eAAe,GACxC,CAAC;CACH"}

102
vendor/sdk/resources/messages/batches.js vendored Normal file
View File

@@ -0,0 +1,102 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.MessageBatchesPage = exports.Batches = void 0;
const resource_1 = require("../../resource.js");
const core_1 = require("../../core.js");
const pagination_1 = require("../../pagination.js");
const jsonl_1 = require("../../internal/decoders/jsonl.js");
const error_1 = require("../../error.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](/en/docs/build-with-claude/batch-processing)
*/
create(body, options) {
return this._client.post('/v1/messages/batches', { body, ...options });
}
/**
* 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](/en/docs/build-with-claude/batch-processing)
*/
retrieve(messageBatchId, options) {
return this._client.get(`/v1/messages/batches/${messageBatchId}`, options);
}
list(query = {}, options) {
if ((0, core_1.isRequestOptions)(query)) {
return this.list({}, query);
}
return this._client.getAPIList('/v1/messages/batches', MessageBatchesPage, { query, ...options });
}
/**
* 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](/en/docs/build-with-claude/batch-processing)
*/
delete(messageBatchId, options) {
return this._client.delete(`/v1/messages/batches/${messageBatchId}`, options);
}
/**
* 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](/en/docs/build-with-claude/batch-processing)
*/
cancel(messageBatchId, options) {
return this._client.post(`/v1/messages/batches/${messageBatchId}/cancel`, options);
}
/**
* 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](/en/docs/build-with-claude/batch-processing)
*/
async results(messageBatchId, 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}`);
}
return this._client
.get(batch.results_url, {
...options,
headers: {
Accept: 'application/binary',
...options?.headers,
},
__binaryResponse: true,
})
._thenUnwrap((_, props) => jsonl_1.JSONLDecoder.fromResponse(props.response, props.controller));
}
}
exports.Batches = Batches;
class MessageBatchesPage extends pagination_1.Page {
}
exports.MessageBatchesPage = MessageBatchesPage;
Batches.MessageBatchesPage = MessageBatchesPage;
//# sourceMappingURL=batches.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"batches.js","sourceRoot":"","sources":["../../src/resources/messages/batches.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA6C;AAC7C,wCAA8C;AAI9C,oDAAyD;AACzD,4DAA6D;AAC7D,0CAA6C;AAE7C,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAuB,EAAE,OAA6B;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;;;;;;OAOG;IACH,QAAQ,CAAC,cAAsB,EAAE,OAA6B;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,cAAc,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7E,CAAC;IAcD,IAAI,CACF,QAA+C,EAAE,EACjD,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,sBAAsB,EAAE,kBAAkB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpG,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,cAAsB,EAAE,OAA6B;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,wBAAwB,cAAc,EAAE,EAAE,OAAO,CAAC,CAAC;IAChF,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,cAAsB,EAAE,OAA6B;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,wBAAwB,cAAc,SAAS,EAAE,OAAO,CAAC,CAAC;IACrF,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,OAAO,CACX,cAAsB,EACtB,OAA6B;QAE7B,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;QAClD,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;YACtB,MAAM,IAAI,sBAAc,CACtB,yDAAyD,KAAK,CAAC,iBAAiB,MAAM,KAAK,CAAC,EAAE,EAAE,CACjG,CAAC;SACH;QAED,OAAO,IAAI,CAAC,OAAO;aAChB,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE;YACtB,GAAG,OAAO;YACV,OAAO,EAAE;gBACP,MAAM,EAAE,oBAAoB;gBAC5B,GAAG,OAAO,EAAE,OAAO;aACpB;YACD,gBAAgB,EAAE,IAAI;SACvB,CAAC;aACD,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,oBAAY,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IAC5F,CAAC;CACF;AAhHD,0BAgHC;AAED,MAAa,kBAAmB,SAAQ,iBAAkB;CAAG;AAA7D,gDAA6D;AAiN7D,OAAO,CAAC,kBAAkB,GAAG,kBAAkB,CAAC"}

View File

@@ -0,0 +1,97 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../resource.mjs";
import { isRequestOptions } from "../../core.mjs";
import { Page } from "../../pagination.mjs";
import { JSONLDecoder } from "../../internal/decoders/jsonl.mjs";
import { AnthropicError } from "../../error.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](/en/docs/build-with-claude/batch-processing)
*/
create(body, options) {
return this._client.post('/v1/messages/batches', { body, ...options });
}
/**
* 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](/en/docs/build-with-claude/batch-processing)
*/
retrieve(messageBatchId, options) {
return this._client.get(`/v1/messages/batches/${messageBatchId}`, options);
}
list(query = {}, options) {
if (isRequestOptions(query)) {
return this.list({}, query);
}
return this._client.getAPIList('/v1/messages/batches', MessageBatchesPage, { query, ...options });
}
/**
* 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](/en/docs/build-with-claude/batch-processing)
*/
delete(messageBatchId, options) {
return this._client.delete(`/v1/messages/batches/${messageBatchId}`, options);
}
/**
* 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](/en/docs/build-with-claude/batch-processing)
*/
cancel(messageBatchId, options) {
return this._client.post(`/v1/messages/batches/${messageBatchId}/cancel`, options);
}
/**
* 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](/en/docs/build-with-claude/batch-processing)
*/
async results(messageBatchId, 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}`);
}
return this._client
.get(batch.results_url, {
...options,
headers: {
Accept: 'application/binary',
...options?.headers,
},
__binaryResponse: true,
})
._thenUnwrap((_, props) => JSONLDecoder.fromResponse(props.response, props.controller));
}
}
export class MessageBatchesPage extends Page {
}
Batches.MessageBatchesPage = MessageBatchesPage;
//# sourceMappingURL=batches.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"batches.mjs","sourceRoot":"","sources":["../../src/resources/messages/batches.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAIpB,EAAE,IAAI,EAAmB;OACzB,EAAE,YAAY,EAAE;OAChB,EAAE,cAAc,EAAE;AAEzB,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAuB,EAAE,OAA6B;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;;;;;;OAOG;IACH,QAAQ,CAAC,cAAsB,EAAE,OAA6B;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,cAAc,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7E,CAAC;IAcD,IAAI,CACF,QAA+C,EAAE,EACjD,OAA6B;QAE7B,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,sBAAsB,EAAE,kBAAkB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpG,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,cAAsB,EAAE,OAA6B;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,wBAAwB,cAAc,EAAE,EAAE,OAAO,CAAC,CAAC;IAChF,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,cAAsB,EAAE,OAA6B;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,wBAAwB,cAAc,SAAS,EAAE,OAAO,CAAC,CAAC;IACrF,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,OAAO,CACX,cAAsB,EACtB,OAA6B;QAE7B,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;QAClD,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;YACtB,MAAM,IAAI,cAAc,CACtB,yDAAyD,KAAK,CAAC,iBAAiB,MAAM,KAAK,CAAC,EAAE,EAAE,CACjG,CAAC;SACH;QAED,OAAO,IAAI,CAAC,OAAO;aAChB,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE;YACtB,GAAG,OAAO;YACV,OAAO,EAAE;gBACP,MAAM,EAAE,oBAAoB;gBAC5B,GAAG,OAAO,EAAE,OAAO;aACpB;YACD,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,CAAC,CAAC;IAC5F,CAAC;CACF;AAED,MAAM,OAAO,kBAAmB,SAAQ,IAAkB;CAAG;AAiN7D,OAAO,CAAC,kBAAkB,GAAG,kBAAkB,CAAC"}

View File

@@ -0,0 +1,3 @@
export { MessageBatchesPage, Batches, type DeletedMessageBatch, type MessageBatch, type MessageBatchCanceledResult, type MessageBatchErroredResult, type MessageBatchExpiredResult, type MessageBatchIndividualResponse, type MessageBatchRequestCounts, type MessageBatchResult, type MessageBatchSucceededResult, type BatchCreateParams, type BatchListParams, } from "./batches.js";
export { Messages, type Base64PDFSource, type CacheControlEphemeral, type CitationCharLocation, type CitationCharLocationParam, type CitationContentBlockLocation, type CitationContentBlockLocationParam, type CitationPageLocation, type CitationPageLocationParam, type CitationsConfigParam, type CitationsDelta, type ContentBlock, type ContentBlockDeltaEvent, type ContentBlockParam, type ContentBlockSource, type ContentBlockSourceContent, type ContentBlockStartEvent, type ContentBlockStopEvent, type DocumentBlockParam, type ImageBlockParam, type InputJSONDelta, type Message, type MessageDeltaEvent, type MessageDeltaUsage, type MessageParam, type MessageStartEvent, type MessageStopEvent, type MessageStreamEvent, type MessageTokensCount, type Metadata, type Model, type PlainTextSource, type RawContentBlockDeltaEvent, type RawContentBlockStartEvent, type RawContentBlockStopEvent, type RawMessageDeltaEvent, type RawMessageStartEvent, type RawMessageStopEvent, type RawMessageStreamEvent, type RedactedThinkingBlock, type RedactedThinkingBlockParam, type SignatureDelta, type TextBlock, type TextBlockParam, type TextCitation, type TextCitationParam, type TextDelta, type ThinkingBlock, type ThinkingBlockParam, type ThinkingConfigDisabled, type ThinkingConfigEnabled, type ThinkingDelta, type Tool, type ToolChoice, type ToolChoiceAny, type ToolChoiceAuto, type ToolChoiceTool, type ToolResultBlockParam, type ToolUseBlock, type ToolUseBlockParam, type Usage, type MessageCreateParams, type MessageCreateParamsBase, type MessageCreateParamsNonStreaming, type MessageCreateParamsStreaming, type MessageCountTokensParams, } from "./messages.js";
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/messages/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,kBAAkB,EAClB,OAAO,EACP,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,K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ClB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,KAAK,EACV,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,+BAA+B,EACpC,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,GAC9B,MAAM,YAAY,CAAC"}

10
vendor/sdk/resources/messages/index.js vendored Normal file
View File

@@ -0,0 +1,10 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Messages = exports.Batches = exports.MessageBatchesPage = void 0;
var batches_1 = require("./batches.js");
Object.defineProperty(exports, "MessageBatchesPage", { enumerable: true, get: function () { return batches_1.MessageBatchesPage; } });
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; } });
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/messages/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wCAcmB;AAbjB,6GAAA,kBAAkB,OAAA;AAClB,kGAAA,OAAO,OAAA;AAaT,0CAmEoB;AAlElB,oGAAA,QAAQ,OAAA"}

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/messages/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,kBAAkB,EAClB,OAAO,GAYR;OACM,EACL,QAAQ,GAkET"}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,82 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Messages = exports.MessageStream = void 0;
const resource_1 = require("../../resource.js");
const BatchesAPI = __importStar(require("./batches.js"));
const batches_1 = require("./batches.js");
const MessageStream_1 = require("../../lib/MessageStream.js");
var MessageStream_2 = require("../../lib/MessageStream.js");
Object.defineProperty(exports, "MessageStream", { enumerable: true, get: function () { return MessageStream_2.MessageStream; } });
class Messages extends resource_1.APIResource {
constructor() {
super(...arguments);
this.batches = new BatchesAPI.Batches(this._client);
}
create(body, options) {
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.`);
}
return this._client.post('/v1/messages', {
body,
timeout: this._client._options.timeout ?? 600000,
...options,
stream: body.stream ?? false,
});
}
/**
* Create a Message stream
*/
stream(body, options) {
return MessageStream_1.MessageStream.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](/en/docs/build-with-claude/token-counting)
*/
countTokens(body, options) {
return this._client.post('/v1/messages/count_tokens', { body, ...options });
}
}
exports.Messages = Messages;
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-2.1': 'July 21st, 2025',
'claude-2.0': 'July 21st, 2025',
};
Messages.Batches = batches_1.Batches;
Messages.MessageBatchesPage = batches_1.MessageBatchesPage;
//# sourceMappingURL=messages.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/resources/messages/messages.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtF,gDAA6C;AAI7C,yDAAwC;AACxC,0CAcmB;AAEnB,8DAAwD;AAExD,4DAAwD;AAA/C,8GAAA,aAAa,OAAA;AAEtB,MAAa,QAAS,SAAQ,sBAAW;IAAzC;;QACE,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA6DrE,CAAC;IAzCC,MAAM,CACJ,IAAyB,EACzB,OAA6B;QAE7B,IAAI,IAAI,CAAC,KAAK,IAAI,iBAAiB,EAAE;YACnC,OAAO,CAAC,IAAI,CACV,cAAc,IAAI,CAAC,KAAK,iDACtB,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAC9B,gIAAgI,CACjI,CAAC;SACH;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE;YACvC,IAAI;YACJ,OAAO,EAAG,IAAI,CAAC,OAAe,CAAC,QAAQ,CAAC,OAAO,IAAI,MAAM;YACzD,GAAG,OAAO;YACV,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,KAAK;SAC7B,CAAoE,CAAC;IACxE,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,IAAyB,EAAE,OAA6B;QAC7D,OAAO,6BAAa,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;;;OAQG;IACH,WAAW,CACT,IAA8B,EAC9B,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC;CACF;AA9DD,4BA8DC;AAoVD,MAAM,iBAAiB,GAEnB;IACF,YAAY,EAAE,oBAAoB;IAClC,iBAAiB,EAAE,oBAAoB;IACvC,oBAAoB,EAAE,oBAAoB;IAC1C,yBAAyB,EAAE,oBAAoB;IAC/C,oBAAoB,EAAE,oBAAoB;IAC1C,0BAA0B,EAAE,iBAAiB;IAC7C,YAAY,EAAE,iBAAiB;IAC/B,YAAY,EAAE,iBAAiB;CAChC,CAAC;AAm3BF,QAAQ,CAAC,OAAO,GAAG,iBAAO,CAAC;AAC3B,QAAQ,CAAC,kBAAkB,GAAG,4BAAkB,CAAC"}

View File

@@ -0,0 +1,54 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../resource.mjs";
import * as BatchesAPI from "./batches.mjs";
import { Batches, MessageBatchesPage, } from "./batches.mjs";
import { MessageStream } from "../../lib/MessageStream.mjs";
export { MessageStream } from "../../lib/MessageStream.mjs";
export class Messages extends APIResource {
constructor() {
super(...arguments);
this.batches = new BatchesAPI.Batches(this._client);
}
create(body, options) {
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.`);
}
return this._client.post('/v1/messages', {
body,
timeout: this._client._options.timeout ?? 600000,
...options,
stream: body.stream ?? false,
});
}
/**
* Create a Message stream
*/
stream(body, options) {
return MessageStream.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](/en/docs/build-with-claude/token-counting)
*/
countTokens(body, options) {
return this._client.post('/v1/messages/count_tokens', { body, ...options });
}
}
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-2.1': 'July 21st, 2025',
'claude-2.0': 'July 21st, 2025',
};
Messages.Batches = Batches;
Messages.MessageBatchesPage = MessageBatchesPage;
//# sourceMappingURL=messages.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"messages.mjs","sourceRoot":"","sources":["../../src/resources/messages/messages.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAIf,KAAK,UAAU;OACf,EAGL,OAAO,EAUP,kBAAkB,GACnB;OAEM,EAAE,aAAa,EAAE;OAEjB,EAAE,aAAa,EAAE;AAExB,MAAM,OAAO,QAAS,SAAQ,WAAW;IAAzC;;QACE,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA6DrE,CAAC;IAzCC,MAAM,CACJ,IAAyB,EACzB,OAA6B;QAE7B,IAAI,IAAI,CAAC,KAAK,IAAI,iBAAiB,EAAE;YACnC,OAAO,CAAC,IAAI,CACV,cAAc,IAAI,CAAC,KAAK,iDACtB,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAC9B,gIAAgI,CACjI,CAAC;SACH;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE;YACvC,IAAI;YACJ,OAAO,EAAG,IAAI,CAAC,OAAe,CAAC,QAAQ,CAAC,OAAO,IAAI,MAAM;YACzD,GAAG,OAAO;YACV,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,KAAK;SAC7B,CAAoE,CAAC;IACxE,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,IAAyB,EAAE,OAA6B;QAC7D,OAAO,aAAa,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;;;OAQG;IACH,WAAW,CACT,IAA8B,EAC9B,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC;CACF;AAoVD,MAAM,iBAAiB,GAEnB;IACF,YAAY,EAAE,oBAAoB;IAClC,iBAAiB,EAAE,oBAAoB;IACvC,oBAAoB,EAAE,oBAAoB;IAC1C,yBAAyB,EAAE,oBAAoB;IAC/C,oBAAoB,EAAE,oBAAoB;IAC1C,0BAA0B,EAAE,iBAAiB;IAC7C,YAAY,EAAE,iBAAiB;IAC/B,YAAY,EAAE,iBAAiB;CAChC,CAAC;AAm3BF,QAAQ,CAAC,OAAO,GAAG,OAAO,CAAC;AAC3B,QAAQ,CAAC,kBAAkB,GAAG,kBAAkB,CAAC"}

49
vendor/sdk/resources/models.d.ts vendored Normal file
View File

@@ -0,0 +1,49 @@
import { APIResource } from "../resource.js";
import * as Core from "../core.js";
import { Page, type PageParams } from "../pagination.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.
*/
retrieve(modelId: string, options?: Core.RequestOptions): Core.APIPromise<ModelInfo>;
/**
* 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.
*/
list(query?: ModelListParams, options?: Core.RequestOptions): Core.PagePromise<ModelInfosPage, ModelInfo>;
list(options?: Core.RequestOptions): Core.PagePromise<ModelInfosPage, ModelInfo>;
}
export declare class ModelInfosPage extends Page<ModelInfo> {
}
export interface ModelInfo {
/**
* Unique model identifier.
*/
id: string;
/**
* 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;
/**
* Object type.
*
* For Models, this is always `"model"`.
*/
type: 'model';
}
export interface ModelListParams extends PageParams {
}
export declare namespace Models {
export { type ModelInfo as ModelInfo, ModelInfosPage as ModelInfosPage, type ModelListParams as ModelListParams, };
}
//# sourceMappingURL=models.d.ts.map

1
vendor/sdk/resources/models.d.ts.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../src/resources/models.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAEtD,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC;IAIpF;;;;;OAKG;IACH,IAAI,CAAC,KAAK,CAAC,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,WAAW,CAAC,cAAc,EAAE,SAAS,CAAC;IACzG,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,WAAW,CAAC,cAAc,EAAE,SAAS,CAAC;CAUjF;AAED,qBAAa,cAAe,SAAQ,IAAI,CAAC,SAAS,CAAC;CAAG;AAEtD,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;;;OAIG;IACH,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,eAAgB,SAAQ,UAAU;CAAG;AAItD,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,SAAS,IAAI,SAAS,EAC3B,cAAc,IAAI,cAAc,EAChC,KAAK,eAAe,IAAI,eAAe,GACxC,CAAC;CACH"}

30
vendor/sdk/resources/models.js vendored Normal file
View File

@@ -0,0 +1,30 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.ModelInfosPage = exports.Models = void 0;
const resource_1 = require("../resource.js");
const core_1 = require("../core.js");
const pagination_1 = require("../pagination.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.
*/
retrieve(modelId, options) {
return this._client.get(`/v1/models/${modelId}`, options);
}
list(query = {}, options) {
if ((0, core_1.isRequestOptions)(query)) {
return this.list({}, query);
}
return this._client.getAPIList('/v1/models', ModelInfosPage, { query, ...options });
}
}
exports.Models = Models;
class ModelInfosPage extends pagination_1.Page {
}
exports.ModelInfosPage = ModelInfosPage;
Models.ModelInfosPage = ModelInfosPage;
//# sourceMappingURL=models.js.map

1
vendor/sdk/resources/models.js.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"models.js","sourceRoot":"","sources":["../src/resources/models.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAC1C,qCAA2C;AAE3C,iDAAsD;AAEtD,MAAa,MAAO,SAAQ,sBAAW;IACrC;;;;;OAKG;IACH,QAAQ,CAAC,OAAe,EAAE,OAA6B;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;IAUD,IAAI,CACF,QAA+C,EAAE,EACjD,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,EAAE,cAAc,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtF,CAAC;CACF;AA5BD,wBA4BC;AAED,MAAa,cAAe,SAAQ,iBAAe;CAAG;AAAtD,wCAAsD;AA6BtD,MAAM,CAAC,cAAc,GAAG,cAAc,CAAC"}

25
vendor/sdk/resources/models.mjs vendored Normal file
View File

@@ -0,0 +1,25 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../resource.mjs";
import { isRequestOptions } from "../core.mjs";
import { Page } from "../pagination.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.
*/
retrieve(modelId, options) {
return this._client.get(`/v1/models/${modelId}`, options);
}
list(query = {}, options) {
if (isRequestOptions(query)) {
return this.list({}, query);
}
return this._client.getAPIList('/v1/models', ModelInfosPage, { query, ...options });
}
}
export class ModelInfosPage extends Page {
}
Models.ModelInfosPage = ModelInfosPage;
//# sourceMappingURL=models.mjs.map

1
vendor/sdk/resources/models.mjs.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"models.mjs","sourceRoot":"","sources":["../src/resources/models.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAEpB,EAAE,IAAI,EAAmB;AAEhC,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;;;;OAKG;IACH,QAAQ,CAAC,OAAe,EAAE,OAA6B;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;IAUD,IAAI,CACF,QAA+C,EAAE,EACjD,OAA6B;QAE7B,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,EAAE,cAAc,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtF,CAAC;CACF;AAED,MAAM,OAAO,cAAe,SAAQ,IAAe;CAAG;AA6BtD,MAAM,CAAC,cAAc,GAAG,cAAc,CAAC"}

42
vendor/sdk/resources/shared.d.ts vendored Normal file
View File

@@ -0,0 +1,42 @@
export interface APIErrorObject {
message: string;
type: 'api_error';
}
export interface AuthenticationError {
message: string;
type: 'authentication_error';
}
export interface BillingError {
message: string;
type: 'billing_error';
}
export type ErrorObject = InvalidRequestError | AuthenticationError | BillingError | PermissionError | NotFoundError | RateLimitError | GatewayTimeoutError | APIErrorObject | OverloadedError;
export interface ErrorResponse {
error: ErrorObject;
type: 'error';
}
export interface GatewayTimeoutError {
message: string;
type: 'timeout_error';
}
export interface InvalidRequestError {
message: string;
type: 'invalid_request_error';
}
export interface NotFoundError {
message: string;
type: 'not_found_error';
}
export interface OverloadedError {
message: string;
type: 'overloaded_error';
}
export interface PermissionError {
message: string;
type: 'permission_error';
}
export interface RateLimitError {
message: string;
type: 'rate_limit_error';
}
//# sourceMappingURL=shared.d.ts.map

1
vendor/sdk/resources/shared.d.ts.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/resources/shared.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAEhB,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAEhB,IAAI,EAAE,sBAAsB,CAAC;CAC9B;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAEhB,IAAI,EAAE,eAAe,CAAC;CACvB;AAED,MAAM,MAAM,WAAW,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,YAAY,GACZ,eAAe,GACf,aAAa,GACb,cAAc,GACd,mBAAmB,GACnB,cAAc,GACd,eAAe,CAAC;AAEpB,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,WAAW,CAAC;IAEnB,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAEhB,IAAI,EAAE,eAAe,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAEhB,IAAI,EAAE,uBAAuB,CAAC;CAC/B;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAEhB,IAAI,EAAE,iBAAiB,CAAC;CACzB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAEhB,IAAI,EAAE,kBAAkB,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAEhB,IAAI,EAAE,kBAAkB,CAAC;CAC1B;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAEhB,IAAI,EAAE,kBAAkB,CAAC;CAC1B"}

4
vendor/sdk/resources/shared.js vendored Normal file
View File

@@ -0,0 +1,4 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=shared.js.map

1
vendor/sdk/resources/shared.js.map vendored Normal file
View File

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

3
vendor/sdk/resources/shared.mjs vendored Normal file
View File

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

1
vendor/sdk/resources/shared.mjs.map vendored Normal file
View File

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

2
vendor/sdk/resources/top-level.d.ts vendored Normal file
View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=top-level.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"top-level.d.ts","sourceRoot":"","sources":["../src/resources/top-level.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC"}

4
vendor/sdk/resources/top-level.js vendored Normal file
View File

@@ -0,0 +1,4 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=top-level.js.map

1
vendor/sdk/resources/top-level.js.map vendored Normal file
View File

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

3
vendor/sdk/resources/top-level.mjs vendored Normal file
View File

@@ -0,0 +1,3 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
export {};
//# sourceMappingURL=top-level.mjs.map

View File

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