-
Notifications
You must be signed in to change notification settings - Fork 2
Add basic support for agent runtime #58
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
Conversation
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.
Pull Request Overview
This PR adds support for Amazon Bedrock Agent Runtime's knowledge base retrieval functionality, enabling Retrieval-Augmented Generation (RAG) applications in the Swift Bedrock Library.
Key Changes:
- Added
BedrockAgentRuntimeProtocoland client integration following the existing pattern for other Bedrock clients - Implemented
retrieve()function inBedrockServicefor querying knowledge bases with configurable result counts - Created
RetrieveResultwrapper with convenience methods for accessing results and exporting to JSON
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
Sources/BedrockService/BedrockService.swift |
Integrated BedrockAgentRuntimeClient into BedrockService initialization |
Sources/BedrockService/BedrockService+AgentRuntime.swift |
Added client factory and retrieve() function for knowledge base queries |
Sources/BedrockService/RetrieveResult.swift |
Created result wrapper with bestMatch() and toJSON() convenience methods |
Sources/BedrockService/Protocols/BedrockAgentRuntimeProtocol.swift |
Added protocol for BedrockAgentRuntimeClient to enable mocking |
Sources/BedrockService/Protocols/BedrockConfigProtocol.swift |
Extended BedrockConfigProtocol conformance to BedrockAgentRuntimeClient |
Sources/BedrockService/Docs.docc/Retrieval.md |
Added comprehensive documentation with usage examples |
Sources/BedrockService/Docs.docc/BedrockService.md |
Added Retrieval documentation reference |
Package.swift |
Added AWSBedrockAgentRuntime dependency |
Examples/retrieve/Sources/Retrieve.swift |
Created example application demonstrating knowledge base retrieval |
Examples/retrieve/Package.swift |
Added package manifest for retrieve example |
Examples/retrieve/.gitignore |
Added gitignore for example project |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Add Amazon Bedrock Knowledge Base Retrieval Support
This PR adds support for Amazon Bedrock Agent Runtime's knowledge base retrieval functionality, enabling RAG (Retrieval-Augmented Generation) applications.
Key Changes:
BedrockAgentRuntimeProtocoland client integration following existing patternsretrieve()function toBedrockServicefor querying knowledge basesRetrieveResultwrapper with convenience methods (bestMatch(),toJSON())AWSBedrockAgentRuntimedependencyUsage: