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: adding async run to AnthropicChatGenerator #1461

Merged
merged 18 commits into from
Mar 5, 2025

Conversation

davidsbatista
Copy link
Contributor

@davidsbatista davidsbatista commented Mar 3, 2025

Related Issues

Proposed Changes:

• Added async support to AnthropicChatGenerator with new run_async method
• Introduced AsyncAnthropic client initialization alongside existing sync client
• Refactored code to extract common functionality into prepare_messages_and_tools
• Added _process_response and _process_response_async methods to handle API responses
• Added async tests :

  • Basic async functionality tests
  • Live integration tests

• Made convert_anthropic_chunk_to_streaming_chunk and _remove_cache_control static methods
• Fixed usage metadata handling with proper Anthropic Usage type
• Maintained backward compatibility with existing sync functionality

How did you test it?

  • unit tests, integration tests, CI tests

Checklist

@github-actions github-actions bot added the type:documentation Improvements or additions to documentation label Mar 3, 2025
@davidsbatista davidsbatista changed the title adding asycn run + select_streaming_callback feat: adding async run to AnthropicChatGenerator Mar 3, 2025
@davidsbatista davidsbatista marked this pull request as ready for review March 4, 2025 12:57
@davidsbatista davidsbatista requested a review from a team as a code owner March 4, 2025 12:57
@davidsbatista davidsbatista requested review from mpangrazzi and removed request for a team March 4, 2025 12:57
Copy link
Contributor

@mpangrazzi mpangrazzi left a comment

Choose a reason for hiding this comment

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

I've left one comment about tests - LMK what you think about!

@davidsbatista davidsbatista requested a review from mpangrazzi March 5, 2025 10:04
Copy link
Contributor

@mpangrazzi mpangrazzi 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! There's only lint to fix I guess 😃

@mpangrazzi mpangrazzi self-requested a review March 5, 2025 10:09
@davidsbatista davidsbatista merged commit 4e0c15b into main Mar 5, 2025
11 checks passed
@davidsbatista davidsbatista deleted the feat/add-async-antrophic-chat branch March 5, 2025 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add run_async for AnthropicChatGenerator
2 participants