tool

Function tool 

Source
pub fn tool<S: Into<String>>(name: S) -> ToolBuilder
Expand description

Creates a new ToolBuilder with the specified name.

This is a convenience function that returns a ToolBuilder instance initialized with the given name. You can then chain additional methods to configure the tool before building it.

ยงExample

use ic_llm::{ParameterType, Response};

// Basic usage
let weather_tool = ic_llm::tool("get_weather")
    .with_description("Get current weather for a location")
    .with_parameter(
        ic_llm::parameter("location", ParameterType::String)
            .with_description("The location to get weather for")
            .is_required()
    )
    .build();