mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-26 01:01:40 +00:00
Add comprehensive skill for building, testing, and debugging Hermes Agent RL environments for Atropos training. Includes: - SKILL.md: Full guide covering HermesAgentBaseEnv interface, required methods, config class, CLI modes (serve/process/evaluate), reward function patterns, common pitfalls, and minimum implementation checklist - New 'Inference Setup' section: instructs the agent to always ask the user for their inference provider (OpenRouter + model choice, self-hosted VLLM endpoint, or other OpenAI-compatible API) before running tests - references/agentresult-fields.md: AgentResult dataclass field reference - references/atropos-base-env.md: Atropos BaseEnv API reference - references/usage-patterns.md: Step-by-step patterns for process, evaluate, serve, and smoke test modes Will be auto-synced to ~/.hermes/skills/ via skills_sync.
59 lines
2 KiB
Markdown
59 lines
2 KiB
Markdown
# AgentResult Fields Reference
|
|
|
|
`AgentResult` is defined in `environments/agent_loop.py` as a dataclass.
|
|
|
|
## Fields
|
|
|
|
| Field | Type | Description |
|
|
|-------|------|-------------|
|
|
| `messages` | `List[Dict[str, Any]]` | Full conversation history in OpenAI message format |
|
|
| `managed_state` | `Optional[Dict]` | ManagedServer.get_state() if Phase 2, else None |
|
|
| `turns_used` | `int` | Number of LLM calls made during the loop |
|
|
| `finished_naturally` | `bool` | True if model stopped calling tools on its own |
|
|
| `reasoning_per_turn` | `List[Optional[str]]` | Extracted reasoning content per turn |
|
|
| `tool_errors` | `List[ToolError]` | Tool errors encountered during the loop |
|
|
|
|
## ToolError Fields
|
|
|
|
| Field | Type | Description |
|
|
|-------|------|-------------|
|
|
| `turn` | `int` | Which turn the error occurred |
|
|
| `tool_name` | `str` | Name of the tool that failed |
|
|
| `arguments` | `str` | Arguments passed to the tool |
|
|
| `error` | `str` | Error message |
|
|
| `tool_result` | `str` | The result returned to the model |
|
|
|
|
## Extracting Data from Messages
|
|
|
|
Messages follow OpenAI format. Common patterns:
|
|
|
|
```python
|
|
# Get final assistant response
|
|
for msg in reversed(result.messages):
|
|
if msg.get("role") == "assistant" and msg.get("content"):
|
|
final_response = msg["content"]
|
|
break
|
|
|
|
# Get all tool names used
|
|
tools = []
|
|
for msg in result.messages:
|
|
if msg.get("role") == "assistant" and msg.get("tool_calls"):
|
|
for tc in msg["tool_calls"]:
|
|
fn = tc.get("function", {}) if isinstance(tc, dict) else {}
|
|
tools.append(fn.get("name", ""))
|
|
|
|
# Get tool results
|
|
for msg in result.messages:
|
|
if msg.get("role") == "tool":
|
|
tool_output = msg.get("content", "")
|
|
call_id = msg.get("tool_call_id", "")
|
|
```
|
|
|
|
## Fields that DO NOT EXIST
|
|
|
|
These are common mistakes — AgentResult does NOT have:
|
|
- `final_response` — extract from messages
|
|
- `tool_calls` — extract from messages
|
|
- `tools_used` — extract from messages
|
|
- `output` — extract from messages
|
|
- `response` — extract from messages
|