@ai-sdk/anthropic 4.0.16 → 4.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/index.js +15 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +10 -1
- package/dist/internal/index.js +16 -1
- package/dist/internal/index.js.map +1 -1
- package/package.json +2 -2
- package/src/anthropic-language-model.ts +24 -0
- package/src/internal/index.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/anthropic",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@ai-sdk/provider": "4.0.3",
|
|
39
|
-
"@ai-sdk/provider-utils": "5.0.
|
|
39
|
+
"@ai-sdk/provider-utils": "5.0.12"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/node": "22.19.19",
|
|
@@ -301,6 +301,17 @@ export class AnthropicLanguageModel implements LanguageModelV4 {
|
|
|
301
301
|
isKnownModel,
|
|
302
302
|
} = getModelCapabilities(this.modelId);
|
|
303
303
|
|
|
304
|
+
if (!isKnownModel && maxOutputTokens == null) {
|
|
305
|
+
warnings.push({
|
|
306
|
+
type: 'compatibility',
|
|
307
|
+
feature: 'maxOutputTokens',
|
|
308
|
+
details:
|
|
309
|
+
`The model "${this.modelId}" is unknown. ` +
|
|
310
|
+
`The max output tokens have been limited to ${maxOutputTokensForModel}. ` +
|
|
311
|
+
`Set maxOutputTokens explicitly to override this limit.`,
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
|
|
304
315
|
if (rejectsSamplingParameters) {
|
|
305
316
|
if (temperature != null) {
|
|
306
317
|
warnings.push({
|
|
@@ -356,6 +367,19 @@ export class AnthropicLanguageModel implements LanguageModelV4 {
|
|
|
356
367
|
}
|
|
357
368
|
: undefined;
|
|
358
369
|
|
|
370
|
+
if (
|
|
371
|
+
jsonResponseTool != null &&
|
|
372
|
+
anthropicOptions?.disableParallelToolUse === false
|
|
373
|
+
) {
|
|
374
|
+
warnings.push({
|
|
375
|
+
type: 'unsupported',
|
|
376
|
+
feature: 'providerOptions.anthropic.disableParallelToolUse',
|
|
377
|
+
details:
|
|
378
|
+
'`disableParallelToolUse: false` is ignored when using the JSON response tool. ' +
|
|
379
|
+
'Parallel tool use is disabled to ensure a single coherent JSON tool call.',
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
|
|
359
383
|
const contextManagement = anthropicOptions?.contextManagement;
|
|
360
384
|
|
|
361
385
|
// Create a shared cache control validator to track breakpoints across tools and messages
|
package/src/internal/index.ts
CHANGED
|
@@ -12,4 +12,5 @@ export type {
|
|
|
12
12
|
AnthropicModelId as AnthropicMessagesModelId,
|
|
13
13
|
} from '../anthropic-language-model-options';
|
|
14
14
|
export { prepareTools } from '../anthropic-prepare-tools';
|
|
15
|
+
export { sanitizeJsonSchema } from '../sanitize-json-schema';
|
|
15
16
|
export { AnthropicSkills } from '../skills/anthropic-skills';
|