myagent-ai 1.9.7 → 1.9.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agents/main_agent.py +6 -6
- package/package.json +1 -1
package/agents/main_agent.py
CHANGED
|
@@ -551,20 +551,20 @@ class MainAgent(BaseAgent):
|
|
|
551
551
|
)
|
|
552
552
|
|
|
553
553
|
# Step 9: 处理 askuser(askuser 非空时,finish 必为 true)
|
|
554
|
-
if parsed.
|
|
555
|
-
logger.info(f"[{task_id}] 需要询问用户: {parsed.
|
|
556
|
-
context.working_memory["final_response"] = parsed.
|
|
557
|
-
context.working_memory["ask_user"] = parsed.
|
|
554
|
+
if parsed.ask_user:
|
|
555
|
+
logger.info(f"[{task_id}] 需要询问用户: {parsed.ask_user[:100]}")
|
|
556
|
+
context.working_memory["final_response"] = parsed.ask_user
|
|
557
|
+
context.working_memory["ask_user"] = parsed.ask_user
|
|
558
558
|
await self._emit_v2_event(
|
|
559
559
|
"v2_ask_user",
|
|
560
|
-
{"question": parsed.
|
|
560
|
+
{"question": parsed.ask_user},
|
|
561
561
|
stream_callback,
|
|
562
562
|
)
|
|
563
563
|
if self.memory:
|
|
564
564
|
self.memory.add_short_term(
|
|
565
565
|
session_id=context.session_id,
|
|
566
566
|
role="assistant",
|
|
567
|
-
content=parsed.
|
|
567
|
+
content=parsed.ask_user,
|
|
568
568
|
)
|
|
569
569
|
break
|
|
570
570
|
|