View source: R/tool-session-package-installed.R
| btw_tool_session_check_package_installed | R Documentation |
Checks if a package is installed in the current session. If the package is installed, it returns the version number. If not, it suggests packages with similar names to help the LLM resolve typos.
btw_tool_session_check_package_installed(package_name, `_intent` = "")
package_name |
The name of the package. |
_intent |
An optional string describing the intent of the tool use. When the tool is used by an LLM, the model will use this argument to explain why it called the tool. |
A message indicating whether the package is installed and its version, or an error indicating that the package is not installed.
btw_tools()
btw_tool_session_check_package_installed("dplyr")@value
tryCatch(
btw_tool_session_check_package_installed("dplry"),
error = function(err) {
cat(conditionMessage(err))
}
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.