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

Broken import in Marvin from OpenAI client version 1.8.0 #765

Closed
3 tasks done
krishnan-chandra opened this issue Jan 16, 2024 · 1 comment · Fixed by #770
Closed
3 tasks done

Broken import in Marvin from OpenAI client version 1.8.0 #765

krishnan-chandra opened this issue Jan 16, 2024 · 1 comment · Fixed by #770
Labels
bug Something isn't working

Comments

@krishnan-chandra
Copy link

krishnan-chandra commented Jan 16, 2024

First check

  • I added a descriptive title to this issue.
  • I used the GitHub search to try to find a similar issue and didn't find one.
  • I searched the Marvin documentation for this issue.

Bug summary

The HttpxBinaryResponseContent import moved inside the OpenAI library between release 1.7.2 and 1.8.0. This breaks Marvin's import of this class, which causes Marvin not to be importable on fresh installs.

This problem can be temporarily solved by pinning the openai library to the 1.7 minor version: openai = "~1.7.0"

Reproduction

python -m venv marvin_openai_test_env
source marvin_openai_test_env/bin/activate
pip install marvin==2.1b1
python -c "import marvin"

Error

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/krishnanchandra/marvin_test_env/lib/python3.11/site-packages/marvin/__init__.py", line 3, in <module>
    from .ai.text import fn, cast, extract, classify, classifier, generate, model, Model
  File "/Users/krishnanchandra/marvin_test_env/lib/python3.11/site-packages/marvin/ai/__init__.py", line 2, in <module>
    from . import audio
  File "/Users/krishnanchandra/marvin_test_env/lib/python3.11/site-packages/marvin/ai/audio.py", line 4, in <module>
    from openai._base_client import HttpxBinaryResponseContent
ImportError: cannot import name 'HttpxBinaryResponseContent' from 'openai._base_client' (/Users/krishnanchandra/Projects/HUMINT/marvin_test_env/lib/python3.11/site-packages/openai/_base_client.py)

Versions

2.1b1

Additional context

@krishnan-chandra krishnan-chandra added the bug Something isn't working label Jan 16, 2024
@krishnan-chandra krishnan-chandra changed the title Broken import in Marvin from OpenAI client 1.8.0 Broken import in Marvin from OpenAI client version 1.8.0 Jan 16, 2024
@zzstoatzz
Copy link
Collaborator

thanks for the report @krishnan-chandra - the fix should now be released with 2.1b2

pip install marvin==2.1b2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants