Skip to main content

Crate agent_tool_middleware

Crate agent_tool_middleware 

Source
Expand description

agent-tool-middleware: middleware pipeline for LLM agent tool call processing.

use agent_tool_middleware::{MiddlewarePipeline, LogMiddleware};
use serde_json::json;

let mut pipe = MiddlewarePipeline::new();
pipe.add(LogMiddleware::new());
let (args, result) = pipe.run("search", json!({"q": "rust"}), json!({"hits": 5}));
assert_eq!(args["q"], "rust");

Structs§

CallRecord
A call record in the pipeline log.
InjectFieldMiddleware
Middleware that adds a field to every args object.
LogMiddleware
Logging middleware — records every call.
MiddlewarePipeline
A pipeline of middleware applied to every tool call.

Traits§

Middleware
A middleware that can modify args before a call and result after.