Procedural macros for the Synaptic framework.
This crate provides attribute macros that reduce boilerplate when defining tools, runnable chains, graph entrypoints, tasks, middleware hooks, and traced functions.
Macros
| Macro | Description |
|---|---|
#[tool] |
Convert an async fn into a Tool implementor |
#[chain] |
Convert an async fn into a BoxRunnable |
#[entrypoint] |
Define a LangGraph-style workflow entry point |
#[task] |
Define a trackable task inside an entrypoint |
#[before_agent] |
Middleware: before agent loop |
#[before_model] |
Middleware: before model call |
#[after_model] |
Middleware: after model call |
#[after_agent] |
Middleware: after agent loop |
#[wrap_model_call] |
Middleware: wrap model call |
#[wrap_tool_call] |
Middleware: wrap tool call |
#[dynamic_prompt] |
Middleware: dynamic system prompt |
#[traceable] |
Add tracing instrumentation |