mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-10 03:22:05 +00:00
fix(models): prefer image modalities for vision routing
This commit is contained in:
parent
6e46f99e7e
commit
14f38822fa
3 changed files with 39 additions and 6 deletions
|
|
@ -223,6 +223,13 @@ CAPS_REGISTRY = {
|
|||
"tool_call": True,
|
||||
"limit": {"context": 32000, "output": 8192},
|
||||
},
|
||||
"text-only-with-stale-attachment": {
|
||||
"id": "text-only-with-stale-attachment",
|
||||
"attachment": True,
|
||||
"tool_call": True,
|
||||
"modalities": {"input": ["text"]},
|
||||
"limit": {"context": 128000, "output": 8192},
|
||||
},
|
||||
},
|
||||
},
|
||||
"anthropic": {
|
||||
|
|
@ -243,7 +250,7 @@ class TestGetModelCapabilities:
|
|||
"""Tests for get_model_capabilities vision detection."""
|
||||
|
||||
def test_vision_from_attachment_flag(self):
|
||||
"""Models with attachment=True should report supports_vision=True."""
|
||||
"""Models with attachment=True and no modalities should report supports_vision=True."""
|
||||
with patch("agent.models_dev.fetch_models_dev", return_value=CAPS_REGISTRY):
|
||||
caps = get_model_capabilities("anthropic", "claude-sonnet-4")
|
||||
assert caps is not None
|
||||
|
|
@ -257,6 +264,13 @@ class TestGetModelCapabilities:
|
|||
assert caps is not None
|
||||
assert caps.supports_vision is True
|
||||
|
||||
def test_text_only_modalities_override_stale_attachment_flag(self):
|
||||
"""Text-only modalities must win over stale attachment=True metadata."""
|
||||
with patch("agent.models_dev.fetch_models_dev", return_value=CAPS_REGISTRY):
|
||||
caps = get_model_capabilities("google", "text-only-with-stale-attachment")
|
||||
assert caps is not None
|
||||
assert caps.supports_vision is False
|
||||
|
||||
def test_no_vision_without_attachment_or_modalities(self):
|
||||
"""Models with neither attachment nor image modality should be non-vision."""
|
||||
with patch("agent.models_dev.fetch_models_dev", return_value=CAPS_REGISTRY):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue