main
HuangHai 3 months ago
parent 7b5b89dbf6
commit 5b23f1fb30

@ -370,7 +370,7 @@ class ConnectionHandler:
break break
end_time = time.time() end_time = time.time()
# self.logger.bind(tag=TAG).debug(f"大模型返回时间: {end_time - start_time} 秒, 生成token={content}") self.logger.bind(tag=TAG).debug(f"大模型返回时间: {end_time - start_time} 秒, 生成token={content}")
# 合并当前全部文本并处理未分割部分 # 合并当前全部文本并处理未分割部分
full_text = "".join(response_message) full_text = "".join(response_message)
@ -443,7 +443,7 @@ class ConnectionHandler:
) )
memory_str = future.result() memory_str = future.result()
# self.logger.bind(tag=TAG).info(f"对话记录: {self.dialogue.get_llm_dialogue_with_memory(memory_str)}") self.logger.bind(tag=TAG).info(f"对话记录: {self.dialogue.get_llm_dialogue_with_memory(memory_str)}")
# 使用支持functions的streaming接口 # 使用支持functions的streaming接口
llm_responses = self.llm.response_with_functions( llm_responses = self.llm.response_with_functions(

@ -21,14 +21,13 @@ class LLMProvider(LLMProviderBase):
if self.is_No_prompt: if self.is_No_prompt:
dialogue.pop(0) dialogue.pop(0)
logger.bind(tag=TAG).debug(f"【阿里百练API服务】处理后的dialogue: {dialogue}") logger.bind(tag=TAG).debug(f"【阿里百练API服务】处理后的dialogue: {dialogue}")
# 构造调用参数 # 构造调用参数
call_params = { call_params = {
"api_key": self.api_key, "api_key": self.api_key,
"app_id": self.app_id, "app_id": self.app_id,
"session_id": session_id, "session_id": session_id,
"messages": dialogue, "messages": dialogue,
"model" : "qwen-plus" "model": "qwen-plus"
} }
if self.memory_id != False: if self.memory_id != False:
# 百练memory需要prompt参数 # 百练memory需要prompt参数

Loading…
Cancel
Save