- 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.
- Added a boolean property `isWaitingForAgentResponse` to the `TaskViewModel` class to track whether a task is being created and waiting for a response from the agent.
- When a task is being created, we set `isWaitingForAgentResponse` to `true` and notify the listeners.
- When the task creation process is completed (successfully or not), `isWaitingForAgentResponse` is set to `false` and listeners are notified.
- Updated the `ChatView` class to listen to changes in `TaskViewModel.isWaitingForAgentResponse` to show the loading indicator conditionally.
- Updated the regular expression pattern to include matching fenced code blocks in addition to headers.
- Set the `dotAll` parameter to `true` to match across multiple lines in the regular expression.
- Wrapped the message container with a `SingleChildScrollView` widget to enable scrolling when the message content exceeds the available space.
- Implemented logic to conditionally render the message as markdown or selectable text based on the value of `hasMarkdown`.
- Modified the `MarkdownStyleSheet` to customize the appearance of blockquotes and code blocks.
- Updated the child widget of the message container to reflect the changes.
- Create a unique container name based on agent ID
- Check if the container with the name exists, otherwise create a new container
- If the container is not running, start it; otherwise, restart it
- Execute the code in the container
- Return the output of the code execution
This change enables reusing the same container for consecutive code execution commands, allowing for iterative changes to the execution environment.
Note: This change also includes handling the case where the Docker image is not found locally by pulling it from Docker Hub. The image used in this case is "python:3-alpine".
- Change `ErrorInfo` class attribute `_repr` to `repr` for consistent serialization
- Update `__repr__` method to return `self.repr` instead of `self._repr`
- Replaced `error` field in `ActionErrorResult` with `ErrorInfo` model.
- Implemented `ErrorInfo` model with necessary fields (`args`, `message`, `exception_type`, `_repr`).
- Added `from_exception` method to `ErrorInfo` model to create an instance from an Exception object.
- Updated `ActionErrorResult.from_exception` method to utilize `ErrorInfo.from_exception`.
- Ensured that `ActionErrorResult` is now fully serializable and won't cause crashes.
- Made necessary changes in code comments and documentation.
This commit fixes crashes caused by attempted serialiation of `AgentException` objects in the `ActionHistory` (as part of `ActionErrorResult`s). To this end, it introduces a new `ErrorInfo` model to encapsulate information about the exception, including the exception type, message, arguments, and representation. The `from_exception` method is added to both `ActionErrorResult` and `ErrorInfo` to create an `ActionErrorResult` object from an exception, extracting the relevant information.
- Update the logic for checking if an agent name already exists to be case-insensitive.
- Update the error message when an agent with the same name already exists to specify that the name should be unique regardless of case.