Skip to content

Latest commit

 

History

History
57 lines (41 loc) · 2.09 KB

File metadata and controls

57 lines (41 loc) · 2.09 KB

verdict-code

An interactive opencode-like CLI assistant that demonstrates the verdict Rust agent framework.

Every user message is processed through a real verdict Pipeline — with AgentSteps, Guards, Verdicts, registered Tools, and Skills.

Features

  • 3-step pipeline per message: classify intent (Haiku) → generate response (Sonnet) → safety check
  • 4 custom tools registered in a ToolRegistry via FunctionTool: word_count, char_count, reverse_string, to_uppercase
  • 5 built-in skills registered in a SkillRegistry: code_review, test_writing, refactoring, rust_debugging, api_design
  • Tool-assisted pipeline: type "count", "reverse", or "uppercase" to trigger a 4th ToolCall step automatically
  • Readline input with history (rustyline)
  • Colored output (colored)

Slash Commands

Command Description
/tools Run a demo pipeline with all 4 tools and print results
/skills List registered skills and run a code_review demo
/model <haiku|sonnet> Switch the active model
/clear Clear conversation history
/help Show all commands
/quit Exit

Setup

Requires an OpenAI-compatible LLM endpoint. Edit the constants in src/main.rs:

const BASE_URL: &str = "http://your-endpoint/v1";
const API_KEY: &str  = "your-api-key";

Then:

cargo run

What it demonstrates

This demo shows how verdict is meant to be used:

  • StepAction::LlmCall with per-step ProviderSpec model routing
  • StepAction::Custom with tokio::task::block_in_place for async LLM calls
  • StepAction::ToolCall with ToolSet::Allow scoping
  • StepAction::UseSkill with SkillMode::Pipeline
  • Guard::AllOf, Guard::NonEmptyOutput, Guard::NoSecretsInOutput
  • Verdict::Automated
  • PipelineRunner with wired ToolRegistry and SkillRegistry

Related