PurRAssist
Assistance for AIs that get the details almost right. This facade exposes the pure recovery engines and isolated syntax integration.
Status: 0.1.0. This crate is the Rust interface of PurRAssist, one engine
with three equal interfaces: the Rust crates (this one), the MCP server and the
CLI (purrassist-cli).
use ;
let schema = compile?;
let answer = schema.recover;
match answer.outcome
# Ok::
Tool-call recovery
tool_call recovers the tool calls of one raw model turn against the OpenAI,
MCP, or Anthropic declarations the model was shown (read byte for byte), with
per-call outcomes, itemized repairs, the turn's finish, and a receipt; it never
executes a call. Twelve dialects ship: qwen3-coder-xml.v1, hermes.v1, openai-tool-calls.v1, llama3-json.v1,
mistral-v3.v1, mistral-v11.v1, deepseek-v3.1.v1, deepseek-v3.v1,
kimi-k2.v1, anthropic-tool-use.v1, harmony.v1, and bare-json.v1.
use Outcome;
use ;
let declarations = r#"[{"type":"function","function":{"name":"get_weather","parameters":{"type":"object","properties":{"city":{"type":"string"}},"required":["city"]}}}]"#;
let tools = from_openai.unwrap;
let turn = br#"[TOOL_CALLS] [{"name": "get_weather", "arguments": {"city": "Oslo"}}]"#;
let result = tools.recover;
let Resolved = result.outcome else ;
assert_eq!;
assert_eq!;
A tool's schema and its typed arguments can come from one Rust struct, through
the purrassist::ToolDefinition and purrassist::ToolEnum derives
(purrassist-derive):
use json;
use ;
/// Search the index.
assert_eq!;
let arguments = parse?;
assert_eq!;
# Ok::
Inspect every result's status and receipt. Validation does not turn an invented value into a fact. Ambiguity and resource exhaustion are explicit outcomes.
Version 0.1.0, with executable conformance, recovery, resource, and portability qualification. Capabilities, known limitations, verification, and provenance are recorded in the qualification record. First-party code is licensed under MIT OR Apache-2.0 OR MulanPSL-2.0.