mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix: vision tool respects auxiliary.vision.temperature from config (#4661)
The vision tool hardcoded temperature=0.1, ignoring the user's config.yaml setting. This broke providers like Kimi/Moonshot that require temperature=1 for vision models. Now reads temperature from auxiliary.vision.temperature, falling back to 0.1.
This commit is contained in:
parent
e485bc60cd
commit
088bf9057f
1 changed files with 7 additions and 2 deletions
|
|
@ -553,18 +553,23 @@ async def vision_analyze_tool(
|
||||||
# Read timeout from config.yaml (auxiliary.vision.timeout), default 120s.
|
# Read timeout from config.yaml (auxiliary.vision.timeout), default 120s.
|
||||||
# Local vision models (llama.cpp, ollama) can take well over 30s.
|
# Local vision models (llama.cpp, ollama) can take well over 30s.
|
||||||
vision_timeout = 120.0
|
vision_timeout = 120.0
|
||||||
|
vision_temperature = 0.1
|
||||||
try:
|
try:
|
||||||
from hermes_cli.config import load_config
|
from hermes_cli.config import load_config
|
||||||
_cfg = load_config()
|
_cfg = load_config()
|
||||||
_vt = _cfg.get("auxiliary", {}).get("vision", {}).get("timeout")
|
_vision_cfg = _cfg.get("auxiliary", {}).get("vision", {})
|
||||||
|
_vt = _vision_cfg.get("timeout")
|
||||||
if _vt is not None:
|
if _vt is not None:
|
||||||
vision_timeout = float(_vt)
|
vision_timeout = float(_vt)
|
||||||
|
_vtemp = _vision_cfg.get("temperature")
|
||||||
|
if _vtemp is not None:
|
||||||
|
vision_temperature = float(_vtemp)
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
call_kwargs = {
|
call_kwargs = {
|
||||||
"task": "vision",
|
"task": "vision",
|
||||||
"messages": messages,
|
"messages": messages,
|
||||||
"temperature": 0.1,
|
"temperature": vision_temperature,
|
||||||
"max_tokens": 2000,
|
"max_tokens": 2000,
|
||||||
"timeout": vision_timeout,
|
"timeout": vision_timeout,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue