refactor(workflow): simplify edge configuration
This commit is contained in:
@@ -2393,7 +2393,6 @@ class WorkflowBrainTests(unittest.IsolatedAsyncioTestCase):
|
||||
"mode": "llm",
|
||||
"priority": 10,
|
||||
"condition": "需求已收集",
|
||||
"transitionSpeech": "正在为你结束流程",
|
||||
},
|
||||
}
|
||||
],
|
||||
@@ -2569,29 +2568,6 @@ class WorkflowBrainTests(unittest.IsolatedAsyncioTestCase):
|
||||
self.assertTrue(call_end.ending)
|
||||
self.assertTrue(call_end.armed)
|
||||
self.assertTrue(any(getattr(frame, "text", "") == "感谢来电" for frame in queued))
|
||||
transition_context_frames = [
|
||||
frame
|
||||
for frame in worker.frames
|
||||
if isinstance(frame, LLMMessagesAppendFrame)
|
||||
and frame.messages
|
||||
== [
|
||||
{
|
||||
"role": "system",
|
||||
"content": (
|
||||
f"{FIXED_SPEECH_CONTEXT_MARKER}\n正在为你结束流程"
|
||||
),
|
||||
}
|
||||
]
|
||||
]
|
||||
self.assertTrue(transition_context_frames)
|
||||
transition_events = [
|
||||
frame.message
|
||||
for frame in queued
|
||||
if isinstance(frame, OutputTransportMessageUrgentFrame)
|
||||
and frame.message.get("source") == "workflow-edge-transition"
|
||||
]
|
||||
self.assertEqual(transition_events[0]["content"], "正在为你结束流程")
|
||||
self.assertEqual(transition_events[0]["nodeId"], "end")
|
||||
assistant_transcripts = [
|
||||
frame.message.get("content")
|
||||
for frame in queued
|
||||
@@ -2601,11 +2577,7 @@ class WorkflowBrainTests(unittest.IsolatedAsyncioTestCase):
|
||||
]
|
||||
self.assertEqual(
|
||||
assistant_transcripts,
|
||||
["正在为你结束流程", "感谢来电"],
|
||||
)
|
||||
self.assertIn(
|
||||
"正在为你结束流程",
|
||||
brain._store.values["system__conversation_history"],
|
||||
["感谢来电"],
|
||||
)
|
||||
self.assertIn(
|
||||
"感谢来电",
|
||||
|
||||
Reference in New Issue
Block a user