From 219ef122f463c600b3fdf7584a0b4d12b9e88eed Mon Sep 17 00:00:00 2001 From: Chill Date: Tue, 25 Apr 2023 12:36:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E9=99=90=E5=88=B6prompt=E9=95=BF?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app_chatgpt/models/mail_channel.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app_chatgpt/models/mail_channel.py b/app_chatgpt/models/mail_channel.py index a8d654de..21cb7745 100644 --- a/app_chatgpt/models/mail_channel.py +++ b/app_chatgpt/models/mail_channel.py @@ -198,9 +198,9 @@ class Channel(models.Model): if c_history: messages += c_history messages.append({"role": "user", "content": msg}) - msg_len = sum(len(str(m)) for m in messages) - if msg_len * 2 >= ai.max_tokens * 0.6: - messages = [{"role": "user", "content": msg}] + # msg_len = sum(len(str(m)) for m in messages) + # if msg_len * 2 >= 2049: + # messages = [{"role": "user", "content": msg}] if sync_config == 'sync': self.get_ai_response(ai, messages, channel, user_id, message) else: