#[non_exhaustive]pub struct ToolSpec {
pub short_description: Option<String>,
pub origin: ToolOrigin,
pub traits: CallTraits,
pub callable_from_code: bool,
pub code_result: Option<&'static str>,
pub needs_dispatch: bool,
pub stance: ModeStance,
pub pages_itself: bool,
}Expand description
What a tool says about itself that holds for every call. Built with
ToolSpec::new and the setters: ToolSpec::new().read_only(true).
traits is the answer when the input is not looked at. A tool whose answer
depends on the input overrides Tool::call_traits too, and puts its
conservative answer here.
The input schema is not here: it is built on every call and the spec is asked for far more often than the schema.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.short_description: Option<String>What ToolSearch lists next to the name; the description when unset.
origin: ToolOrigin§traits: CallTraits§callable_from_code: boolWhether a program the model writes (RunCode) may call this tool.
Tools that do work and return data say yes; tools that talk to the
conversation or a person do not.
code_result: Option<&'static str>What a program gets back from this tool, when that is more than the text the model sees — the shape of its structured content.
needs_dispatch: boolWhether this tool calls other tools, and so needs
ToolContext::dispatch.
stance: ModeStanceHow the permission modes treat this tool’s calls.
pages_itself: boolThe tool lets the model read a long result in parts (an offset), so the engine does not save a long result to a file for it.