From ab6a8ad468fa827b6f485786120eceb04b6922f7 Mon Sep 17 00:00:00 2001 From: rjheeta Date: Thu, 16 May 2024 09:10:37 -0400 Subject: [PATCH] bug fix for certain cases where twilio_sid or vonage_uuid are not correctly passed to actions * This uses a more reliable method of obtaining these IDs (via ConversationStateManager) --- vocode/streaming/action/worker.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/vocode/streaming/action/worker.py b/vocode/streaming/action/worker.py index 6ca876f6b..d6aae34bc 100644 --- a/vocode/streaming/action/worker.py +++ b/vocode/streaming/action/worker.py @@ -3,12 +3,12 @@ import asyncio from vocode.streaming.action.factory import ActionFactory from vocode.streaming.agent.base_agent import ActionResultAgentInput, AgentInput -from vocode.streaming.models.actions import ( - ActionInput, - TwilioPhoneCallActionInput, - VonagePhoneCallActionInput, +from vocode.streaming.models.actions import ActionInput +from vocode.streaming.utils.state_manager import ( + ConversationStateManager, + TwilioCallStateManager, + VonageCallStateManager, ) -from vocode.streaming.utils.state_manager import ConversationStateManager from vocode.streaming.utils.worker import ( InterruptibleEvent, InterruptibleEventFactory, @@ -47,13 +47,13 @@ async def process(self, item: InterruptibleEvent[ActionInput]): action_input=action_input, action_output=action_output, vonage_uuid=( - action_input.vonage_uuid - if isinstance(action_input, VonagePhoneCallActionInput) + self.conversation_state_manager._call.vonage_uuid + if isinstance(self.conversation_state_manager, VonageCallStateManager) else None ), twilio_sid=( - action_input.twilio_sid - if isinstance(action_input, TwilioPhoneCallActionInput) + self.conversation_state_manager._call.twilio_sid + if isinstance(self.conversation_state_manager, TwilioCallStateManager) else None ), is_quiet=action.quiet,