Skip to content

fix: aws agent events#9807

Closed
edwinjosechittilappilly wants to merge 4 commits into
mainfrom
fix-aws-events
Closed

fix: aws agent events#9807
edwinjosechittilappilly wants to merge 4 commits into
mainfrom
fix-aws-events

Conversation

@edwinjosechittilappilly
Copy link
Copy Markdown
Collaborator

This pull request introduces enhanced support for AWS Anthropic function call streaming in the agent event handling logic. The main changes focus on detecting, processing, and cleaning up AWS Anthropic-specific markup in streaming agent messages, ensuring a smoother and more accurate user experience. Additionally, the dependency specification for langchain-aws is updated for broader compatibility.

AWS Anthropic function call streaming support

  • Added global state management (_aws_anthropic_state) and helper functions to detect, accumulate, process, and clean AWS Anthropic function call markup in streamed agent text (src/lfx/src/lfx/base/agents/events.py). [1] [2]
  • Updated handle_on_chain_stream to always accumulate text for Anthropic processing, clean up markup, and only send new, cleaned text chunks to the agent message (src/lfx/src/lfx/base/agents/events.py).
  • Modified handle_on_chain_end to perform final processing and cleanup of any remaining AWS Anthropic function call markup before completing the agent message (src/lfx/src/lfx/base/agents/events.py).
  • Ensured Anthropic state is reset at the start of each chain for correct processing (src/lfx/src/lfx/base/agents/events.py).

Dependency update

  • Changed langchain-aws dependency from an exact version to a minimum version requirement for improved compatibility (pyproject.toml).

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Sep 10, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-aws-events

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the bug Something isn't working label Sep 10, 2025
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Sep 10, 2025
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Sep 10, 2025
@sonarqubecloud
Copy link
Copy Markdown

@Cristhianzl
Copy link
Copy Markdown
Member

please follow up this PR #9822

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

Successfully merging this pull request may close these issues.

2 participants