Skip to content

Feature/add prompt caching to bedrock client#659

Open
kallilsouza wants to merge 2 commits intomainfrom
feature/history-summary-prompt-caching
Open

Feature/add prompt caching to bedrock client#659
kallilsouza wants to merge 2 commits intomainfrom
feature/history-summary-prompt-caching

Conversation

@kallilsouza
Copy link
Copy Markdown
Contributor

@kallilsouza kallilsouza commented Aug 28, 2025

What

Introduce PromptMessage dataclass and update AI integration methods

  • Added a new PromptMessage dataclass to encapsulate message text and caching behavior.
  • Updated the generate_text method in BaseAIPlatformClient to accept a list of PromptMessage objects instead of a single string.
  • Modified HistorySummaryService and BedrockClient to utilize the new PromptMessage structure for improved request formatting.

Why

This is done to use AWS Bedrock's prompt caching for faster model inference

Notes

The cache will only be applied if the prompt text hits the minimum number of tokens per cache checkpoint for the model used.

…hods

- Added a new PromptMessage dataclass to encapsulate message text and caching behavior.
- Updated the generate_text method in BaseAIPlatformClient to accept a list of PromptMessage objects instead of a single string.
- Modified HistorySummaryService and BedrockClient to utilize the new PromptMessage structure for improved request formatting.
…ntegration classes

- Changed the type hint for prompt_msgs in BaseAIPlatformClient and BedrockClient from list to List[PromptMessage] for better type safety and clarity.
- This aligns with the recent introduction of the PromptMessage dataclass.
@kallilsouza kallilsouza changed the title feat: Feature/add prompt caching to bedrock client Aug 28, 2025
@kallilsouza kallilsouza marked this pull request as ready for review August 28, 2025 20:47
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.

3 participants