mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-05 02:31:47 +00:00
fix(api-server): pass fallback_model to AIAgent (#4954)
The API server platform never passed fallback_model to AIAgent(), so the fallback provider chain was always empty for requests through the OpenAI-compatible endpoint. Load it via GatewayApp._load_fallback_model() to match the behavior of Telegram/Discord/Slack platforms.
This commit is contained in:
parent
7f853ba7b6
commit
507b63f86b
1 changed files with 6 additions and 0 deletions
|
|
@ -421,6 +421,11 @@ class APIServerAdapter(BasePlatformAdapter):
|
|||
|
||||
max_iterations = int(os.getenv("HERMES_MAX_ITERATIONS", "90"))
|
||||
|
||||
# Load fallback provider chain so the API server platform has the
|
||||
# same fallback behaviour as Telegram/Discord/Slack (fixes #4954).
|
||||
from gateway.run import GatewayApp
|
||||
fallback_model = GatewayApp._load_fallback_model()
|
||||
|
||||
agent = AIAgent(
|
||||
model=model,
|
||||
**runtime_kwargs,
|
||||
|
|
@ -434,6 +439,7 @@ class APIServerAdapter(BasePlatformAdapter):
|
|||
stream_delta_callback=stream_delta_callback,
|
||||
tool_progress_callback=tool_progress_callback,
|
||||
session_db=self._ensure_session_db(),
|
||||
fallback_model=fallback_model,
|
||||
)
|
||||
return agent
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue