@ai-sdk/anthropic 3.0.98 → 3.0.100
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 +13 -0
- package/dist/index.js +15 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -1
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +10 -1
- package/dist/internal/index.d.ts +10 -1
- package/dist/internal/index.js +18 -2
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +16 -1
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/anthropic-messages-language-model.ts +24 -0
- package/src/internal/index.ts +1 -0
package/package.json
CHANGED
|
@@ -279,6 +279,17 @@ export class AnthropicMessagesLanguageModel implements LanguageModelV3 {
|
|
|
279
279
|
isKnownModel,
|
|
280
280
|
} = getModelCapabilities(this.modelId);
|
|
281
281
|
|
|
282
|
+
if (!isKnownModel && maxOutputTokens == null) {
|
|
283
|
+
warnings.push({
|
|
284
|
+
type: 'compatibility',
|
|
285
|
+
feature: 'maxOutputTokens',
|
|
286
|
+
details:
|
|
287
|
+
`The model "${this.modelId}" is unknown. ` +
|
|
288
|
+
`The max output tokens have been limited to ${maxOutputTokensForModel}. ` +
|
|
289
|
+
`Set maxOutputTokens explicitly to override this limit.`,
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
|
|
282
293
|
if (rejectsSamplingParameters) {
|
|
283
294
|
if (temperature != null) {
|
|
284
295
|
warnings.push({
|
|
@@ -334,6 +345,19 @@ export class AnthropicMessagesLanguageModel implements LanguageModelV3 {
|
|
|
334
345
|
}
|
|
335
346
|
: undefined;
|
|
336
347
|
|
|
348
|
+
if (
|
|
349
|
+
jsonResponseTool != null &&
|
|
350
|
+
anthropicOptions?.disableParallelToolUse === false
|
|
351
|
+
) {
|
|
352
|
+
warnings.push({
|
|
353
|
+
type: 'unsupported',
|
|
354
|
+
feature: 'providerOptions.anthropic.disableParallelToolUse',
|
|
355
|
+
details:
|
|
356
|
+
'`disableParallelToolUse: false` is ignored when using the JSON response tool. ' +
|
|
357
|
+
'Parallel tool use is disabled to ensure a single coherent JSON tool call.',
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
|
|
337
361
|
const contextManagement = anthropicOptions?.contextManagement;
|
|
338
362
|
|
|
339
363
|
// Create a shared cache control validator to track breakpoints across tools and messages
|
package/src/internal/index.ts
CHANGED
|
@@ -2,3 +2,4 @@ export { AnthropicMessagesLanguageModel } from '../anthropic-messages-language-m
|
|
|
2
2
|
export { anthropicTools } from '../anthropic-tools';
|
|
3
3
|
export type { AnthropicMessagesModelId } from '../anthropic-messages-options';
|
|
4
4
|
export { prepareTools } from '../anthropic-prepare-tools';
|
|
5
|
+
export { sanitizeJsonSchema } from '../sanitize-json-schema';
|