@ai-sdk/anthropic 2.0.13 → 2.0.15
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 +12 -0
- package/dist/index.d.mts +89 -61
- package/dist/index.d.ts +89 -61
- package/dist/index.js +53 -32
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +53 -32
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +89 -61
- package/dist/internal/index.d.ts +89 -61
- package/dist/internal/index.js +53 -32
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +53 -32
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/internal/index.mjs
CHANGED
|
@@ -544,14 +544,7 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
|
-
|
|
548
|
-
(part) => part.type === "tool_result"
|
|
549
|
-
);
|
|
550
|
-
const otherParts = anthropicContent.filter(
|
|
551
|
-
(part) => part.type !== "tool_result"
|
|
552
|
-
);
|
|
553
|
-
const reorderedContent = toolResultParts.length > 0 ? [...toolResultParts, ...otherParts] : anthropicContent;
|
|
554
|
-
messages.push({ role: "user", content: reorderedContent });
|
|
547
|
+
messages.push({ role: "user", content: anthropicContent });
|
|
555
548
|
break;
|
|
556
549
|
}
|
|
557
550
|
case "assistant": {
|
|
@@ -1977,69 +1970,97 @@ var textEditor_20250429 = createProviderDefinedToolFactory7({
|
|
|
1977
1970
|
// src/anthropic-tools.ts
|
|
1978
1971
|
var anthropicTools = {
|
|
1979
1972
|
/**
|
|
1980
|
-
*
|
|
1973
|
+
* The bash tool enables Claude to execute shell commands in a persistent bash session,
|
|
1974
|
+
* allowing system operations, script execution, and command-line automation.
|
|
1981
1975
|
*
|
|
1982
1976
|
* Image results are supported.
|
|
1983
1977
|
*
|
|
1984
|
-
*
|
|
1978
|
+
* Tool name must be `bash`.
|
|
1985
1979
|
*/
|
|
1986
1980
|
bash_20241022,
|
|
1987
1981
|
/**
|
|
1988
|
-
*
|
|
1982
|
+
* The bash tool enables Claude to execute shell commands in a persistent bash session,
|
|
1983
|
+
* allowing system operations, script execution, and command-line automation.
|
|
1989
1984
|
*
|
|
1990
1985
|
* Image results are supported.
|
|
1991
1986
|
*
|
|
1992
|
-
*
|
|
1987
|
+
* Tool name must be `bash`.
|
|
1993
1988
|
*/
|
|
1994
1989
|
bash_20250124,
|
|
1995
1990
|
/**
|
|
1996
|
-
*
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
*
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
* Creates a tool for editing text. Must have name "str_replace_based_edit_tool".
|
|
2005
|
-
* Note: This version does not support the "undo_edit" command.
|
|
1991
|
+
* Claude can analyze data, create visualizations, perform complex calculations,
|
|
1992
|
+
* run system commands, create and edit files, and process uploaded files directly within
|
|
1993
|
+
* the API conversation.
|
|
1994
|
+
*
|
|
1995
|
+
* The code execution tool allows Claude to run Bash commands and manipulate files,
|
|
1996
|
+
* including writing code, in a secure, sandboxed environment.
|
|
1997
|
+
*
|
|
1998
|
+
* Tool name must be `code_execution`.
|
|
2006
1999
|
*/
|
|
2007
|
-
|
|
2000
|
+
codeExecution_20250522,
|
|
2008
2001
|
/**
|
|
2009
|
-
*
|
|
2002
|
+
* Claude can interact with computer environments through the computer use tool, which
|
|
2003
|
+
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
2010
2004
|
*
|
|
2011
2005
|
* Image results are supported.
|
|
2012
2006
|
*
|
|
2007
|
+
* Tool name must be `computer`.
|
|
2008
|
+
*
|
|
2013
2009
|
* @param displayWidthPx - The width of the display being controlled by the model in pixels.
|
|
2014
2010
|
* @param displayHeightPx - The height of the display being controlled by the model in pixels.
|
|
2015
2011
|
* @param displayNumber - The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.
|
|
2016
2012
|
*/
|
|
2017
2013
|
computer_20241022,
|
|
2018
2014
|
/**
|
|
2019
|
-
*
|
|
2015
|
+
* Claude can interact with computer environments through the computer use tool, which
|
|
2016
|
+
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
2020
2017
|
*
|
|
2021
2018
|
* Image results are supported.
|
|
2022
2019
|
*
|
|
2020
|
+
* Tool name must be `computer`.
|
|
2021
|
+
*
|
|
2023
2022
|
* @param displayWidthPx - The width of the display being controlled by the model in pixels.
|
|
2024
2023
|
* @param displayHeightPx - The height of the display being controlled by the model in pixels.
|
|
2025
2024
|
* @param displayNumber - The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.
|
|
2026
|
-
* @param execute - The function to execute the tool. Optional.
|
|
2027
2025
|
*/
|
|
2028
2026
|
computer_20250124,
|
|
2027
|
+
/**
|
|
2028
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
2029
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
2030
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
2031
|
+
*
|
|
2032
|
+
* Tool name must be `str_replace_editor`.
|
|
2033
|
+
*/
|
|
2034
|
+
textEditor_20241022,
|
|
2035
|
+
/**
|
|
2036
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
2037
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
2038
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
2039
|
+
*
|
|
2040
|
+
* Tool name must be `str_replace_editor`.
|
|
2041
|
+
*/
|
|
2042
|
+
textEditor_20250124,
|
|
2043
|
+
/**
|
|
2044
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
2045
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
2046
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
2047
|
+
*
|
|
2048
|
+
* Note: This version does not support the "undo_edit" command.
|
|
2049
|
+
*
|
|
2050
|
+
* Tool name must be `str_replace_based_edit_tool`.
|
|
2051
|
+
*/
|
|
2052
|
+
textEditor_20250429,
|
|
2029
2053
|
/**
|
|
2030
2054
|
* Creates a web search tool that gives Claude direct access to real-time web content.
|
|
2031
|
-
*
|
|
2055
|
+
*
|
|
2056
|
+
* Tool name must be `web_search`.
|
|
2032
2057
|
*
|
|
2033
2058
|
* @param maxUses - Maximum number of web searches Claude can perform during the conversation.
|
|
2034
2059
|
* @param allowedDomains - Optional list of domains that Claude is allowed to search.
|
|
2035
2060
|
* @param blockedDomains - Optional list of domains that Claude should avoid when searching.
|
|
2036
2061
|
* @param userLocation - Optional user location information to provide geographically relevant search results.
|
|
2037
2062
|
*/
|
|
2038
|
-
webSearch_20250305
|
|
2039
|
-
/**
|
|
2040
|
-
* Creates a tool for executing Python code. Must have name "code_execution".
|
|
2041
|
-
*/
|
|
2042
|
-
codeExecution_20250522
|
|
2063
|
+
webSearch_20250305
|
|
2043
2064
|
};
|
|
2044
2065
|
export {
|
|
2045
2066
|
AnthropicMessagesLanguageModel,
|