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: support for tools in AnthropicChatGenerator #118

Merged
merged 39 commits into from
Oct 30, 2024
Merged

Conversation

vblagoje
Copy link
Member

@vblagoje vblagoje commented Oct 16, 2024

Adds AnthropicChatGenerator with tools support

fixes deepset-ai/haystack#8261

@coveralls
Copy link

coveralls commented Oct 16, 2024

Pull Request Test Coverage Report for Build 11591846436

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.05%) to 89.461%

Totals Coverage Status
Change from base Build 11577089150: -0.05%
Covered Lines: 1859
Relevant Lines: 2078

💛 - Coveralls

@vblagoje vblagoje marked this pull request as ready for review October 21, 2024 15:12
@vblagoje vblagoje requested a review from a team as a code owner October 21, 2024 15:12
@vblagoje vblagoje requested review from silvanocerza and removed request for a team October 21, 2024 15:12
Copy link
Member

@anakin87 anakin87 left a comment

Choose a reason for hiding this comment

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

I found some opportunities for improvement and clarification.

Other than that:

  • tests
    • some unit tests can be added, to cover the introduced utility functions
    • serialization/deserialization in pipeline - similar to this
    • test round trip with tools (generate tool call, pass tool message, generate response) - similar to this
  • Let's export the component to haystack_experimental/components/__init__.py
  • Update the pydoc config in docs/pydoc/config/generators_api.yml

@vblagoje
Copy link
Member Author

@anakin87 I've done some basic work without polishing the details to get going in the agreed direction. Any idea what's up with CI?

@anakin87
Copy link
Member

I created a PR to fix the issue: #126
Let's see if it works.

@vblagoje
Copy link
Member Author

Looks good @anakin87 - I'll test out your notebook with Anthropic and do another pass to polish this latest stuff. Should be gtg tomorrow

@silvanocerza silvanocerza removed their request for review October 24, 2024 14:18
@vblagoje
Copy link
Member Author

vblagoje commented Oct 25, 2024

Here is the test notebook that implements the original tool_support notebook but now using AnthropicChatGenerator.

Copy link
Member

@anakin87 anakin87 left a comment

Choose a reason for hiding this comment

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

This PR is almost ready to be merged.
I found only a few possible simplifications...

pyproject.toml Outdated Show resolved Hide resolved
@anakin87
Copy link
Member

Please take into account this comment

@anakin87 anakin87 requested a review from a team as a code owner October 30, 2024 11:01
@anakin87 anakin87 requested review from dfokina and removed request for a team October 30, 2024 11:01
Copy link
Member

@anakin87 anakin87 left a comment

Choose a reason for hiding this comment

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

Messages conversion: I further simplified the logic and added a test.

I think it's good to go now!

@anakin87 anakin87 merged commit bad887b into main Oct 30, 2024
10 checks passed
@anakin87 anakin87 deleted the anthropic_tools branch October 30, 2024 11:10
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.

🧪 Tools: support for tools in AnthropicChatGenerator
3 participants