Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add-on doesn't work in corporate settings #84

Open
Neurrone opened this issue Mar 18, 2024 · 5 comments
Open

Add-on doesn't work in corporate settings #84

Neurrone opened this issue Mar 18, 2024 · 5 comments

Comments

@Neurrone
Copy link

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.

@AAClause
Copy link
Owner

AAClause commented Mar 18, 2024

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

@Neurrone
Copy link
Author

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.

@AAClause
Copy link
Owner

AAClause commented Mar 18, 2024

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):

@Neurrone
Copy link
Author

Neurrone commented Mar 18, 2024

The issue I'm encountering is probably nvaccess/nvda#15905

@AAClause
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants