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

Feat: Add beta support for anthropic #1219

Closed
wants to merge 3 commits into from
Closed

Conversation

alexdzm
Copy link
Contributor

@alexdzm alexdzm commented Nov 25, 2024

The anthropic beta API has multiple features other than those currently supported by instructor. This PR enables the ability to connect to the beta api endpoint to use any of them.

Important

Adds beta parameter to from_anthropic() in client_anthropic.py to support beta message creation.

  • Behavior:
    • Adds beta parameter to from_anthropic() in client_anthropic.py.
    • When beta is true, uses client.beta.messages.create instead of client.messages.create.
  • Functionality:
    • Supports both synchronous and asynchronous client types.
    • Ensures compatibility with enable_prompt_caching and beta parameters.

This description was created by Ellipsis for 047a5bb. It will automatically update as commits are pushed.

@alexdzm alexdzm changed the title Add beta support for anthropic Feat: Add beta support for anthropic Nov 25, 2024
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Reviewed everything up to 047a5bb in 21 seconds

More details
  • Looked at 21 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. instructor/client_anthropic.py:44
  • Draft comment:
    Consider adding a docstring to explain the beta parameter and its intended use.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The new beta parameter is added but not documented. This can lead to confusion for future developers.
2. instructor/client_anthropic.py:44
  • Draft comment:
    If the 'beta' parameter affects library code, ensure that documentation and tests are updated accordingly.
  • Reason this comment was not posted:
    Comment did not seem useful.

Workflow ID: wflow_9LQ8c3CT8mffMltX


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@jxnl
Copy link
Collaborator

jxnl commented Dec 3, 2024

can you make sure to run ruff and add docs

@alexdzm
Copy link
Contributor Author

alexdzm commented Dec 3, 2024

I have run my ruff on my submission. If I run it one everything there are 30+ files changed beyond what I have modified, would you like me to commit those changes?

@jxnl
Copy link
Collaborator

jxnl commented Dec 5, 2024

i got devin to fix it off your PR :)

@jxnl jxnl closed this Dec 5, 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

Successfully merging this pull request may close these issues.

2 participants