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.19.2 to 0.20.0

resources/beta/beta.d.ts

18

CHANGELOG.md
# Changelog
## 0.20.0 (2024-04-04)
Full Changelog: [sdk-v0.19.2...sdk-v0.20.0](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.19.2...sdk-v0.20.0)
### Features
* **api:** tool use beta ([#374](https://github.com/anthropics/anthropic-sdk-typescript/issues/374)) ([e28514a](https://github.com/anthropics/anthropic-sdk-typescript/commit/e28514a305908f71e98bc33123bc99ed6bf7348f))
### Bug Fixes
* **types:** correctly mark type as a required property in requests ([#371](https://github.com/anthropics/anthropic-sdk-typescript/issues/371)) ([a04edd8](https://github.com/anthropics/anthropic-sdk-typescript/commit/a04edd8d7f4c552281b37a44099edf432d7fcb27))
### Chores
* **types:** consistent naming for text block types ([#373](https://github.com/anthropics/anthropic-sdk-typescript/issues/373)) ([84a6a58](https://github.com/anthropics/anthropic-sdk-typescript/commit/84a6a58ff978cc274b85656ca4394396e8b360e3))
## 0.19.2 (2024-04-04)

@@ -4,0 +22,0 @@

3

index.d.ts

@@ -86,2 +86,3 @@ import * as Core from "./core.js";

messages: API.Messages;
beta: API.Beta;
protected defaultQuery(): Core.DefaultQuery | undefined;

@@ -137,2 +138,3 @@ protected defaultHeaders(opts: Core.FinalRequestOptions): Core.Headers;

export import TextBlock = API.TextBlock;
export import TextBlockParam = API.TextBlockParam;
export import TextDelta = API.TextDelta;

@@ -144,4 +146,5 @@ export import Usage = API.Usage;

export import MessageStreamParams = API.MessageStreamParams;
export import Beta = API.Beta;
}
export default Anthropic;
//# sourceMappingURL=index.d.ts.map

@@ -64,2 +64,3 @@ "use strict";

this.messages = new API.Messages(this);
this.beta = new API.Beta(this);
this._options = options;

@@ -146,2 +147,3 @@ this.apiKey = apiKey;

Anthropic.Messages = API.Messages;
Anthropic.Beta = API.Beta;
})(Anthropic = exports.Anthropic || (exports.Anthropic = {}));

@@ -148,0 +150,0 @@ exports = module.exports = Anthropic;

2

package.json
{
"name": "@anthropic-ai/sdk",
"version": "0.19.2",
"version": "0.20.0",
"description": "The official TypeScript library for the Anthropic API",

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

@@ -0,3 +1,4 @@

export { Beta } from "./beta/beta.js";
export { Completion, CompletionCreateParams, CompletionCreateParamsNonStreaming, CompletionCreateParamsStreaming, Completions, } from "./completions.js";
export { ContentBlock, ContentBlockDeltaEvent, ContentBlockStartEvent, ContentBlockStopEvent, ImageBlockParam, Message, MessageDeltaEvent, MessageDeltaUsage, MessageParam, MessageStartEvent, MessageStopEvent, MessageStreamEvent, TextBlock, TextDelta, Usage, MessageCreateParams, MessageCreateParamsNonStreaming, MessageCreateParamsStreaming, MessageStreamParams, Messages, } from "./messages.js";
export { ContentBlock, ContentBlockDeltaEvent, ContentBlockStartEvent, ContentBlockStopEvent, ImageBlockParam, Message, MessageDeltaEvent, MessageDeltaUsage, MessageParam, MessageStartEvent, MessageStopEvent, MessageStreamEvent, TextBlock, TextBlockParam, TextDelta, Usage, MessageCreateParams, MessageCreateParamsNonStreaming, MessageCreateParamsStreaming, MessageStreamParams, Messages, } from "./messages.js";
//# sourceMappingURL=index.d.ts.map
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Messages = exports.Completions = void 0;
exports.Messages = exports.Completions = exports.Beta = void 0;
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");

@@ -6,0 +8,0 @@ Object.defineProperty(exports, "Completions", { enumerable: true, get: function () { return completions_1.Completions; } });

@@ -26,6 +26,3 @@ import * as Core from '@anthropic-ai/sdk/core';

}
export interface ContentBlock {
text: string;
type: 'text';
}
export type ContentBlock = TextBlock;
export interface ContentBlockDeltaEvent {

@@ -37,3 +34,3 @@ delta: TextDelta;

export interface ContentBlockStartEvent {
content_block: ContentBlock;
content_block: TextBlock;
index: number;

@@ -48,3 +45,3 @@ type: 'content_block_start';

source: ImageBlockParam.Source;
type?: 'image';
type: 'image';
}

@@ -55,3 +52,3 @@ export declare namespace ImageBlockParam {

media_type: 'image/jpeg' | 'image/png' | 'image/gif' | 'image/webp';
type?: 'base64';
type: 'base64';
}

@@ -100,3 +97,3 @@ }

*/
content: Array<ContentBlock>;
content: Array<TextBlock>;
/**

@@ -121,5 +118,2 @@ * The model that handled the request.

*
* Note that these values are different than those in `/v1/complete`, where
* `end_turn` and `stop_sequence` were not differentiated.
*
* In non-streaming mode this value is always non-null. In streaming mode, it is

@@ -190,3 +184,3 @@ * null in the `message_start` event and non-null otherwise.

export interface MessageParam {
content: string | Array<TextBlock | ImageBlockParam>;
content: string | Array<TextBlockParam | ImageBlockParam>;
role: 'user' | 'assistant';

@@ -204,4 +198,8 @@ }

text: string;
type?: 'text';
type: 'text';
}
export interface TextBlockParam {
text: string;
type: 'text';
}
export interface TextDelta {

@@ -621,2 +619,3 @@ text: string;

export import TextBlock = MessagesAPI.TextBlock;
export import TextBlockParam = MessagesAPI.TextBlockParam;
export import TextDelta = MessagesAPI.TextDelta;

@@ -623,0 +622,0 @@ export import Usage = MessagesAPI.Usage;

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

messages: API.Messages = new API.Messages(this);
beta: API.Beta = new API.Beta(this);

@@ -254,2 +255,3 @@ protected override defaultQuery(): Core.DefaultQuery | undefined {

export import TextBlock = API.TextBlock;
export import TextBlockParam = API.TextBlockParam;
export import TextDelta = API.TextDelta;

@@ -261,4 +263,6 @@ export import Usage = API.Usage;

export import MessageStreamParams = API.MessageStreamParams;
export import Beta = API.Beta;
}
export default Anthropic;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
export { Beta } from './beta/beta';
export {

@@ -24,2 +25,3 @@ Completion,

TextBlock,
TextBlockParam,
TextDelta,

@@ -26,0 +28,0 @@ Usage,

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

export interface ContentBlock {
text: string;
export type ContentBlock = TextBlock;
type: 'text';
}
export interface ContentBlockDeltaEvent {

@@ -66,3 +62,3 @@ delta: TextDelta;

export interface ContentBlockStartEvent {
content_block: ContentBlock;
content_block: TextBlock;

@@ -83,3 +79,3 @@ index: number;

type?: 'image';
type: 'image';
}

@@ -93,3 +89,3 @@

type?: 'base64';
type: 'base64';
}

@@ -140,3 +136,3 @@ }

*/
content: Array<ContentBlock>;
content: Array<TextBlock>;

@@ -164,5 +160,2 @@ /**

*
* Note that these values are different than those in `/v1/complete`, where
* `end_turn` and `stop_sequence` were not differentiated.
*
* In non-streaming mode this value is always non-null. In streaming mode, it is

@@ -243,3 +236,3 @@ * null in the `message_start` event and non-null otherwise.

export interface MessageParam {
content: string | Array<TextBlock | ImageBlockParam>;
content: string | Array<TextBlockParam | ImageBlockParam>;

@@ -270,5 +263,11 @@ role: 'user' | 'assistant';

type?: 'text';
type: 'text';
}
export interface TextBlockParam {
text: string;
type: 'text';
}
export interface TextDelta {

@@ -731,2 +730,3 @@ text: string;

export import TextBlock = MessagesAPI.TextBlock;
export import TextBlockParam = MessagesAPI.TextBlockParam;
export import TextDelta = MessagesAPI.TextDelta;

@@ -733,0 +733,0 @@ export import Usage = MessagesAPI.Usage;

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

export const VERSION = '0.19.2'; // x-release-please-version
export const VERSION = '0.20.0'; // x-release-please-version

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

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

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