Skip to main content

function

Attribute Macro function 

Source
#[function]
Expand description

Makes a function a tool: its name is the tool’s, its doc comment the description the model reads, and its one argument and Ok type the input and output schemas. The function itself is left as written.

ⓘ
/// Greet someone by name.
#[function]
fn greet(input: GreetInput) -> Result<Greeting, ToolError> { ... }