添加了一点日志
This commit is contained in:
@@ -207,13 +207,6 @@ class CycleProcessor:
|
|||||||
with Timer("规划器", cycle_timers):
|
with Timer("规划器", cycle_timers):
|
||||||
actions, _ = await self.action_planner.plan(mode=mode)
|
actions, _ = await self.action_planner.plan(mode=mode)
|
||||||
|
|
||||||
# 在这里添加日志,清晰地显示最终选择的动作
|
|
||||||
if actions:
|
|
||||||
chosen_actions = [a.get("action_type", "unknown") for a in actions]
|
|
||||||
logger.info(f"{self.log_prefix} LLM最终选择的动作: {chosen_actions}")
|
|
||||||
else:
|
|
||||||
logger.info(f"{self.log_prefix} LLM最终没有选择任何动作")
|
|
||||||
|
|
||||||
async def execute_action(action_info):
|
async def execute_action(action_info):
|
||||||
"""执行单个动作的通用函数"""
|
"""执行单个动作的通用函数"""
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -46,12 +46,12 @@ class PlanFilter:
|
|||||||
try:
|
try:
|
||||||
prompt, used_message_id_list = await self._build_prompt(plan)
|
prompt, used_message_id_list = await self._build_prompt(plan)
|
||||||
plan.llm_prompt = prompt
|
plan.llm_prompt = prompt
|
||||||
logger.debug(f"墨墨在这里加了日志 -> LLM prompt: {prompt}")
|
logger.info(f"规划器原始提示词: {prompt}")
|
||||||
|
|
||||||
llm_content, _ = await self.planner_llm.generate_response_async(prompt=prompt)
|
llm_content, _ = await self.planner_llm.generate_response_async(prompt=prompt)
|
||||||
|
|
||||||
if llm_content:
|
if llm_content:
|
||||||
logger.debug(f"墨墨在这里加了日志 -> LLM a原始返回: {llm_content}")
|
logger.info(f"规划器原始返回: {llm_content}")
|
||||||
parsed_json = orjson.loads(repair_json(llm_content))
|
parsed_json = orjson.loads(repair_json(llm_content))
|
||||||
logger.debug(f"墨墨在这里加了日志 -> 解析后的 JSON: {parsed_json}")
|
logger.debug(f"墨墨在这里加了日志 -> 解析后的 JSON: {parsed_json}")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user