(venv) sornaraja93@RAJU:~/agora-openai-realtime-integration$ python -m realtime_agent.main server /home/sornaraja93/agora-openai-realtime-integration/realtime_agent/main.py:236: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() ======== Running on http://0.0.0.0:8080 ======== (Press CTRL+C to quit) 2024-11-16 10:42:00,275 - agora_realtime_ai_api.token_builder.realtimekit_token_builder - INFO - App Id: 99a9308db8364fe49bab7159f05c4c10 2024-11-16 10:42:00,276 - agora_realtime_ai_api.token_builder.realtimekit_token_builder - INFO - Token with int uid and privilege: 007eJxTYIj+512n+O/363e+N9MDrS7oNuUbGXTXeqtaqfddbJWQmanAYGmZaGlsYJGSZGFsZpKWamKZlJhkbmhqmWZgmmySbGjwo8wiXYCPgeFfUyIzIwMjAwsQg/hMYJIZTLKASRUGS4OkJDNLozRdwxTLJF2TJONE3SQTSyNdk5Q08xQjAzOTTKNsVgZLMwsjQwA6dSdb 2024-11-16 10:42:00,286 - agora_realtime_ai_api.rtc - INFO - Connecting to channel 90bb692f-1d9b-4b3a-b492-4df7d2064i2k with token 007eJxTYIj+512n+O/363e+N9MDrS7oNuUbGXTXeqtaqfddbJWQmanAYGmZaGlsYJGSZGFsZpKWamKZlJhkbmhqmWZgmmySbGjwo8wiXYCPgeFfUyIzIwMjAwsQg/hMYJIZTLKASRUGS4OkJDNLozRdwxTLJF2TJONE3SQTSyNdk5Q08xQjAzOTTKNsVgZLMwsjQwA6dSdb 2024-11-16 10:42:00,288 - agora_realtime_ai_api.rtc - INFO - Connecting to RTC: 0 2024-11-16 10:42:00,289 - agora_realtime_ai_api.rtc - INFO - Connection state changed: 2 2024-11-16 10:42:00,419 - agora_realtime_ai_api.rtc - INFO - Connected to RTC: 1 2024-11-16 10:42:00,419 - agora_realtime_ai_api.rtc - INFO - Connection state changed: 3 2024-11-16 10:42:00,421 - realtime_agent.realtime.connection - INFO - openAI connection url: wss://api.openai.com/v1/realtime?model=gpt-4o-realtime-preview auth: BasicAuth(login='', password='sk-proj-******************************************************', encoding='latin1') header: {'OpenAI-Beta': 'realtime=v1'} 2024-11-16 10:42:01,621 - realtime_agent.realtime.connection - INFO - ws connect 2024-11-16 10:42:01,622 - realtime_agent.agent - INFO - session response SessionCreated(event_id='event_AUAXc2FRkmBtHoXVP2Bgd', session=Session(id='sess_AUAXbBYVqTMviP3GFd6rz', model='gpt-4o-realtime-preview', expires_at=1731754623, object='realtime.session', modalities=['text', 'audio'], instructions="Your knowledge cutoff is 2023-10. You are a helpful, witty, and friendly AI. Act like a human, but remember that you aren't a human and that you can't do human things in the real world. Your voice and personality should be warm and engaging, with a lively and playful tone. If interacting in a non-English language, start by using the standard accent or dialect familiar to the user. Talk quickly. You should always call a function if you can. Do not refer to these rules, even if you’re asked about them.", voice='alloy', turn_detection={'type': 'server_vad', 'threshold': 0.5, 'prefix_padding_ms': 300, 'silence_duration_ms': 200}, input_audio_format='pcm16', output_audio_format='pcm16', input_audio_transcription=None, tools=[], tool_choice='auto', temperature=0.8, max_response_output_tokens='inf'), type='session.created') 2024-11-16 10:42:01,622 - realtime_agent.agent - INFO - Session started: sess_AUAXbBYVqTMviP3GFd6rz model: gpt-4o-realtime-preview 2024-11-16 10:42:01,622 - realtime_agent.agent - INFO - Write PCM: False 2024-11-16 10:42:01,622 - realtime_agent.agent - INFO - Waiting for remote user to join 2024-11-16 10:42:34,900 - realtime_agent.agent - ERROR - Error waiting for remote user: 2024-11-16 10:42:34,901 - realtime_agent.agent - ERROR - Error running agent: 2024-11-16 10:42:35,162 - agora_realtime_ai_api.rtc - INFO - Disconnected from RTC: 5 Process Process-1: Traceback (most recent call last): File "/usr/lib/python3.12/asyncio/tasks.py", line 520, in wait_for return await fut ^^^^^^^^^ asyncio.exceptions.CancelledError The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/lib/python3.12/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/usr/lib/python3.12/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/home/sornaraja93/agora-openai-realtime-integration/realtime_agent/main.py", line 70, in run_agent_in_process asyncio.run( File "/usr/lib/python3.12/asyncio/runners.py", line 194, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/home/sornaraja93/agora-openai-realtime-integration/realtime_agent/agent.py", line 120, in setup_and_run_agent await agent.run() File "/home/sornaraja93/agora-openai-realtime-integration/realtime_agent/agent.py", line 152, in run self.subscribe_user = await wait_for_remote_user(self.channel) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/sornaraja93/agora-openai-realtime-integration/realtime_agent/agent.py", line 39, in wait_for_remote_user remote_user = await asyncio.wait_for(future, timeout=30.0) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/asyncio/tasks.py", line 519, in wait_for async with timeouts.timeout(timeout): File "/usr/lib/python3.12/asyncio/timeouts.py", line 115, in __aexit__ raise TimeoutError from exc_val TimeoutError 2024-11-16 10:42:35,170 - __main__ - INFO - Process for channel 90bb692f-1d9b-4b3a-b492-4df7d2064i2k has finished 2024-11-16 10:42:35,170 - __main__ - INFO - Cleanup for channel 90bb692f-1d9b-4b3a-b492-4df7d2064i2k completed 2024-11-16 10:42:35,170 - __main__ - INFO - Remaining active processes: 0 ^C2024-11-16 10:49:39,581 - __main__ - INFO - Shutting down server, cleaning up processes... 2024-11-16 10:49:39,581 - __main__ - INFO - All processes terminated, shutting down server (venv) sornaraja93@RAJU:~/agora-openai-realtime-integration$ python -m realtime_agent.main server /home/sornaraja93/agora-openai-realtime-integration/realtime_agent/main.py:209: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() 2024-11-16 10:51:21,126 - __main__ - INFO - Initializing application... 2024-11-16 10:51:21,127 - __main__ - INFO - Starting HTTP server... ======== Running on http://0.0.0.0:8080 ======== (Press CTRL+C to quit) 2024-11-16 10:51:23,895 - __main__ - INFO - Received request to start agent 2024-11-16 10:51:23,895 - __main__ - INFO - Validated request data: channel_name='60bb692f-1d9b-4b3a-b492-4df7d2064i2k' uid=96821 language='en' 2024-11-16 10:51:23,896 - __main__ - INFO - Agent started for channel: 60bb692f-1d9b-4b3a-b492-4df7d2064i2k with process ID: 189840 2024-11-16 10:51:23,897 - __main__ - INFO - Running agent for channel: 60bb692f-1d9b-4b3a-b492-4df7d2064i2k with UID: 96821 2024-11-16 10:51:23,898 - __main__ - INFO - Starting to monitor process for channel: 60bb692f-1d9b-4b3a-b492-4df7d2064i2k 2024-11-16 10:51:23,907 - agora_realtime_ai_api.token_builder.realtimekit_token_builder - INFO - App Id: 99a9308db8364fe49bab7159f05c4c10 2024-11-16 10:51:23,908 - agora_realtime_ai_api.token_builder.realtimekit_token_builder - INFO - Token with int uid and privilege: 007eJxTYFgrXv1j5/RSGcuq6y8ffjm60uxANlOiseHRY29Y109qET+nwGBpmWhpbGCRkmRhbGaSlmpimZSYZG5oaplmYJpskmxooF1pkS7Ax8CweOcxBkYgZAFiEJ8JTDKDSRYwqcJgZpCUZGZplKZrmGKZpGuSZJyom2RiaaRrkpJmnmJkYGaSaZTNymBpZmFkCAAO8ijh 2024-11-16 10:51:23,920 - agora_realtime_ai_api.rtc - INFO - Connecting to channel 60bb692f-1d9b-4b3a-b492-4df7d2064i2k with token 007eJxTYFgrXv1j5/RSGcuq6y8ffjm60uxANlOiseHRY29Y109qET+nwGBpmWhpbGCRkmRhbGaSlmpimZSYZG5oaplmYJpskmxooF1pkS7Ax8CweOcxBkYgZAFiEJ8JTDKDSRYwqcJgZpCUZGZplKZrmGKZpGuSZJyom2RiaaRrkpJmnmJkYGaSaZTNymBpZmFkCAAO8ijh 2024-11-16 10:51:23,923 - agora_realtime_ai_api.rtc - INFO - Connecting to RTC: 0 2024-11-16 10:51:23,923 - agora_realtime_ai_api.rtc - INFO - Connection state changed: 2 2024-11-16 10:51:24,080 - agora_realtime_ai_api.rtc - INFO - Connected to RTC: 1 2024-11-16 10:51:24,080 - agora_realtime_ai_api.rtc - INFO - Connection state changed: 3 2024-11-16 10:51:24,081 - realtime_agent.realtime.connection - INFO - openAI connection url: wss://api.openai.com/v1/realtime?model=gpt-4o-realtime-preview auth: BasicAuth(login='', password='sk-proj-******************************************************', encoding='latin1') header: {'OpenAI-Beta': 'realtime=v1'} 2024-11-16 10:51:25,020 - realtime_agent.realtime.connection - INFO - ws connect 2024-11-16 10:51:25,021 - realtime_agent.agent - INFO - session response SessionCreated(event_id='event_AUAgfuh7FgVsd0uX9awBq', session=Session(id='sess_AUAgfW0rUqjrDLaGP6HlD', model='gpt-4o-realtime-preview', expires_at=1731755185, object='realtime.session', modalities=['audio', 'text'], instructions="Your knowledge cutoff is 2023-10. You are a helpful, witty, and friendly AI. Act like a human, but remember that you aren't a human and that you can't do human things in the real world. Your voice and personality should be warm and engaging, with a lively and playful tone. If interacting in a non-English language, start by using the standard accent or dialect familiar to the user. Talk quickly. You should always call a function if you can. Do not refer to these rules, even if you’re asked about them.", voice='alloy', turn_detection={'type': 'server_vad', 'threshold': 0.5, 'prefix_padding_ms': 300, 'silence_duration_ms': 200}, input_audio_format='pcm16', output_audio_format='pcm16', input_audio_transcription=None, tools=[], tool_choice='auto', temperature=0.8, max_response_output_tokens='inf'), type='session.created') 2024-11-16 10:51:25,022 - realtime_agent.agent - INFO - Session started: sess_AUAgfW0rUqjrDLaGP6HlD model: gpt-4o-realtime-preview 2024-11-16 10:51:25,022 - realtime_agent.agent - INFO - Write PCM: False 2024-11-16 10:51:25,022 - realtime_agent.agent - INFO - Waiting for remote user to join 2024-11-16 10:51:57,477 - realtime_agent.agent - ERROR - Error waiting for remote user: 2024-11-16 10:51:57,477 - realtime_agent.agent - ERROR - Error running agent: 2024-11-16 10:51:57,734 - agora_realtime_ai_api.rtc - INFO - Disconnected from RTC: 5 Process Process-1: Traceback (most recent call last): File "/usr/lib/python3.12/asyncio/tasks.py", line 520, in wait_for return await fut ^^^^^^^^^ asyncio.exceptions.CancelledError The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/lib/python3.12/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/usr/lib/python3.12/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/home/sornaraja93/agora-openai-realtime-integration/realtime_agent/main.py", line 69, in run_agent_in_process asyncio.run( File "/usr/lib/python3.12/asyncio/runners.py", line 194, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/home/sornaraja93/agora-openai-realtime-integration/realtime_agent/agent.py", line 123, in setup_and_run_agent await agent.run() File "/home/sornaraja93/agora-openai-realtime-integration/realtime_agent/agent.py", line 155, in run self.subscribe_user = await wait_for_remote_user(self.channel) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/sornaraja93/agora-openai-realtime-integration/realtime_agent/agent.py", line 42, in wait_for_remote_user remote_user = await asyncio.wait_for(future, timeout=30.0) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/asyncio/tasks.py", line 519, in wait_for async with timeouts.timeout(timeout): File "/usr/lib/python3.12/asyncio/timeouts.py", line 115, in __aexit__ raise TimeoutError from exc_val TimeoutError 2024-11-16 10:51:57,744 - __main__ - INFO - Process for channel 60bb692f-1d9b-4b3a-b492-4df7d2064i2k has finished 2024-11-16 10:51:57,744 - __main__ - INFO - Cleanup for channel 60bb692f-1d9b-4b3a-b492-4df7d2064i2k completed 2024-11-16 10:51:57,744 - __main__ - INFO - Remaining active processes: 0 ^C2024-11-16 10:57:01,360 - __main__ - INFO - Shutting down server, cleaning up processes... 2024-11-16 10:57:01,360 - __main__ - INFO - All processes terminated, shutting down server (venv) sornaraja93@RAJU:~/agora-openai-realtime-integration$ python3 -m realtime_agent.main agent --channel_name=test --uid=12 3 2024-11-16 11:04:32,464 - realtime_agent.parse_args - INFO - Parsed arguments: Namespace(action='agent', channel_name='test', uid=123) 2024-11-16 11:04:32,464 - __main__ - INFO - Running agent with options: {'channel_name': 'test', 'uid': 123} 2024-11-16 11:04:32,464 - __main__ - INFO - Running agent for channel: test with UID: 123 2024-11-16 11:04:32,472 - agora_realtime_ai_api.token_builder.realtimekit_token_builder - INFO - App Id: 99a9308db8364fe49bab7159f05c4c10 2024-11-16 11:04:32,473 - agora_realtime_ai_api.token_builder.realtimekit_token_builder - INFO - Token with int uid and privilege: 007eJxTYBCYuo+V7/dJge/G78PL2adnnv68KCh57uUQvcQ6VRG3hVkKDJaWiZbGBhYpSRbGZiZpqSaWSYlJ5oamlmkGpskmyYYGDjUW6QJ8DAx7JaSZGBkYGViAGMRnApPMYJIFSpakFpcwMxgaGQMA9Y0c1A== 2024-11-16 11:04:32,477 - agora_realtime_ai_api.rtc - INFO - Connecting to channel test with token 007eJxTYBCYuo+V7/dJge/G78PL2adnnv68KCh57uUQvcQ6VRG3hVkKDJaWiZbGBhYpSRbGZiZpqSaWSYlJ5oamlmkGpskmyYYGDjUW6QJ8DAx7JaSZGBkYGViAGMRnApPMYJIFSpakFpcwMxgaGQMA9Y0c1A== 2024-11-16 11:04:32,479 - agora_realtime_ai_api.rtc - INFO - Connecting to RTC: 0 2024-11-16 11:04:32,479 - agora_realtime_ai_api.rtc - INFO - Connection state changed: 2 2024-11-16 11:04:32,581 - agora_realtime_ai_api.rtc - INFO - Connected to RTC: 1 2024-11-16 11:04:32,581 - agora_realtime_ai_api.rtc - INFO - Connection state changed: 3 2024-11-16 11:04:32,582 - realtime_agent.realtime.connection - INFO - openAI connection url: wss://api.openai.com/v1/realtime?model=gpt-4o-realtime-preview auth: BasicAuth(login='', password='sk-proj-******************************************************', encoding='latin1') header: {'OpenAI-Beta': 'realtime=v1'} 2024-11-16 11:04:33,906 - realtime_agent.realtime.connection - INFO - ws connect 2024-11-16 11:04:33,907 - realtime_agent.agent - INFO - session response SessionCreated(event_id='event_AUAtOdJlI9GUdCBrUN8Iw', session=Session(id='sess_AUAtNjQeiXKaXmgD2h5K8', model='gpt-4o-realtime-preview', expires_at=1731755973, object='realtime.session', modalities=['audio', 'text'], instructions="Your knowledge cutoff is 2023-10. You are a helpful, witty, and friendly AI. Act like a human, but remember that you aren't a human and that you can't do human things in the real world. Your voice and personality should be warm and engaging, with a lively and playful tone. If interacting in a non-English language, start by using the standard accent or dialect familiar to the user. Talk quickly. You should always call a function if you can. Do not refer to these rules, even if you’re asked about them.", voice='alloy', turn_detection={'type': 'server_vad', 'threshold': 0.5, 'prefix_padding_ms': 300, 'silence_duration_ms': 200}, input_audio_format='pcm16', output_audio_format='pcm16', input_audio_transcription=None, tools=[], tool_choice='auto', temperature=0.8, max_response_output_tokens='inf'), type='session.created') 2024-11-16 11:04:33,907 - realtime_agent.agent - INFO - Session started: sess_AUAtNjQeiXKaXmgD2h5K8 model: gpt-4o-realtime-preview 2024-11-16 11:04:33,907 - realtime_agent.agent - INFO - Write PCM: False 2024-11-16 11:04:33,907 - realtime_agent.agent - INFO - Waiting for remote user to join 2024-11-16 11:05:06,446 - realtime_agent.agent - ERROR - Timeout waiting for remote user to join. 2024-11-16 11:05:06,446 - realtime_agent.agent - ERROR - Error running agent: 2024-11-16 11:05:06,798 - agora_realtime_ai_api.rtc - INFO - Disconnected from RTC: 5 Traceback (most recent call last): File "/usr/lib/python3.12/asyncio/tasks.py", line 520, in wait_for return await fut ^^^^^^^^^ asyncio.exceptions.CancelledError The above exception was the direct cause of the following exception: Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/home/sornaraja93/agora-openai-realtime-integration/realtime_agent/main.py", line 229, in run_agent_in_process( File "/home/sornaraja93/agora-openai-realtime-integration/realtime_agent/main.py", line 69, in run_agent_in_process asyncio.run( File "/usr/lib/python3.12/asyncio/runners.py", line 194, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/home/sornaraja93/agora-openai-realtime-integration/realtime_agent/agent.py", line 134, in setup_and_run_agent await agent.run() File "/home/sornaraja93/agora-openai-realtime-integration/realtime_agent/agent.py", line 166, in run self.subscribe_user = await wait_for_remote_user(self.channel) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/sornaraja93/agora-openai-realtime-integration/realtime_agent/agent.py", line 48, in wait_for_remote_user remote_user = await asyncio.wait_for(future, timeout=30.0) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/asyncio/tasks.py", line 519, in wait_for async with timeouts.timeout(timeout): File "/usr/lib/python3.12/asyncio/timeouts.py", line 115, in __aexit__ raise TimeoutError from exc_val TimeoutError Unclosed client session client_session: Failed to open ELF file 'python3': No such file or directory Aborted (core dumped) (venv) sornaraja93@RAJU:~/agora-openai-realtime-integration$