| hf_tool | R Documentation |
Build an OpenAI-compatible function-calling tool definition for
hf_chat(). The parameters argument can be a lightweight named
character vector, for example c(city = "string"), or a full JSON Schema
object.
hf_tool(
name,
description,
parameters = list(type = "object", properties = list(), additionalProperties = FALSE)
)
name |
Tool/function name. Must be a non-empty character scalar. |
description |
Human-readable description of what the tool does. |
parameters |
A named character vector or JSON Schema list describing function arguments. |
A list suitable for the tools argument of hf_chat().
weather_tool <- hf_tool(
"get_weather",
"Get current weather for a city.",
c(city = "string")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.