feat: support feedback on frontend and store in dynamodb #461
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #
🤖 AI-Generated PR Description (Powered by Amazon Bedrock)
Description
This pull request introduces a new feature for managing chat history and removes the existing functionality for listing messages, sessions, and ratings from the DynamoDB database. The key changes are:
chat_history_management.py
to handle chat history operations.list_messages.py
,list_sessions.py
, andrating.py
as they are no longer needed.api-stack.ts
file to integrate the new chat history management functionality into the API Gateway.ChatBot.tsx
andSessionHistory.tsx
components in the portal to use the new chat history management API.index.ts
file to include the necessary type definitions for the chat history feature.Type of change
File Stats Summary
File number involved in this PR: 8, unfold to see the details:
The file changes summary is as follows:
messageId
to theMessageType
interface and the messages array. It also adds functionality to send feedback (thumbs up or thumbs down) for each AI message to the backend. The feedback state is managed using thefeedbackGiven
state object, which maps message indices to the feedback type ('thumb_up', 'thumb_down', or null). Feedback buttons are rendered below each AI message, allowing the user to provide feedback.messageId
field to theSessionMessage
type, and changing themodel
field in theChatbotDetailResponse
type to an object withmodel_endpoint
andmodel_name
properties.