mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-28 06:51:16 +08:00
Merge PR #436: fix: use _max_tokens_param in max-iterations retry path
Authored by Farukest. Fixes #435. The retry summary in _handle_max_iterations() hardcoded max_tokens instead of using _max_tokens_param(), which returns max_completion_tokens for direct OpenAI API (required by gpt-4o, o-series). The first attempt already used _max_tokens_param correctly — only the retry path was wrong. Includes 4 tests for _max_tokens_param provider detection.
This commit is contained in:
@@ -2743,7 +2743,7 @@ class AIAgent:
|
||||
"messages": api_messages,
|
||||
}
|
||||
if self.max_tokens is not None:
|
||||
summary_kwargs["max_tokens"] = self.max_tokens
|
||||
summary_kwargs.update(self._max_tokens_param(self.max_tokens))
|
||||
if summary_extra_body:
|
||||
summary_kwargs["extra_body"] = summary_extra_body
|
||||
|
||||
|
||||
Reference in New Issue
Block a user