mirror of
https://github.com/langbot-app/LangBot.git
synced 2025-11-25 11:29:39 +08:00
fix(session.py): 不正确的截取长度
This commit is contained in:
@@ -185,7 +185,7 @@ class Session:
|
||||
if checked_rounds > max_rounds:
|
||||
break
|
||||
|
||||
if len(result_temp) > max_tokens:
|
||||
if int((len(result_temp.encode('utf-8')) - len(result_temp)) / 2 + len(result_temp)) > max_tokens:
|
||||
break
|
||||
|
||||
result = result_temp
|
||||
|
||||
Reference in New Issue
Block a user