TEN-framework / TEN-Agent

TEN Agent is the world’s first real-time multimodal agent integrated with the OpenAI Realtime API, RTC, and features weather checks, web search, vision, and RAG capabilities.
https://agent.theten.ai/
Apache License 2.0
1.44k stars 168 forks source link

[Bug] openai_chatgpt_python extension OPENAI_PROXY_URL problem #292

Closed seven1240 closed 1 month ago

seven1240 commented 1 month ago

Is your feature request related to a problem? Please describe.

I built in my local computer, va.openai.azure works but camera.va.openai.azure doesn't.

I have OPENAI_PROXY_URL set to OPENAI_PROXY_URL=socks5://host.orb.internal:8888

I checked property.json, the first one using Go plugin and the camera one using Python, and looks like the python one doesn't support OPENAI_PROXY_URL or doesn't support socks proxy. I already have pysocks installed and it works and helps when I download python dependences.

so it results to connection error.

[avatar_p1jxlu] 2024-09-28 09:10:19,786 - openai_chatgpt_python - ERROR - 3559 - [openai_chatgpt_extension.py:507] - err: Traceback (most recent call last):
[avatar_p1jxlu]   File "/usr/local/lib/python3.10/dist-packages/httpx/_transports/default.py", line 72, in map_httpcore_exceptions
[avatar_p1jxlu]     yield
[avatar_p1jxlu]   File "/usr/local/lib/python3.10/dist-packages/httpx/_transports/default.py", line 236, in handle_request
[avatar_p1jxlu]     resp = self._pool.handle_request(req)
[avatar_p1jxlu]   File "/usr/local/lib/python3.10/dist-packages/httpcore/_sync/connection_pool.py", line 216, in handle_request
[avatar_p1jxlu]     raise exc from None
[avatar_p1jxlu]   File "/usr/local/lib/python3.10/dist-packages/httpcore/_sync/connection_pool.py", line 196, in handle_request
[avatar_p1jxlu]     response = connection.handle_request(
[avatar_p1jxlu]   File "/usr/local/lib/python3.10/dist-packages/httpcore/_sync/connection.py", line 99, in handle_request
[avatar_p1jxlu]     raise exc
[avatar_p1jxlu]   File "/usr/local/lib/python3.10/dist-packages/httpcore/_sync/connection.py", line 76, in handle_request
[avatar_p1jxlu]     stream = self._connect(request)
[avatar_p1jxlu]   File "/usr/local/lib/python3.10/dist-packages/httpcore/_sync/connection.py", line 122, in _connect
[avatar_p1jxlu]     stream = self._network_backend.connect_tcp(**kwargs)
[avatar_p1jxlu]   File "/usr/local/lib/python3.10/dist-packages/httpcore/_backends/sync.py", line 205, in connect_tcp
[avatar_p1jxlu]     with map_exceptions(exc_map):
[avatar_p1jxlu]   File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
[avatar_p1jxlu]     self.gen.throw(typ, value, traceback)
[avatar_p1jxlu]   File "/usr/local/lib/python3.10/dist-packages/httpcore/_exceptions.py", line 14, in map_exceptions
[avatar_p1jxlu]     raise to_exc(exc) from exc
[avatar_p1jxlu] httpcore.ConnectError: [Errno 101] Network is unreachable

I manually changed the addon property from openai_chatgpt_python to openai_chatgpt fixes it.

Describe the solution you'd like

the python plugin also support OPENAI_PROXY_URL

Describe alternatives you've considered

None.

seven1240 commented 1 month ago

I found it crashes event not using publish video. as long as I enable camera on the web client, it crashes, short log:

[agora_swllrv] [VSC](0x40c01f3680) AudioFilterVirtualSoundCard: name virtual_soundcard_pcm
[agora_swllrv] [VSC-GAIN](0x40c01eb700) VscGainApplier
[agora_swllrv] [VSC-MIC](0x40c01f6520) VscMicEqTuner
[agora_swllrv] [VSC-ENHANCER](0x40c01f3090) VscVoiceEnhancer
[agora_swllrv] [VSC-EFFECT](0x40c01f2660) VscAudioEffect
[agora_swllrv] [VSC](0x40c01f3680) Initialize
[agora_swllrv] [VSC-GAIN](0x40c01eb700) Initialize: gain -1.000000
[agora_swllrv] [VSC-MIC](0x40c01f6520) Initialize: preset -1
[agora_swllrv] [VSC-ENHANCER](0x40c01f3090) Initialize: gender -1
[agora_swllrv] [VSC-EFFECT](0x40c01f2660) Initialize: gender -1, effect -1
[agora_swllrv] 09-28 12:30:17.607  9362  9389 I AGORA_RTC_EXTENSION onConnected@connection_observer.cc:63 onConnected: i
d 0, channelId agora_swllrv, localUserId 1234, reason 1
[agora_swllrv]
[agora_swllrv] 09-28 12:30:17.608  9362  9382 I TEN_RUNTIME ten_extension_on_start_done@on_xxx.c:71 [agora_rtc] on_start
() done.
[agora_swllrv] 09-28 12:30:17.856  9362  9389 I AGORA_RTC_EXTENSION onUserJoined@connection_observer.cc:167 onUserJoined
: userId 141635
[agora_swllrv]
[agora_swllrv] [SttMs] construct
[agora_swllrv] SttClientMs::setProperty, key:start, value:{"enable_auto_detect":true,"region":"eastasia","segmentation_s
ilence_timeout":100,"source_languages":"en-US","subscription":"e9428fc1a08144c8bec94b193836cc0b"}
[agora_swllrv] 09-28 12:30:18.138  9362  9389 I AGORA_RTC_EXTENSION onEventWithContext@asr_extension_observer.cc:23 onEv
entWithContext uid: 141635, key:started
[agora_swllrv] 09-28 12:30:18.139  9362  9389 I AGORA_RTC_EXTENSION handle_stt_started@rtc_service.cc:735 uid 141635
[agora_swllrv] qemu: uncaught target signal 4 (Illegal instruction) - core dumped
[agora_swllrv] Illegal instruction