mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-10-19 15:33:54 +00:00
Tighten optional Vision Model configuration
This commit is contained in:
parent
2c09a4ed72
commit
8d1c76e654
2 changed files with 5 additions and 4 deletions
|
|
@ -277,9 +277,6 @@ def _clean_preset_for_file(preset: dict) -> dict:
|
|||
slot_config = preset.get(slot)
|
||||
if isinstance(slot_config, dict):
|
||||
slot_clean = _strip_ui_fields(slot_config, strip_api_key=True)
|
||||
if slot == "vision" and _slot_has_identity(slot_clean):
|
||||
slot_clean["vision"] = True
|
||||
slot_clean.setdefault("max_embeds", 10)
|
||||
cleaned[slot] = (
|
||||
slot_clean
|
||||
if name == DEFAULT_PRESET_NAME
|
||||
|
|
@ -762,7 +759,9 @@ def get_vision_model_config(agent=None) -> dict:
|
|||
"""Get the active Vision Model config after applying Main-first routing."""
|
||||
cfg = get_effective_config(agent)
|
||||
vision_cfg = cfg.get("vision_model", {})
|
||||
if not _slot_has_identity(vision_cfg):
|
||||
if not all(
|
||||
str(vision_cfg.get(key) or "").strip() for key in ("provider", "name")
|
||||
):
|
||||
return {}
|
||||
chat_cfg = cfg.get("chat_model", {})
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -143,6 +143,8 @@ def test_active_vision_model_route_prefers_main_native_vision(monkeypatch):
|
|||
|
||||
cases = [
|
||||
({"vision": False}, {}, False),
|
||||
({"vision": False}, {"provider": "p"}, False),
|
||||
({"vision": False}, {"name": "v"}, False),
|
||||
({"vision": True}, {"provider": "p", "name": "v"}, False),
|
||||
({"vision": False}, {"provider": "p", "name": "v"}, True),
|
||||
(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue