-
Notifications
You must be signed in to change notification settings - Fork 419
Add Amazon Bedrock Agent Support #676
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
base: main
Are you sure you want to change the base?
Conversation
* Adding support using bedrock agent * update langchain issue * updated plan readme --------- Co-authored-by: Yossi Kricheli <yossik@amazon.com>
logger.info(f"Completion value type: {type(completion_value)}") | ||
# Try to extract the completion from the EventStream | ||
try: | ||
# Process the EventStream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you refactor this to reduce nesting and improve readability? I'd extract the response stream processing and extraction logics out into chunks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add some unit tests to cover this?
return [ | ||
{ | ||
"provider": Provider.BEDROCK.value, | ||
"name": "bedrock_agent", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we not using the agent alias here, or including it in the name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this @yosefkri.
QQ: Will there be a follow up CR for the UI Improvements e.g add Agents trace to the chatbot console?
One observation: The current approach only allows for a single pre-configured agent in the chatbot. For better flexibility, we may want to consider supporting multiple agents. Perhaps we could explore retrieving all available agents from the customer's Bedrock environment?
For reference, this CR provides some insights:
def list_bedrock_agents(): |
* Adding support using bedrock agent * update langchain issue * updated plan readme * Making code more readable --------- Co-authored-by: Yossi Kricheli <yossik@amazon.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this file ‘bedrock-agent-implementation-plan.md’ should be in the ./docs directory of the project somewhere not in the root.
Your PR also mentions how you've updated relevant docs but I don't see any of those yet. Is this PR still a WIP?
@Rob-Powell the PR is WIP since we decided to move to discover bedrock agent dynamically instead using specific agent ID. |
* Adding support using bedrock agent * update langchain issue * updated plan readme * Making code more readable * Added list agent feature * Added support to specific agent or list agents * Added support for bedrock agent by passing the s3 uri for file upload --------- Co-authored-by: Yossi Kricheli <yossik@amazon.com>
Pull Request Summary: Enhanced Bedrock Agent SupportThis pull request adds comprehensive support for Amazon Bedrock Agents in the AWS GenAI LLM Chatbot, with two main components: 1. S3 URI-Based File Handling for Bedrock AgentsWe've implemented a more efficient approach to file handling with Bedrock Agents by providing S3 URIs instead of embedding file content directly in prompts:
This approach allows Bedrock Agents to access files of any size through their 2. Bedrock Agent Management FunctionalityWe've added new capabilities to discover and interact with Bedrock Agents:
These enhancements make it easier to discover, select, and use Bedrock Agents within the chatbot framework. Technical Implementation Details
This pull request significantly improves the chatbot's ability to work with Bedrock Agents and handle file-based interactions more efficiently. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
- Please add unit tests at least for new logic and we should also have some integration tests for the Agentic flow.
- And fix linting errors -
npm run vet-all
run all the checks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add test coverage for this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add test coverage for this
Overview
This PR adds support for Amazon Bedrock agents to the AWS GenAI LLM Chatbot. Users can now configure and use Bedrock agents through the chatbot interface, providing an additional AI capability alongside existing LLM providers.
Key Changes
Configuration Updates
bedrock
section in config.json to include agent configurationBackend Implementation
Environment and Permissions
Model Registration
Error Handling and Logging
Testing
Challenges Addressed
Documentation
How to Test
Future Enhancements