Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion s08_context_compact/README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def agent_loop(messages, active_request):
except Exception as error:
message = str(error).lower()
too_long = ("prompt_too_long" in message
or "too many tokens" in message)
or "too many tokens / `prompt is too long`" in message)
if too_long and reactive_retries < MAX_REACTIVE_RETRIES:
messages[:] = COMPACTOR.reactive_compact(
messages, active_request)
Expand Down
2 changes: 1 addition & 1 deletion s08_context_compact/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def agent_loop(messages, active_request):
except Exception as error:
message = str(error).lower()
too_long = ("prompt_too_long" in message
or "too many tokens" in message)
or "too many tokens / `prompt is too long`" in message)
if too_long and reactive_retries < MAX_REACTIVE_RETRIES:
messages[:] = COMPACTOR.reactive_compact(
messages, active_request)
Expand Down
2 changes: 1 addition & 1 deletion s08_context_compact/README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def agent_loop(messages, active_request):
except Exception as error:
message = str(error).lower()
too_long = ("prompt_too_long" in message
or "too many tokens" in message)
or "too many tokens / `prompt is too long`" in message)
if too_long and reactive_retries < MAX_REACTIVE_RETRIES:
messages[:] = COMPACTOR.reactive_compact(
messages, active_request)
Expand Down
2 changes: 1 addition & 1 deletion s08_context_compact/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ def agent_loop(messages: list, active_request: str):
reactive_retries = 0
except Exception as error:
too_long = any(text in str(error).lower()
for text in ("prompt_too_long", "too many tokens"))
for text in ("prompt_too_long", "too many tokens", "prompt is too long"))
if too_long and reactive_retries < MAX_REACTIVE_RETRIES:
print("[reactive compact]")
messages[:] = COMPACTOR.reactive_compact(messages, active_request)
Expand Down