* feat: add set peer card to SDK, bump version, document * fix: pytest -> pytest -x * chore: deprecate .card(), move to .getCard() / .get_card() * fix: get_or_create when crudding peer cards * chore: review nits * chore: document .get_card / .set_card * chore: (docs) update language from deriver to dreamer agent * fix: get_peer_card should not create peer/workspace * fix: change api contract to return ResourceNotFoundException (#375) * fix: PR nitpicks --------- Co-authored-by: Vineeth Voruganti <13438633+VVoruganti@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| test_cases | ||
| README.md | ||
| run.py | ||
| runner.py | ||
| schema.py | ||
README.md
Unified Honcho Test System
This system allows for defining comprehensive, step-based tests for Honcho in a unified JSON format. It supports testing configuration hierarchy, multi-turn interactions, and complex assertions including LLM-as-a-judge.
Running Tests
# Run all tests in the test_cases directory
python -m tests.unified.run
# Run a specific test file
python -m tests.unified.run --test-dir tests/unified/test_cases
Test Schema
Tests are defined in JSON files. A test definition consists of a name, optional description, and a list of steps.
Structure
{
"name": "my_test",
"workspace_config": { ... },
"steps": [
{ "step_type": "..." },
...
]
}
Actions
-
Configuration:
set_workspace_config: Update workspace settings.set_session_config: Update session settings.
-
Interaction:
create_session: Create a new session, optionally with peers and config.add_message: Add a single message.add_messages: Add multiple messages.
-
Waiting:
wait: Wait for duration or "queue_empty".
-
Querying & Assertions:
query: Perform an action and assert on the result.target: "chat", "get_context", "get_peer_card", "get_representation"
Assertions
llm_judge: Use Claude to evaluate the result against a natural language prompt.contains/not_contains: Substring matching.exact_match: Strict equality.json_match: specific key-value checks.
Example
{
"name": "demo_config_flow",
"steps": [
{
"step_type": "create_session",
"session_id": "s1",
"peer_configs": {
"user": { "observe_me": true },
"agent": { "observe_others": true }
}
},
{
"step_type": "add_message",
"session_id": "s1",
"peer_id": "user",
"content": "My name is Alice."
},
{
"step_type": "wait",
"target": "queue_empty"
},
{
"step_type": "query",
"target": "chat",
"peer_id": "agent",
"session_id": "s1",
"input": "Who am I?",
"assertions": [
{
"assertion_type": "contains",
"text": "Alice"
}
]
}
]
}