mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-15 09:31:21 +00:00
feat: raise the default tool-call iteration limit per response to 1024 (#33384)
With native function calling, each model turn that calls tools counts as one iteration, and a single response was stopped with "Tool-call limit reached (256 iterations)." after 256 of them. The CHAT_RESPONSE_MAX_TOOL_CALL_ITERATIONS environment variable now defaults to 1024, also when it is set empty or to something that is not a number, and the error shows the new number. A model stuck calling tools in a loop now runs up to 1024 iterations before it is stopped; setting the variable to 256 keeps the old limit, and -1 still means no limit.
This commit is contained in:
parent
8650cd2dd5
commit
9f33c966c9
1 changed files with 3 additions and 3 deletions
|
|
@ -1128,16 +1128,16 @@ else:
|
|||
# The old CHAT_RESPONSE_MAX_TOOL_CALL_RETRIES name is accepted as a fallback.
|
||||
CHAT_RESPONSE_MAX_TOOL_CALL_ITERATIONS = os.getenv(
|
||||
'CHAT_RESPONSE_MAX_TOOL_CALL_ITERATIONS',
|
||||
os.getenv('CHAT_RESPONSE_MAX_TOOL_CALL_RETRIES', '256'),
|
||||
os.getenv('CHAT_RESPONSE_MAX_TOOL_CALL_RETRIES', '1024'),
|
||||
)
|
||||
|
||||
if CHAT_RESPONSE_MAX_TOOL_CALL_ITERATIONS == '':
|
||||
CHAT_RESPONSE_MAX_TOOL_CALL_ITERATIONS = 256
|
||||
CHAT_RESPONSE_MAX_TOOL_CALL_ITERATIONS = 1024
|
||||
else:
|
||||
try:
|
||||
CHAT_RESPONSE_MAX_TOOL_CALL_ITERATIONS = int(CHAT_RESPONSE_MAX_TOOL_CALL_ITERATIONS)
|
||||
except Exception:
|
||||
CHAT_RESPONSE_MAX_TOOL_CALL_ITERATIONS = 256
|
||||
CHAT_RESPONSE_MAX_TOOL_CALL_ITERATIONS = 1024
|
||||
|
||||
# -1 means unlimited (no cap).
|
||||
if CHAT_RESPONSE_MAX_TOOL_CALL_ITERATIONS == -1:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue