Open rayo-alcantar opened 11 months ago
The biggest issue here in my opinion is that, since the OpenAI library runs in the main thread, that error message freezes the entire screen reader until the user dismisses the popup. That assuming that the OpenAI library is the one reponsable for the popup message in the first place.
In other words, a message box that is displayed outside the UI thread. This issue is caused by add-ons bundled with different versions of the same dependencies as this add-on. OpenAI should ensure all imported modules are the ones bundled with the add-on. This is a quite complex task that may involve editing sys.path and removing things from sys.modules before importing.
Thanks @rayo-alcantar for the report and @jmdaweb for the explanations.
For reference, here is the traceback:
Traceback (most recent call last):
File "threading.pyc", line 926, in _bootstrap_inner
File "D:\app\nvda\2023.3\userConfig\addons\OpenAI\globalPlugins\openai\maindialog.py", line 112, in run
response = client.chat.completions.create(**params)
File "D:\app\nvda\2023.3\userConfig\addons\OpenAI\globalPlugins\openai\lib\openai\_utils\_utils.py", line 301, in wrapper
return func(*args, **kwargs)
File "D:\app\nvda\2023.3\userConfig\addons\OpenAI\globalPlugins\openai\lib\openai\resources\chat\completions.py", line 628, in create
stream_cls=Stream[ChatCompletionChunk],
File "D:\app\nvda\2023.3\userConfig\addons\OpenAI\globalPlugins\openai\lib\openai\_base_client.py", line 1096, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
File "D:\app\nvda\2023.3\userConfig\addons\OpenAI\globalPlugins\openai\lib\openai\_base_client.py", line 861, in request
remaining_retries=remaining_retries,
File "D:\app\nvda\2023.3\userConfig\addons\OpenAI\globalPlugins\openai\lib\openai\_base_client.py", line 876, in _request
request = self._build_request(options)
File "D:\app\nvda\2023.3\userConfig\addons\OpenAI\globalPlugins\openai\lib\openai\_base_client.py", line 481, in _build_request
**kwargs,
TypeError: build_request() got an unexpected keyword argument 'timeout'
I have encountered a compatibility issue between the OpenAI add-on (version 23.12.03) and the Spellcheck add-on (version 1.1) in NVDA (version 2023.3). The issue arises when attempting to send a prompt (using Control + Enter) while both add-ons are enabled. Steps to Reproduce: