|
| 1 | +--- |
| 2 | +title: "Agent Testing" |
| 3 | +description: "Test your agents with beautiful output and interactive options." |
| 4 | +--- |
| 5 | + |
| 6 | +# Agent Test Command |
| 7 | + |
| 8 | +The `knowrithm agent test` command provides a beautiful, user-friendly testing experience with rich formatting and interactive chat capabilities. |
| 9 | + |
| 10 | +## New Features |
| 11 | + |
| 12 | +### 1. Beautiful Output Formatting |
| 13 | + |
| 14 | +Instead of showing raw JSON in a table, the test results are now displayed in a clean, organized format: |
| 15 | + |
| 16 | +``` |
| 17 | +🧪 Testing agent 'Knowrithm Support'... |
| 18 | +
|
| 19 | +🤖 Agent: Knowrithm Support |
| 20 | +Model: google/gemini-2.5-flash |
| 21 | +
|
| 22 | +❓ Query: |
| 23 | +╭─────────────────────────────────────────────────────────╮ |
| 24 | +│ Hello, can you introduce yourself? │ |
| 25 | +╰─────────────────────────────────────────────────────────╯ |
| 26 | +
|
| 27 | +💬 Response: |
| 28 | +╭─────────────────────────────────────────────────────────╮ |
| 29 | +│ Hello! I'm Knowrithm Support, a professional AI │ |
| 30 | +│ assistant designed to provide accurate and helpful │ |
| 31 | +│ information. │ |
| 32 | +│ │ |
| 33 | +│ Knowrithm offers a platform where the same governance, │ |
| 34 | +│ telemetry, and knowledge layer travel with you [Source │ |
| 35 | +│ 1]... │ |
| 36 | +╰─────────────────────────────────────────────────────────╯ |
| 37 | +
|
| 38 | +📚 Sources (1): |
| 39 | + # Source Cited |
| 40 | + ───────────────────────────────────────────────────── |
| 41 | + 1 https://www.knowrithm.org/ ✓ |
| 42 | +
|
| 43 | +ℹ️ Metadata: |
| 44 | + Total Sources 1 |
| 45 | + Cited Sources 1 |
| 46 | +
|
| 47 | +✅ Test completed successfully! |
| 48 | +``` |
| 49 | + |
| 50 | +### 2. Interactive Chat Session |
| 51 | + |
| 52 | +New `--interactive` (or `-i`) flag allows you to start a chat session immediately after testing: |
| 53 | + |
| 54 | +```bash |
| 55 | +# Test and automatically start chat |
| 56 | +knowrithm agent test --interactive |
| 57 | + |
| 58 | +# Or with short flag |
| 59 | +knowrithm agent test -i |
| 60 | +``` |
| 61 | + |
| 62 | +After the test completes, you'll be prompted: |
| 63 | +``` |
| 64 | +💬 Would you like to start an interactive chat session with this agent? (Y/n) |
| 65 | +``` |
| 66 | + |
| 67 | +If you select "Yes", it will: |
| 68 | +1. Create a new conversation |
| 69 | +2. Launch the interactive chat interface |
| 70 | +3. Allow you to continue chatting with the agent |
| 71 | + |
| 72 | +### 3. Rich Spinner Animation |
| 73 | + |
| 74 | +While the agent is processing, you'll see an animated spinner: |
| 75 | +``` |
| 76 | +⠋ Agent is thinking... |
| 77 | +``` |
| 78 | + |
| 79 | +## Usage Examples |
| 80 | + |
| 81 | +### Basic Test |
| 82 | +```bash |
| 83 | +# Test with default query |
| 84 | +knowrithm agent test |
| 85 | + |
| 86 | +# Test with custom query |
| 87 | +knowrithm agent test --query "What are your pricing plans?" |
| 88 | + |
| 89 | +# Test specific agent |
| 90 | +knowrithm agent test "Support Bot" --query "Hello" |
| 91 | +``` |
| 92 | + |
| 93 | +### Interactive Mode |
| 94 | +```bash |
| 95 | +# Test and start chat session |
| 96 | +knowrithm agent test --interactive |
| 97 | + |
| 98 | +# Test with custom query and start chat |
| 99 | +knowrithm agent test -q "Hello" -i |
| 100 | + |
| 101 | +# Test specific agent and start chat |
| 102 | +knowrithm agent test "Sales Bot" --interactive |
| 103 | +``` |
| 104 | + |
| 105 | +### Different Output Formats |
| 106 | +```bash |
| 107 | +# JSON format (raw data) |
| 108 | +knowrithm agent test --format json |
| 109 | + |
| 110 | +# YAML format |
| 111 | +knowrithm agent test --format yaml |
| 112 | + |
| 113 | +# Table format (default, with beautiful formatting) |
| 114 | +knowrithm agent test --format table |
| 115 | +``` |
0 commit comments