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

anthropic should no longer be an extras dependency #646

Closed
2 of 8 tasks
arcaputo3 opened this issue May 2, 2024 · 5 comments
Closed
2 of 8 tasks

anthropic should no longer be an extras dependency #646

arcaputo3 opened this issue May 2, 2024 · 5 comments

Comments

@arcaputo3
Copy link

  • This is actually a bug report.
  • I am not getting good LLM Results
  • I have tried asking for help in the community on discord or discussions and have not received a response.
  • I have tried searching the documentation and have not found an answer.

What Model are you using?

  • gpt-3.5-turbo
  • gpt-4-turbo
  • gpt-4
  • Other (please specify)

Describe the bug
Running from instructor import patch leads to a ModuleNotFoundError: No module named 'anthropic'.

To Reproduce

  • Create a poetry environment with instructor = "^1.2.5"
  • Run from instructor import patch

Expected behavior
patch should be importable for reverse compatibility as this change breaks pipelines.

Screenshots

ImportError while importing test module 'C:\Users\rcaputo3\tjc\tjc-databricks\tests\instructor\test_base.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
..\..\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests\instructor\test_base.py:3: in <module>
    from tjc_databricks.instructor.base import validate_length
tjc_databricks\instructor\__init__.py:3: in <module>
    from instructor import patch
..\..\AppData\Local\pypoetry\Cache\virtualenvs\tjc-databricks-lKdFldj--py3.10\lib\site-packages\instructor\__init__.py:4: in <module>
    from .process_response import handle_response_model
..\..\AppData\Local\pypoetry\Cache\virtualenvs\tjc-databricks-lKdFldj--py3.10\lib\site-packages\instructor\process_response.py:6: in <module>
    from instructor.dsl.iterable import IterableBase, IterableModel
..\..\AppData\Local\pypoetry\Cache\virtualenvs\tjc-databricks-lKdFldj--py3.10\lib\site-packages\instructor\dsl\__init__.py:1: in <module>
    from .iterable import IterableModel
..\..\AppData\Local\pypoetry\Cache\virtualenvs\tjc-databricks-lKdFldj--py3.10\lib\site-packages\instructor\dsl\iterable.py:6: in <module>
    from instructor.function_calls import OpenAISchema
..\..\AppData\Local\pypoetry\Cache\virtualenvs\tjc-databricks-lKdFldj--py3.10\lib\site-packages\instructor\function_calls.py:18: in <module>
    from instructor.utils import classproperty, extract_json_from_codeblock
..\..\AppData\Local\pypoetry\Cache\virtualenvs\tjc-databricks-lKdFldj--py3.10\lib\site-packages\instructor\utils.py:16: in <module>
    from anthropic.types import Usage as AnthropicUsage
E   ModuleNotFoundError: No module named 'anthropic'
@arcaputo3
Copy link
Author

I can confirm that instructor = "1.2.4" works as expected and that 1.2.5 introduced the breaking change.

@jxnl
Copy link
Owner

jxnl commented May 2, 2024

thanks. afk rn, can you put up a PR and bump version number and i can update

@bencrouse
Copy link
Contributor

I'm hitting this too, Is making anthropic a full dependency the desired state? What if you aren't using Anthropic and don't need the extra dependency?

@arcaputo3
Copy link
Author

This looks pretty good: 3ee7a28

Installing instructor = { git = "https://github.com/jxnl/instructor", branch = "main" } allows patch to be imported properly with no extra dependency.

@noxan
Copy link
Contributor

noxan commented May 6, 2024

should be fixed with #645

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

4 participants