mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
add length eviction if no compression
This commit is contained in:
parent
d988343570
commit
721e0b96cd
1 changed files with 9 additions and 0 deletions
|
|
@ -7059,6 +7059,15 @@ class AIAgent:
|
||||||
finish_reason = response.choices[0].finish_reason
|
finish_reason = response.choices[0].finish_reason
|
||||||
|
|
||||||
if finish_reason == "length":
|
if finish_reason == "length":
|
||||||
|
if not self.compression_enabled:
|
||||||
|
return {
|
||||||
|
"final_response": None,
|
||||||
|
"messages": messages,
|
||||||
|
"api_calls": api_call_count,
|
||||||
|
"completed": False,
|
||||||
|
"partial": True,
|
||||||
|
"error": "Response truncated due to output length limit",
|
||||||
|
}
|
||||||
self._vprint(f"{self.log_prefix}⚠️ Response truncated (finish_reason='length') - model hit max output tokens", force=True)
|
self._vprint(f"{self.log_prefix}⚠️ Response truncated (finish_reason='length') - model hit max output tokens", force=True)
|
||||||
|
|
||||||
# ── Detect thinking-budget exhaustion ──────────────
|
# ── Detect thinking-budget exhaustion ──────────────
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue