Skip to main content

Crate troupekit_macros

Crate troupekit_macros 

Source

Attribute Macrosยง

agent
Turns fn calc() {} into a fn returning a configured Agent: the doc comment becomes the instructions and the fn name, _ read as -, the agent name. Keys such as model, tools = [add] and evals map to the builder methods of the same name.
tool
Turns a fn into a tool value: #[tool] async fn add(a: i64, b: i64) makes add a unit struct implementing Tool; the doc comment is the description, the arguments the schema, and the body stays callable as add::invoke(..). An imported add turns a let add binding into a unit-struct pattern: rename the binding or use the tool by path. Keys: name, description, crate.