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

Bad keyword error #1253

Closed
3 of 8 tasks
Burhan-Q opened this issue Dec 12, 2024 · 5 comments
Closed
3 of 8 tasks

Bad keyword error #1253

Burhan-Q opened this issue Dec 12, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@Burhan-Q
Copy link

Burhan-Q commented Dec 12, 2024

  • 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 (Claude, but error occurs before query)

Describe the bug
Apologies, I haven't had a ton of time to investigate, but I wanted to open a ticket before I forgot. This might actually be an error from a third party package. I was following this guide https://python.useinstructor.com/integrations/anthropic/ and when running

client = instructor.from_anthropic(
    anthropic.Anthropic(),
)

an error is raised for a bad keyword proxies for Client.__init__() and is unable to create the client object.

To Reproduce
Follow the guide

Expected behavior
Client created without error.

Patch
I was able to sidestep the issue by commenting L860 in _base_client.py but it's not obvious to me if that would cause downstream issues. After commenting this line, I was able to create the client object successfully and was able to send a query, however there were other issues but I have not ruled out external factors (my structured outputs) as the cause for those, as I ran out of time.

  • Ubuntu 22.02
  • Python 3.11
  • Installed using uv pip install "instructor[anthropic]" command in dedicated project venv

Sorry for the rushed post. Hackathon followed by cross country travel.

@github-actions github-actions bot added the bug Something isn't working label Dec 12, 2024
@holdenmatt
Copy link

Also seeing this, after trying to setup Instructor + Anthropic from the docs. Is this a dependency issue?

@a3lem
Copy link
Contributor

a3lem commented Dec 17, 2024

Appears to be an issue with the Anthropic SDK, since simply creating an instance of the Anthropic() client triggers the same error.

It's been fixed in the latest version of the Anthropic SDK (v0.40). anthropics/anthropic-sdk-python#779

The latest release of Instructor (v1.7) constrains the Anthropic SDK to versions ">=0.36.2,<0.38.0". On master 0.40 is already permitted.

The error arises from httpx. Fastest workaround is to downgrade httpx, as suggested in a comment below the anthropic issue.

@Burhan-Q
Copy link
Author

Happy to close this issue as resolved, but thought it could also be helpful for other users looking for answers on the same topic. Any preference?

@ivanleomk
Copy link
Collaborator

Have a tentative PR here that will bump anthropic up to 0.42.0 and make it the default version for people moving forward. This also allows us to support prompt caching in the normal standard message.create.

Will start working on documentation for computer use in the beta #1281

@ivanleomk
Copy link
Collaborator

Ok I've just published instructor 1.7.2 which bumps anthropic to v0.42.0 and avoids this issue with https

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

No branches or pull requests

4 participants