mirror of
https://github.com/katanemo/plano.git
synced 2026-06-17 15:25:17 +02:00
add type check and length checl
This commit is contained in:
parent
8cfef7bcd4
commit
991e336179
1 changed files with 1 additions and 1 deletions
|
|
@ -493,7 +493,7 @@ class ArchFunctionHandler(ArchBaseHandler):
|
|||
total_tokens = estimate_token_length(messages)
|
||||
|
||||
# Trim messages if token count exceeds the limit
|
||||
while total_tokens > max_tokens:
|
||||
while total_tokens > max_tokens and len(messages) >= 3:
|
||||
# Find the first non-system message pair
|
||||
for i in range(len(messages)):
|
||||
if messages[i]["role"] != "system":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue