Skip to content

Commit 5443a1c

Browse files
committed
[WIP] "Warm transfer" demo
1 parent f3a96a4 commit 5443a1c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

examples/static/warm_transfer.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,8 @@ def create_transferring_to_human_agent_node() -> NodeConfig:
372372
handler=pre_transferring_to_human_agent
373373
)
374374
],
375-
# NOTE: "real" post action (post_transferring_to_human_agent) is triggered by CustomControlProcessor
376375
post_actions=[
376+
# NOTE: "real" post action (post_transferring_to_human_agent) is triggered by CustomControlProcessor
377377
ActionConfig(
378378
type="queue_post_transferring_to_human_agent",
379379
handler=queue_post_transferring_to_human_agent
@@ -442,12 +442,13 @@ def create_end_human_agent_conversation_node() -> NodeConfig:
442442
},
443443
],
444444
functions=[],
445-
# NOTE: "real" post action (post_end_human_agent_conversation) is triggered by CustomControlProcessor
446445
post_actions=[
446+
# NOTE: "real" post action (post_end_human_agent_conversation) is triggered by CustomControlProcessor
447447
ActionConfig(
448448
type="queue_post_end_human_agent_conversation",
449449
handler=queue_post_end_human_agent_conversation
450-
)
450+
),
451+
ActionConfig(type="end_conversation")
451452
]
452453
)
453454

@@ -568,8 +569,6 @@ async def process_frame(self, frame: Frame, direction: FrameDirection):
568569
await post_transferring_to_human_agent(transport=self.__transport)
569570
elif isinstance(frame, PostEndHumanAgentConversationFrame):
570571
await post_end_human_agent_conversation(transport=self.__transport)
571-
# TODO: how to trigger EndFrame() from here? we don't have reference to PipelineTask
572-
# await self.queue_frame(EndFrame())
573572

574573
await self.push_frame(frame, direction)
575574

0 commit comments

Comments
 (0)