Add-on doesn't work in corporate settings
Hi,
I'm u sing a computer that has a custom root certificate in the root store, that is my suspicion about why the add-on is unable to make any API calls. I get the following logs with debug logging when attempting to send a prompt.
ERROR - unhandled exception (14:05:31.742) - MainThread (14144):
Traceback (most recent call last):
File "C:\Users\Dickson\AppData\Roaming\nvda\addons\OpenAI\globalPlugins\openai\maindialog.py", line 1088, in OnResult
if isinstance(event.data, openai._base_client.HttpxBinaryResponseContent):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'openai._base_client' has no attribute 'HttpxBinaryResponseContent'
There isn't any additional information in the logs.
It also seems to me to have encountered the error after the recent update of dependencies (this week).
Could you please remove the code block
if isinstance(event.data, openai._base_client.HttpxBinaryResponseContent):
which seems to be no longer valid, and try again?
Thanks
That causes something different to happen now: a dialog box that says "connection error" appears, with no additional information about the actual error in the debug logs.
OK, the fix seems the following:
please replace the following line:
if isinstance(event.data, openai._base_client.HttpxBinaryResponseContent):
With this one:
if isinstance(event.data, openai._legacy_response.HttpxBinaryResponseContent):
The issue I'm encountering is probably https://github.com/nvaccess/nvda/issues/15905
OK, we have two problems at once. ;) Can you make API requests outside NVDA environment by providing proxy settings? See here for example: https://stackoverflow.com/questions/77606417/openai-api-request-with-proxy