Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@anthropic-ai/sdk

Package Overview
Dependencies
Maintainers
8
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@anthropic-ai/sdk - npm Package Compare versions

Comparing version 0.31.0 to 0.32.0

6

core.d.ts

@@ -156,4 +156,4 @@

getNextPage(): Promise<this>;
iterPages(): AsyncGenerator<AbstractPage<Item>, void, unknown>;
[Symbol.asyncIterator](): AsyncGenerator<Awaited<Item>, void, unknown>;
iterPages(): AsyncGenerator<this>;
[Symbol.asyncIterator](): AsyncGenerator<Item>;
}

@@ -178,3 +178,3 @@ /**

*/
[Symbol.asyncIterator](): AsyncGenerator<Awaited<Item>, void, unknown>;
[Symbol.asyncIterator](): AsyncGenerator<Item>;
}

@@ -181,0 +181,0 @@ export declare const createResponseHeaders: (headers: Awaited<ReturnType<Fetch>>['headers']) => Record<string, string>;

@@ -127,15 +127,3 @@ import { type Agent } from "./_shims/index.js";

export declare const HUMAN_PROMPT: string, AI_PROMPT: string;
export declare const AnthropicError: typeof Errors.AnthropicError;
export declare const APIError: typeof Errors.APIError;
export declare const APIConnectionError: typeof Errors.APIConnectionError;
export declare const APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError;
export declare const APIUserAbortError: typeof Errors.APIUserAbortError;
export declare const NotFoundError: typeof Errors.NotFoundError;
export declare const ConflictError: typeof Errors.ConflictError;
export declare const RateLimitError: typeof Errors.RateLimitError;
export declare const BadRequestError: typeof Errors.BadRequestError;
export declare const AuthenticationError: typeof Errors.AuthenticationError;
export declare const InternalServerError: typeof Errors.InternalServerError;
export declare const PermissionDeniedError: typeof Errors.PermissionDeniedError;
export declare const UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
export { AnthropicError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./error.js";
export import toFile = Uploads.toFile;

@@ -142,0 +130,0 @@ export import fileFromPath = Uploads.fileFromPath;

@@ -153,15 +153,16 @@ "use strict";

exports.HUMAN_PROMPT = Anthropic.HUMAN_PROMPT, exports.AI_PROMPT = Anthropic.AI_PROMPT;
exports.AnthropicError = Errors.AnthropicError;
exports.APIError = Errors.APIError;
exports.APIConnectionError = Errors.APIConnectionError;
exports.APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
exports.APIUserAbortError = Errors.APIUserAbortError;
exports.NotFoundError = Errors.NotFoundError;
exports.ConflictError = Errors.ConflictError;
exports.RateLimitError = Errors.RateLimitError;
exports.BadRequestError = Errors.BadRequestError;
exports.AuthenticationError = Errors.AuthenticationError;
exports.InternalServerError = Errors.InternalServerError;
exports.PermissionDeniedError = Errors.PermissionDeniedError;
exports.UnprocessableEntityError = Errors.UnprocessableEntityError;
var error_1 = require("./error.js");
Object.defineProperty(exports, "AnthropicError", { enumerable: true, get: function () { return error_1.AnthropicError; } });
Object.defineProperty(exports, "APIError", { enumerable: true, get: function () { return error_1.APIError; } });
Object.defineProperty(exports, "APIConnectionError", { enumerable: true, get: function () { return error_1.APIConnectionError; } });
Object.defineProperty(exports, "APIConnectionTimeoutError", { enumerable: true, get: function () { return error_1.APIConnectionTimeoutError; } });
Object.defineProperty(exports, "APIUserAbortError", { enumerable: true, get: function () { return error_1.APIUserAbortError; } });
Object.defineProperty(exports, "NotFoundError", { enumerable: true, get: function () { return error_1.NotFoundError; } });
Object.defineProperty(exports, "ConflictError", { enumerable: true, get: function () { return error_1.ConflictError; } });
Object.defineProperty(exports, "RateLimitError", { enumerable: true, get: function () { return error_1.RateLimitError; } });
Object.defineProperty(exports, "BadRequestError", { enumerable: true, get: function () { return error_1.BadRequestError; } });
Object.defineProperty(exports, "AuthenticationError", { enumerable: true, get: function () { return error_1.AuthenticationError; } });
Object.defineProperty(exports, "InternalServerError", { enumerable: true, get: function () { return error_1.InternalServerError; } });
Object.defineProperty(exports, "PermissionDeniedError", { enumerable: true, get: function () { return error_1.PermissionDeniedError; } });
Object.defineProperty(exports, "UnprocessableEntityError", { enumerable: true, get: function () { return error_1.UnprocessableEntityError; } });
exports.toFile = Uploads.toFile;

@@ -168,0 +169,0 @@ exports.fileFromPath = Uploads.fileFromPath;

{
"name": "@anthropic-ai/sdk",
"version": "0.31.0",
"version": "0.32.0",
"description": "The official TypeScript library for the Anthropic API",

@@ -5,0 +5,0 @@ "author": "Anthropic <support@anthropic.com>",

@@ -170,3 +170,3 @@ import { APIResource } from "../resource.js";

*/
export type Model = (string & {}) | 'claude-3-5-sonnet-latest' | 'claude-3-5-sonnet-20241022' | 'claude-3-5-sonnet-20240620' | 'claude-3-opus-latest' | 'claude-3-opus-20240229' | 'claude-3-sonnet-20240229' | 'claude-3-haiku-20240307' | 'claude-2.1' | 'claude-2.0' | 'claude-instant-1.2';
export type Model = (string & {}) | 'claude-3-5-haiku-latest' | 'claude-3-5-haiku-20241022' | 'claude-3-5-sonnet-latest' | 'claude-3-5-sonnet-20241022' | 'claude-3-5-sonnet-20240620' | 'claude-3-opus-latest' | 'claude-3-opus-20240229' | 'claude-3-sonnet-20240229' | 'claude-3-haiku-20240307' | 'claude-2.1' | 'claude-2.0' | 'claude-instant-1.2';
export interface RawContentBlockDeltaEvent {

@@ -173,0 +173,0 @@ delta: TextDelta | InputJSONDelta;

@@ -413,3 +413,3 @@ import { VERSION } from "./version.js";

headers: Headers | undefined,
) {
): APIError {
return APIError.generate(status, error, message, headers);

@@ -686,5 +686,5 @@ }

async *iterPages() {
async *iterPages(): AsyncGenerator<this> {
// eslint-disable-next-line @typescript-eslint/no-this-alias
let page: AbstractPage<Item> = this;
let page: this = this;
yield page;

@@ -697,3 +697,3 @@ while (page.hasNextPage()) {

async *[Symbol.asyncIterator]() {
async *[Symbol.asyncIterator](): AsyncGenerator<Item> {
for await (const page of this.iterPages()) {

@@ -741,3 +741,3 @@ for (const item of page.getPaginatedItems()) {

*/
async *[Symbol.asyncIterator]() {
async *[Symbol.asyncIterator](): AsyncGenerator<Item> {
const page = await this;

@@ -744,0 +744,0 @@ for await (const item of page) {

@@ -53,3 +53,3 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

headers: Headers | undefined,
) {
): APIError {
if (!status) {

@@ -56,0 +56,0 @@ return new APIConnectionError({ message, cause: castToError(errorResponse) });

@@ -294,15 +294,17 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

export const AnthropicError = Errors.AnthropicError;
export const APIError = Errors.APIError;
export const APIConnectionError = Errors.APIConnectionError;
export const APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
export const APIUserAbortError = Errors.APIUserAbortError;
export const NotFoundError = Errors.NotFoundError;
export const ConflictError = Errors.ConflictError;
export const RateLimitError = Errors.RateLimitError;
export const BadRequestError = Errors.BadRequestError;
export const AuthenticationError = Errors.AuthenticationError;
export const InternalServerError = Errors.InternalServerError;
export const PermissionDeniedError = Errors.PermissionDeniedError;
export const UnprocessableEntityError = Errors.UnprocessableEntityError;
export {
AnthropicError,
APIError,
APIConnectionError,
APIConnectionTimeoutError,
APIUserAbortError,
NotFoundError,
ConflictError,
RateLimitError,
BadRequestError,
AuthenticationError,
InternalServerError,
PermissionDeniedError,
UnprocessableEntityError,
} from "./error.js";

@@ -309,0 +311,0 @@ export import toFile = Uploads.toFile;

@@ -232,2 +232,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

| (string & {})
| 'claude-3-5-haiku-latest'
| 'claude-3-5-haiku-20241022'
| 'claude-3-5-sonnet-latest'

@@ -234,0 +236,0 @@ | 'claude-3-5-sonnet-20241022'

@@ -26,3 +26,3 @@ import { ReadableStream, type Response } from "./_shims/index.js";

static fromSSEResponse<Item>(response: Response, controller: AbortController) {
static fromSSEResponse<Item>(response: Response, controller: AbortController): Stream<Item> {
let consumed = false;

@@ -96,3 +96,3 @@

*/
static fromReadableStream<Item>(readableStream: ReadableStream, controller: AbortController) {
static fromReadableStream<Item>(readableStream: ReadableStream, controller: AbortController): Stream<Item> {
let consumed = false;

@@ -99,0 +99,0 @@

@@ -1,1 +0,1 @@

export const VERSION = '0.31.0'; // x-release-please-version
export const VERSION = '0.32.0'; // x-release-please-version

@@ -7,4 +7,4 @@ "use strict";

const line_1 = require("./internal/decoders/line.js");
const core_1 = require("@anthropic-ai/sdk/core");
const error_2 = require("@anthropic-ai/sdk/error");
const core_1 = require("./core.js");
const error_2 = require("./error.js");
class Stream {

@@ -11,0 +11,0 @@ constructor(iterator, controller) {

@@ -1,2 +0,2 @@

export declare const VERSION = "0.31.0";
export declare const VERSION = "0.32.0";
//# sourceMappingURL=version.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.VERSION = void 0;
exports.VERSION = '0.31.0'; // x-release-please-version
exports.VERSION = '0.32.0'; // x-release-please-version
//# sourceMappingURL=version.js.map

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc