From 1b0ae8da58d8a438c306b5d892773dc4f0e0be3c Mon Sep 17 00:00:00 2001 From: RockChinQ <1010553892@qq.com> Date: Sat, 5 Aug 2023 22:00:32 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20session=20append=E9=87=8D=E5=91=BD?= =?UTF-8?q?=E5=90=8D=E4=B8=BAquery?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/openai/session.py | 2 +- pkg/qqbot/message.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/openai/session.py b/pkg/openai/session.py index dd2b0d2..6bf13dc 100644 --- a/pkg/openai/session.py +++ b/pkg/openai/session.py @@ -194,7 +194,7 @@ class Session: # 请求回复 # 这个函数是阻塞的 - def append(self, text: str=None) -> tuple[str, str, list[str]]: + def query(self, text: str=None) -> tuple[str, str, list[str]]: """向session中添加一条消息,返回接口回复 Args: diff --git a/pkg/qqbot/message.py b/pkg/qqbot/message.py index 354c818..309632f 100644 --- a/pkg/qqbot/message.py +++ b/pkg/qqbot/message.py @@ -40,7 +40,7 @@ def process_normal_message(text_message: str, mgr, config, launcher_type: str, try: prefix = "[GPT]" if config.show_prefix else "" - text, finish_reason, funcs = session.append(text_message) + text, finish_reason, funcs = session.query(text_message) # 触发插件事件 args = {