- Added logic to display a temporary chat message while waiting for the response from the agent.
- When a user sends a message, a temporary chat message is created and displayed.
- Implemented a method to remove the temporary chat message when the response is received or in case of an error.
- Updated the UI to invoke the method for adding a temporary chat message when the send button is pressed.
Feedback:
- This change improves the user experience by allowing them to see their own message immediately while waiting for the response from the agent.
A new property named _isWaitingForAgentResponse has been introduced to the ChatViewModel class to track the loading state when waiting for the agent's response. This boolean property is set to true when a chat message is being sent and reverts to false upon completion, whether successful or not. The notifyListeners() method is invoked to update the UI accordingly. This enhancement facilitates the display of a loading indicator, offering users visual feedback during the wait time for agent responses.
- Enhanced the `Chat` model to include an `artifacts` field to hold associated artifacts.
- Updated the `AgentMessageTile` widget to display the number of artifacts and added functionality to trigger artifact downloads upon button press.
- Introduced a method in `ChatViewModel` to leverage the `ChatService` for artifact downloads.
Refactored the ChatViewModel's sendChatMessage method to utilize the continuousModeSteps setting from the SettingsViewModel. This allows the continuous chat mode to honor the user's preference from the settings. Also introduced an optional currentStep parameter with a default value, enabling better control over the progression of continuous mode.
Added a new state variable `_isContinuousMode` to the ChatViewModel to track whether the chat is in continuous mode or not. This state is toggled via a setter and triggers UI updates through `notifyListeners()`.
Enhanced the `sendChatMessage` method to automatically send a null message if continuous mode is active, triggering the next step in the chat.