🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@ai-sdk/anthropic

Package Overview
Dependencies
Maintainers
3
Versions
569
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ai-sdk/anthropic - npm Package Compare versions

Comparing version
4.0.30
to
4.0.32
+7
-0
dist/index.d.ts

@@ -409,2 +409,4 @@ import { JSONObject, ProviderV4, LanguageModelV4, FilesV4, SkillsV4 } from '@ai-sdk/provider';

* @param maxUses - Maximum advisor calls per request (per-request cap).
* @param maxTokens - Maximum advisor output tokens per call, including
* thinking and text. Minimum 1024; Anthropic recommends starting with 2048.
* @param caching - Enables prompt caching for the advisor's transcript

@@ -417,5 +419,7 @@ * across calls within a conversation. Worthwhile from ~3 advisor calls

text: string;
stopReason?: string;
} | {
type: "advisor_redacted_result";
encryptedContent: string;
stopReason?: string;
} | {

@@ -427,2 +431,3 @@ type: "advisor_tool_result_error";

maxUses?: number;
maxTokens?: number;
caching?: {

@@ -435,5 +440,7 @@ type: "ephemeral";

text: string;
stopReason?: string;
} | {
type: "advisor_redacted_result";
encryptedContent: string;
stopReason?: string;
} | {

@@ -440,0 +447,0 @@ type: "advisor_tool_result_error";

@@ -170,2 +170,4 @@ import { FilesV4, FilesV4UploadFileCallOptions, FilesV4UploadFileResult, LanguageModelV4, JSONObject, LanguageModelV4CallOptions, LanguageModelV4GenerateResult, LanguageModelV4StreamResult, JSONSchema7, SharedV4ProviderMetadata, SharedV4Warning, SkillsV4 } from '@ai-sdk/provider';

* @param maxUses - Maximum advisor calls per request (per-request cap).
* @param maxTokens - Maximum advisor output tokens per call, including
* thinking and text. Minimum 1024; Anthropic recommends starting with 2048.
* @param caching - Enables prompt caching for the advisor's transcript

@@ -178,5 +180,7 @@ * across calls within a conversation. Worthwhile from ~3 advisor calls

text: string;
stopReason?: string;
} | {
type: "advisor_redacted_result";
encryptedContent: string;
stopReason?: string;
} | {

@@ -188,2 +192,3 @@ type: "advisor_tool_result_error";

maxUses?: number;
maxTokens?: number;
caching?: {

@@ -196,5 +201,7 @@ type: "ephemeral";

text: string;
stopReason?: string;
} | {
type: "advisor_redacted_result";
encryptedContent: string;
stopReason?: string;
} | {

@@ -1081,2 +1088,3 @@ type: "advisor_tool_result_error";

max_uses?: number;
max_tokens?: number;
caching?: {

@@ -1083,0 +1091,0 @@ type: 'ephemeral';

+2
-2
{
"name": "@ai-sdk/anthropic",
"version": "4.0.30",
"version": "4.0.32",
"type": "module",

@@ -39,3 +39,3 @@ "license": "Apache-2.0",

"@ai-sdk/provider": "4.0.5",
"@ai-sdk/provider-utils": "5.0.21"
"@ai-sdk/provider-utils": "5.0.22"
},

@@ -42,0 +42,0 @@ "devDependencies": {

@@ -361,2 +361,3 @@ import type { JSONSchema7 } from '@ai-sdk/provider';

text: string;
stop_reason?: string;
}

@@ -366,2 +367,3 @@ | {

encrypted_content: string;
stop_reason?: string;
}

@@ -535,2 +537,3 @@ | {

max_uses?: number;
max_tokens?: number;
caching?: {

@@ -930,2 +933,3 @@ type: 'ephemeral';

text: z.string(),
stop_reason: z.string().nullish(),
}),

@@ -935,2 +939,3 @@ z.object({

encrypted_content: z.string(),
stop_reason: z.string().nullish(),
}),

@@ -1329,2 +1334,3 @@ z.object({

text: z.string(),
stop_reason: z.string().nullish(),
}),

@@ -1334,2 +1340,3 @@ z.object({

encrypted_content: z.string(),
stop_reason: z.string().nullish(),
}),

@@ -1336,0 +1343,0 @@ z.object({

@@ -361,2 +361,5 @@ import {

...(args.maxUses !== undefined && { max_uses: args.maxUses }),
...(args.maxTokens !== undefined && {
max_tokens: args.maxTokens,
}),
...(args.caching !== undefined && { caching: args.caching }),

@@ -363,0 +366,0 @@ });

@@ -47,2 +47,4 @@ import { advisor_20260301 } from './tool/advisor_20260301';

* @param maxUses - Maximum advisor calls per request (per-request cap).
* @param maxTokens - Maximum advisor output tokens per call, including
* thinking and text. Minimum 1024; Anthropic recommends starting with 2048.
* @param caching - Enables prompt caching for the advisor's transcript

@@ -49,0 +51,0 @@ * across calls within a conversation. Worthwhile from ~3 advisor calls

@@ -1246,2 +1246,5 @@ import {

text: advisorOutput.text,
...(advisorOutput.stopReason !== undefined && {
stop_reason: advisorOutput.stopReason,
}),
},

@@ -1257,2 +1260,5 @@ cache_control: cacheControl,

encrypted_content: advisorOutput.encryptedContent,
...(advisorOutput.stopReason !== undefined && {
stop_reason: advisorOutput.stopReason,
}),
},

@@ -1259,0 +1265,0 @@ cache_control: cacheControl,

@@ -13,2 +13,3 @@ import {

maxUses: z.number().optional(),
maxTokens: z.number().int().min(1024).optional(),
caching: z

@@ -30,2 +31,3 @@ .object({

text: z.string(),
stopReason: z.string().optional(),
}),

@@ -35,2 +37,3 @@ z.object({

encryptedContent: z.string(),
stopReason: z.string().optional(),
}),

@@ -60,2 +63,8 @@ z.object({

text: string;
/**
* The advisor sub-inference stop reason when `maxTokens` is configured.
* A value of `"max_tokens"` indicates that the advice was truncated.
*/
stopReason?: string;
}

@@ -71,2 +80,8 @@ | {

encryptedContent: string;
/**
* The advisor sub-inference stop reason when `maxTokens` is configured.
* A value of `"max_tokens"` indicates that the advice was truncated.
*/
stopReason?: string;
}

@@ -108,2 +123,13 @@ | {

/**
* Maximum number of tokens the advisor can generate per call, including
* thinking and text. This is independent of the executor's request-level
* `maxOutputTokens`.
*
* The minimum value is 1024. Anthropic recommends starting with 2048.
* Values above the selected advisor model's output limit return a
* `400 invalid_request_error` from the API.
*/
maxTokens?: number;
/**
* Enables prompt caching for the advisor's own transcript across calls

@@ -110,0 +136,0 @@ * within a conversation. Unlike `cache_control` on content blocks, this

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

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

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

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

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 too big to display