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 improvements to the chatbot functionality. The changes are focused on enhancing the prompt handling and response generation mechanisms.
In
prompt_utils.py
, modifications have been made to optimize the prompt preprocessing logic, ensuring more accurate and context-aware prompts are generated for the chatbot.The
response_utils.py
file has been updated to refine the response generation process. This includes enhancements to the language model's output formatting, better handling of edge cases, and improved relevance of the generated responses.Additionally, the
ChatBot.tsx
component in the frontend has been modified to seamlessly integrate the updated prompt and response handling mechanisms, providing a smoother user experience.Type of change
File Stats Summary
File number involved in this PR: 3, unfold to see the details:
The file changes summary is as follows:
🤖 AI-Generated PR Description (Powered by Amazon Bedrock)
Description
This pull request includes modifications to the prompt and response utility functions used in the chatbot application, as well as updates to the ChatBot component in the portal. The changes aim to improve the handling of user inputs and generate more appropriate responses from the chatbot.
Type of change
File Stats Summary
File number involved in this PR: 3, unfold to see the details:
The file changes summary is as follows:
🤖 AI-Generated PR Description (Powered by Amazon Bedrock)
Description
This pull request introduces a new feature that enables the chat history functionality for the chatbot application. The changes include modifications to the backend Lambda functions, as well as updates to the frontend React components.
The backend changes involve adding logic to store and retrieve chat history data from a DynamoDB table. The
chat_history_management.py
file has been modified to handle the storage and retrieval of chat history. Theddb_utils.py
,prompt_utils.py
, andresponse_utils.py
files have been updated to support the new chat history functionality.On the frontend, the
ChatBot.tsx
component has been updated to display the chat history and allow users to view and navigate through their previous conversations. TheSessionHistory.tsx
component has been introduced to render the chat history in a separate view. Theindex.ts
file in thetypes
directory has been modified to include new type definitions for the chat history data.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:
group_name
andchatbot_id
, to the class and incorporate them into the session and message data stored in DynamoDB tables.group_name
andchatbot_id
, to thecreate_ddb_history_obj
function, and pass these values when creating aDynamoDBChatMessageHistory
object in thecompose_connect_body
,restapi_event_handler
, anddefault_event_handler
functions.chatbotId
field to the list of fields returned when listing chat sessions and messages, allowing tracking of the chatbot used in each conversation.