mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-04 21:32:38 +02:00
fix bug
This commit is contained in:
parent
c0867643d8
commit
d112371dad
1 changed files with 1 additions and 1 deletions
|
|
@ -25,7 +25,7 @@ def reduce_message_length(
|
|||
"""
|
||||
max_token = TOKEN_MAX.get(model_name, 2048) - count_string_tokens(system_text, model_name) - reserved
|
||||
for msg in msgs:
|
||||
if count_string_tokens(msg, model_name) < max_token:
|
||||
if count_string_tokens(msg, model_name) < max_token or model_name not in TOKEN_MAX:
|
||||
return msg
|
||||
|
||||
raise RuntimeError("fail to reduce message length")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue