@ai-sdk/anthropic 3.0.89 → 3.0.90
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 +6 -0
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -5
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +6 -4
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +6 -4
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/anthropic-messages-language-model.ts +12 -3
package/package.json
CHANGED
|
@@ -1442,6 +1442,7 @@ export class AnthropicMessagesLanguageModel implements LanguageModelV3 {
|
|
|
1442
1442
|
providerExecuted?: boolean;
|
|
1443
1443
|
firstDelta: boolean;
|
|
1444
1444
|
providerToolName?: string;
|
|
1445
|
+
providerToolInputType?: string;
|
|
1445
1446
|
caller?: {
|
|
1446
1447
|
type:
|
|
1447
1448
|
| 'code_execution_20250825'
|
|
@@ -1647,6 +1648,13 @@ export class AnthropicMessagesLanguageModel implements LanguageModelV3 {
|
|
|
1647
1648
|
part.name === 'bash_code_execution'
|
|
1648
1649
|
? 'code_execution'
|
|
1649
1650
|
: part.name;
|
|
1651
|
+
const providerToolInputType =
|
|
1652
|
+
part.name === 'text_editor_code_execution' ||
|
|
1653
|
+
part.name === 'bash_code_execution'
|
|
1654
|
+
? part.name
|
|
1655
|
+
: part.name === 'code_execution'
|
|
1656
|
+
? 'programmatic-tool-call'
|
|
1657
|
+
: undefined;
|
|
1650
1658
|
|
|
1651
1659
|
const customToolName =
|
|
1652
1660
|
toolNameMapping.toCustomToolName(providerToolName);
|
|
@@ -1675,8 +1683,9 @@ export class AnthropicMessagesLanguageModel implements LanguageModelV3 {
|
|
|
1675
1683
|
providerToolName === 'code_execution'
|
|
1676
1684
|
? { dynamic: true }
|
|
1677
1685
|
: {}),
|
|
1678
|
-
firstDelta:
|
|
1686
|
+
firstDelta: finalInput.length === 0,
|
|
1679
1687
|
providerToolName,
|
|
1688
|
+
providerToolInputType,
|
|
1680
1689
|
};
|
|
1681
1690
|
|
|
1682
1691
|
controller.enqueue({
|
|
@@ -2205,9 +2214,9 @@ export class AnthropicMessagesLanguageModel implements LanguageModelV3 {
|
|
|
2205
2214
|
// the type to the delta and change the tool name.
|
|
2206
2215
|
if (
|
|
2207
2216
|
contentBlock.firstDelta &&
|
|
2208
|
-
contentBlock.
|
|
2217
|
+
contentBlock.providerToolInputType != null
|
|
2209
2218
|
) {
|
|
2210
|
-
delta = `{"type": "
|
|
2219
|
+
delta = `{"type": "${contentBlock.providerToolInputType}",${delta.substring(1)}`;
|
|
2211
2220
|
}
|
|
2212
2221
|
|
|
2213
2222
|
controller.enqueue({
|