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

Feature #25

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Feature #25

wants to merge 2 commits into from

Conversation

blake41
Copy link

@blake41 blake41 commented Oct 30, 2024

Hi, this is both a bug fix, and a quick feature implementing tool choice per anthropics api


Important

Adds tool choice configuration to Anthropic API requests in patch.rb.

  • Feature:
    • Adds build_tool_choice function in patch.rb to construct tool choice configuration for API requests.
    • Modifies messages function in patch.rb to merge parameters with tool choice configuration.
  • Behavior:
    • Tool choice is determined by the function's name and included in the API request parameters.

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

…er anthropic spec which forces the model to call the tool by the provided name. were not submitting multiple tools here so we should always call the tool generated by the schema definition.
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 a52470d in 36 seconds

More details
  • Looked at 36 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. lib/instructor/anthropic/patch.rb:26
  • Draft comment:
    Ensure that removing ::Anthropic.configuration.extra_headers does not affect other parts of the system that might rely on this header.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The removal of ::Anthropic.configuration.extra_headers might affect other parts of the system relying on this header. It's important to ensure that this change doesn't break any existing functionality.
2. lib/instructor/anthropic/patch.rb:24
  • Draft comment:
    The logic for setting parameters[:max_tokens] = 1024 is repeated. Consider refactoring to a method to adhere to the DRY principle.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_FVV5G1QjYhmYZeFw


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

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.

1 participant