littelchange
This commit is contained in:
2
.env
2
.env
@@ -1,5 +1,5 @@
|
|||||||
# 您不应该修改默认值,这个文件被仓库索引,请修改.env.prod
|
# 您不应该修改默认值,这个文件被仓库索引,请修改.env.prod
|
||||||
ENVIRONMENT=prod
|
ENVIRONMENT=dev
|
||||||
# HOST=127.0.0.1
|
# HOST=127.0.0.1
|
||||||
# PORT=8080
|
# PORT=8080
|
||||||
|
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ class PromptBuilder:
|
|||||||
prompt_info = self.get_prompt_info(message_txt,threshold=0.5)
|
prompt_info = self.get_prompt_info(message_txt,threshold=0.5)
|
||||||
if prompt_info:
|
if prompt_info:
|
||||||
prompt_info = f'''\n----------------------------------------------------\n你有以下这些[知识]:\n{prompt_info}\n请你记住上面的[知识],之后可能会用到\n----------------------------------------------------\n'''
|
prompt_info = f'''\n----------------------------------------------------\n你有以下这些[知识]:\n{prompt_info}\n请你记住上面的[知识],之后可能会用到\n----------------------------------------------------\n'''
|
||||||
promt_info_prompt = '你有一些[知识],在上面可以参考。'
|
# promt_info_prompt = '你有一些[知识],在上面可以参考。'
|
||||||
|
|
||||||
end_time = time.time()
|
end_time = time.time()
|
||||||
print(f"\033[1;32m[知识检索]\033[0m 耗时: {(end_time - start_time):.3f}秒")
|
print(f"\033[1;32m[知识检索]\033[0m 耗时: {(end_time - start_time):.3f}秒")
|
||||||
|
|||||||
@@ -185,6 +185,8 @@ def get_recent_group_detailed_plain_text(db, group_id: int, limit: int = 12,comb
|
|||||||
message_detailed_plain_text = ''
|
message_detailed_plain_text = ''
|
||||||
message_detailed_plain_text_list = []
|
message_detailed_plain_text_list = []
|
||||||
|
|
||||||
|
# 反转消息列表,使最新的消息在最后
|
||||||
|
recent_messages.reverse()
|
||||||
|
|
||||||
if combine:
|
if combine:
|
||||||
for msg_db_data in recent_messages:
|
for msg_db_data in recent_messages:
|
||||||
|
|||||||
@@ -166,8 +166,8 @@ class LLM_request:
|
|||||||
# 发送请求到完整的chat/completions端点
|
# 发送请求到完整的chat/completions端点
|
||||||
api_url = f"{self.base_url.rstrip('/')}/chat/completions"
|
api_url = f"{self.base_url.rstrip('/')}/chat/completions"
|
||||||
|
|
||||||
max_retries = 3
|
max_retries = 2
|
||||||
base_wait_time = 15
|
base_wait_time = 6
|
||||||
|
|
||||||
for retry in range(max_retries):
|
for retry in range(max_retries):
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user