| foundry_tool | R Documentation |
Create a tool definition for foundry_response() or foundry_agent(). The
request sent to Azure uses the Responses API function-tool contract, while
the returned object also keeps the R function needed for local dispatch.
foundry_tool(fun, name = NULL, description, parameters)
fun |
Function. The R function to run when the model calls the tool. |
name |
Character. Tool name exposed to the model. If omitted and |
description |
Character. Short description of what the tool does. |
parameters |
List. JSON Schema object describing function arguments. |
A foundry_tool object. It is a list containing the JSON tool schema
and the R function used by foundry_agent().
get_weather <- function(location) {
list(location = location, temperature = "70 F")
}
weather_tool <- foundry_tool(
get_weather,
description = "Get weather for a location",
parameters = list(
type = "object",
properties = list(location = list(type = "string")),
required = "location"
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.