Merge PR #83: [moz] fix(spawner): PromptContext event_type/event_data 缺失修复
This commit was merged in pull request #83.
This commit is contained in:
@@ -288,6 +288,8 @@ class AgentSpawner:
|
||||
mail_type = ""
|
||||
action_type = ""
|
||||
action_steps = []
|
||||
event_type = ""
|
||||
event_data = {}
|
||||
try:
|
||||
meta = json.loads(must_haves) if must_haves else {}
|
||||
from_agent = meta.get("from", "")
|
||||
@@ -295,6 +297,8 @@ class AgentSpawner:
|
||||
# toolchain 字段提取
|
||||
action_type = meta.get("action_type", "")
|
||||
action_steps = meta.get("steps", [])
|
||||
event_type = meta.get("event_type", "")
|
||||
event_data = meta.get("context", {})
|
||||
except Exception:
|
||||
pass
|
||||
ctx = PromptContext(
|
||||
@@ -304,6 +308,7 @@ class AgentSpawner:
|
||||
spawn_type=spawn_type,
|
||||
from_agent=from_agent, mail_type=mail_type,
|
||||
action_type=action_type, action_steps=action_steps,
|
||||
event_type=event_type, event_data=event_data,
|
||||
)
|
||||
return handler.build_prompt(ctx)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user