Skip to main content

Crate tool_call_batcher

Crate tool_call_batcher 

Source
Expand description

tool-call-batcher: queue pending tool calls and flush them as a batch.

When an agent produces multiple tool calls in one turn, this crate lets you collect them, inspect them, and flush them in a controlled way.

use tool_call_batcher::CallBatcher;
use serde_json::json;

let mut b = CallBatcher::new();
b.enqueue("search", json!({"q": "rust"}));
b.enqueue("fetch",  json!({"url": "http://example.com"}));
let batch = b.flush();
assert_eq!(batch.len(), 2);
assert!(b.is_empty());

Structsยง

CallBatcher
PendingCall