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

Bug: Deprecated OpenAI package breaks setup #6

Open
sibbl opened this issue May 2, 2024 · 0 comments
Open

Bug: Deprecated OpenAI package breaks setup #6

sibbl opened this issue May 2, 2024 · 0 comments

Comments

@sibbl
Copy link

sibbl commented May 2, 2024

The integration cannot be added. The following exception is thrown when adding the API key.

Unexpected exception

Traceback (most recent call last):
  File "/config/custom_components/openai_control/config_flow.py", line 83, in async_step_user
    await validate_input(self.hass, user_input)
  File "/config/custom_components/openai_control/config_flow.py", line 63, in validate_input
    await hass.async_add_executor_job(partial(openai.Engine.list, request_timeout=10))
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/openai/lib/_old_api.py", line 39, in __call__
openai.lib._old_api.APIRemovedInV1: 

You tried to access openai.Engine, but this is no longer supported in openai>=1.0.0 - see the README at https://github.com/openai/openai-python for the API.

You can run `openai migrate` to automatically upgrade your codebase to use the 1.0.0 interface. 

Alternatively, you can pin your installation to the old version, e.g. `pip install openai==0.28`

A detailed migration guide is available here: https://github.com/openai/openai-python/discussions/742

@sibbl sibbl changed the title Bug: Deprecated OpenAI API breaks setup Bug: Deprecated OpenAI package breaks setup May 2, 2024
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

1 participant