From a4002ba58668d3dcad35552f7bd0bb39ab4fa6be Mon Sep 17 00:00:00 2001 From: Evan Zachary Date: Sun, 11 Feb 2024 07:51:22 -0700 Subject: ppppp --- telephony_app/icu.py | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 telephony_app/icu.py (limited to 'telephony_app/icu.py') diff --git a/telephony_app/icu.py b/telephony_app/icu.py new file mode 100644 index 0000000..4f6df71 --- /dev/null +++ b/telephony_app/icu.py @@ -0,0 +1,51 @@ +import os +from dotenv import load_dotenv + +load_dotenv() + +from vocode.streaming.telephony.conversation.outbound_call import OutboundCall +from vocode.streaming.telephony.config_manager.redis_config_manager import ( + RedisConfigManager, +) +from vocode.streaming.models.telephony import TwilioConfig +from speller_agent import SpellerAgentConfig + +from vocode.streaming.agent.chat_gpt_agent import ChatGPTAgent + +from vocode.streaming.models.agent import ChatGPTAgentConfig +from vocode.streaming.models.message import BaseMessage +from vocode.streaming.models.synthesizer import ElevenLabsSynthesizerConfig, AzureSynthesizerConfig + + +BASE_URL = os.environ["BASE_URL"] + + +async def main(): + config_manager = RedisConfigManager() + + outbound_call = OutboundCall( + base_url=BASE_URL, + to_phone="+16199806687", + from_phone="+18886854928", + config_manager=config_manager, + agent_config=ChatGPTAgentConfig( + initial_message=BaseMessage(text="Hey, are you doing alright lately? You haven't been hitting your usual numbers recently. I just wanted to check in and see if things were alright."), + prompt_preamble="You should act as someone concered for the other participant in the conversation as they have not been performing as well at mountain biking as they may have been recently. Make sure to enquire about any possible injuries or events in their life that may be affecting them. Take their response and suggest possible remedies.", + generate_response=True, + ), + twilio_config=TwilioConfig( + account_sid=os.environ["TWILIO_ACCOUNT_SID"], + auth_token=os.environ["TWILIO_AUTH_TOKEN"], + #record=True + )#, + #synthesizer_config=ElevenLabsSynthesizerConfig.from_telephone_output_device( + # api_key=os.getenv("ELEVENLABS_API_KEY"), + # voice_id=os.getenv("ELEVENLABS_VOICE_ID") + #) + ) + input("Press enter to start call...") + await outbound_call.start() + +if __name__ == "__main__": + import asyncio + asyncio.run(main()) \ No newline at end of file -- cgit v1.2.3