Files
maritime-logistics/src/llm/tool.rs
T
msjidandClaude Sonnet 5 771280cde6 Add Maritime/Logistics support assistant with safety/eval layer
RAG + multi-agent (retrieval, policy-compliance, drafting) support
assistant for a fictional shipping company, built in Rust with Qdrant
for vector storage and a hand-rolled Anthropic tool-calling client
(no Rust pydantic-ai equivalent exists). A deterministic supervisor
orchestrates the agents and runs every response through a rule-based
guardrail pipeline with an append-only audit log.

Includes a 44-example golden dataset (normal/injection/policy-
violation/hallucination-bait/out-of-scope) and a regression harness
that scores retrieval, generation, and guardrail correctness
separately, plus a write-up of the failure modes and trade-offs.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-09-18 21:04:09 +02:00

14 lines
398 B
Rust

//! The `Tool` trait agents expose to the LLM during an agentic loop.
use async_trait::async_trait;
use serde_json::Value;
#[async_trait]
pub trait Tool: Send + Sync {
fn name(&self) -> &str;
fn description(&self) -> &str;
/// JSON Schema (object) describing the tool's input.
fn input_schema(&self) -> Value;
async fn execute(&self, input: Value) -> anyhow::Result<Value>;
}