mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
Merge pull request #1149 from NousResearch/hermes/hermes-d28bf447
feat: Agentic On-Policy Distillation (OPD) environment
This commit is contained in:
commit
c097e56142
3 changed files with 1229 additions and 0 deletions
|
|
@ -329,10 +329,15 @@ def normalize_model_name(model: str) -> str:
|
||||||
"""Normalize a model name for the Anthropic API.
|
"""Normalize a model name for the Anthropic API.
|
||||||
|
|
||||||
- Strips 'anthropic/' prefix (OpenRouter format, case-insensitive)
|
- Strips 'anthropic/' prefix (OpenRouter format, case-insensitive)
|
||||||
|
- Converts dots to hyphens in version numbers (OpenRouter uses dots,
|
||||||
|
Anthropic uses hyphens: claude-opus-4.6 → claude-opus-4-6)
|
||||||
"""
|
"""
|
||||||
lower = model.lower()
|
lower = model.lower()
|
||||||
if lower.startswith("anthropic/"):
|
if lower.startswith("anthropic/"):
|
||||||
model = model[len("anthropic/"):]
|
model = model[len("anthropic/"):]
|
||||||
|
# OpenRouter uses dots for version separators (claude-opus-4.6),
|
||||||
|
# Anthropic uses hyphens (claude-opus-4-6). Convert dots to hyphens.
|
||||||
|
model = model.replace(".", "-")
|
||||||
return model
|
return model
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
1213
environments/agentic_opd_env.py
Normal file
1213
environments/agentic_opd_env.py
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -358,6 +358,17 @@ class TestNormalizeModelName:
|
||||||
def test_leaves_bare_name(self):
|
def test_leaves_bare_name(self):
|
||||||
assert normalize_model_name("claude-sonnet-4-20250514") == "claude-sonnet-4-20250514"
|
assert normalize_model_name("claude-sonnet-4-20250514") == "claude-sonnet-4-20250514"
|
||||||
|
|
||||||
|
def test_converts_dots_to_hyphens(self):
|
||||||
|
"""OpenRouter uses dots (4.6), Anthropic uses hyphens (4-6)."""
|
||||||
|
assert normalize_model_name("anthropic/claude-opus-4.6") == "claude-opus-4-6"
|
||||||
|
assert normalize_model_name("anthropic/claude-sonnet-4.5") == "claude-sonnet-4-5"
|
||||||
|
assert normalize_model_name("claude-opus-4.6") == "claude-opus-4-6"
|
||||||
|
|
||||||
|
def test_already_hyphenated_unchanged(self):
|
||||||
|
"""Names already in Anthropic format should pass through."""
|
||||||
|
assert normalize_model_name("claude-opus-4-6") == "claude-opus-4-6"
|
||||||
|
assert normalize_model_name("claude-opus-4-5-20251101") == "claude-opus-4-5-20251101"
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Tool conversion
|
# Tool conversion
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue