mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-16 07:20:59 +00:00
perf: 不再支持限制提交的消息的回合数
This commit is contained in:
@@ -17,7 +17,7 @@
|
|||||||
<summary>✅回复符合上下文</summary>
|
<summary>✅回复符合上下文</summary>
|
||||||
|
|
||||||
- 程序向模型发送近几次对话内容,模型根据上下文生成回复
|
- 程序向模型发送近几次对话内容,模型根据上下文生成回复
|
||||||
- 您可在`config.py`中修改`prompt_submit_round_amount`及`process_message_timeout`自定义联系上下文的范围
|
- 您可在`config.py`中修改`process_message_timeout`自定义联系上下文的范围
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
|||||||
@@ -66,11 +66,6 @@ completion_api_params = {
|
|||||||
# 注意:较大的prompt_submit_length会导致OpenAI账户额度消耗更快
|
# 注意:较大的prompt_submit_length会导致OpenAI账户额度消耗更快
|
||||||
prompt_submit_length = 1536
|
prompt_submit_length = 1536
|
||||||
|
|
||||||
# 每次向OpenAI接口发送对话记录上下文的聊天回合数
|
|
||||||
# 不建议过大,向OpenAI接口发送对话上下文时保证内容不超过prompt_submit_length个字符,
|
|
||||||
# 不超过prompt_submit_round_amount个回合
|
|
||||||
prompt_submit_round_amount = 16
|
|
||||||
|
|
||||||
# 消息处理的超时时间,单位为秒
|
# 消息处理的超时时间,单位为秒
|
||||||
process_message_timeout = 15
|
process_message_timeout = 15
|
||||||
|
|
||||||
|
|||||||
@@ -139,7 +139,8 @@ class Session:
|
|||||||
def append(self, text: str) -> str:
|
def append(self, text: str) -> str:
|
||||||
self.last_interact_timestamp = int(time.time())
|
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
|
max_length = config.prompt_submit_length if hasattr(config, "prompt_submit_length") else 1024
|
||||||
|
|
||||||
# 向API请求补全
|
# 向API请求补全
|
||||||
|
|||||||
Reference in New Issue
Block a user