perf: 不再支持限制提交的消息的回合数

This commit is contained in:
Rock Chin
2022-12-19 15:44:37 +08:00
parent 03a5f15a58
commit 6120805853
3 changed files with 3 additions and 7 deletions

View File

@@ -17,7 +17,7 @@
<summary>✅回复符合上下文</summary>
- 程序向模型发送近几次对话内容,模型根据上下文生成回复
- 您可在`config.py`中修改`prompt_submit_round_amount``process_message_timeout`自定义联系上下文的范围
- 您可在`config.py`中修改`process_message_timeout`自定义联系上下文的范围
</details>

View File

@@ -66,11 +66,6 @@ completion_api_params = {
# 注意较大的prompt_submit_length会导致OpenAI账户额度消耗更快
prompt_submit_length = 1536
# 每次向OpenAI接口发送对话记录上下文的聊天回合数
# 不建议过大向OpenAI接口发送对话上下文时保证内容不超过prompt_submit_length个字符
# 不超过prompt_submit_round_amount个回合
prompt_submit_round_amount = 16
# 消息处理的超时时间,单位为秒
process_message_timeout = 15

View File

@@ -139,7 +139,8 @@ class Session:
def append(self, text: str) -> str:
self.last_interact_timestamp = int(time.time())
max_rounds = config.prompt_submit_round_amount if hasattr(config, 'prompt_submit_round_amount') else 7
# max_rounds = config.prompt_submit_round_amount if hasattr(config, 'prompt_submit_round_amount') else 7
max_rounds = 1000 # 不再限制回合数
max_length = config.prompt_submit_length if hasattr(config, "prompt_submit_length") else 1024
# 向API请求补全