fix:统一llm请求函数,改动模型名称

This commit is contained in:
SengokuCola
2025-06-04 23:27:24 +08:00
parent 077b67fa60
commit 4ebfca096c
17 changed files with 116 additions and 187 deletions

View File

@@ -18,14 +18,14 @@ class NormalChatGenerator:
def __init__(self):
# TODO: API-Adapter修改标记
self.model_reasoning = LLMRequest(
model=global_config.model.normal_chat_1,
model=global_config.model.replyer_1,
# temperature=0.7,
max_tokens=3000,
request_type="normal.chat_1",
)
self.model_normal = LLMRequest(
model=global_config.model.normal_chat_2,
# temperature=global_config.model.normal_chat_2["temp"],
model=global_config.model.replyer_2,
# temperature=global_config.model.replyer_2["temp"],
max_tokens=256,
request_type="normal.chat_2",
)
@@ -103,7 +103,7 @@ class NormalChatGenerator:
logger.debug(f"构建prompt时间: {t_build_prompt.human_readable}")
try:
content, reasoning_content, self.current_model_name = await model.generate_response(prompt)
content, (reasoning_content, model_name) = await model.generate_response_async(prompt)
logger.debug(f"prompt:{prompt}\n生成回复:{content}")
@@ -147,7 +147,7 @@ class NormalChatGenerator:
"""
# 调用模型生成结果
result, _, _ = await self.model_sum.generate_response(prompt)
result, (reasoning_content, model_name) = await self.model_sum.generate_response_async(prompt)
result = result.strip()
# 解析模型输出的结果

View File

@@ -148,10 +148,12 @@ class NormalChatPlanner:
# 使用LLM生成动作决策
try:
content, reasoning_content, model_name = await self.planner_llm.generate_response(prompt)
content, (reasoning_content, model_name) = await self.planner_llm.generate_response_async(prompt)
logger.info(f"{self.log_prefix}规划器原始提示词: {prompt}")
logger.info(f"{self.log_prefix}规划器原始响应: {content}")
logger.info(f"{self.log_prefix}规划器推理: {reasoning_content}")
logger.info(f"{self.log_prefix}规划器模型: {model_name}")
# 解析JSON响应
try: