This commit integrates the `callGenerateReport` method from `SkillTreeViewModel` into the `TaskQueueView`. Now, when the user clicks the green checkmark button, the `callGenerateReport` method is triggered with hardcoded values for testing purposes.
Note: The implementation is still temporary and will be updated for dynamic behavior in the future.
This commit adds a new boolean field, "mock", to the `ReportRequestBody` class. This additional field is in line with the new requirements to specify whether the report is a mock or not.
The `toJson()` method is also updated to include this new field during serialization.
This commit integrates Firebase Authentication into the application and refactors the `main.dart` file to streamline the user authentication flow. The application will now automatically switch between the main layout and the authentication UI based on the user's sign-in status.
- Added Firebase initialization to the `main()` function for Firebase Authentication.
- Replaced the home page in `MyApp` with a `StreamBuilder` that listens for Firebase auth state changes.
- Based on the auth state, the home page will either show `MainLayout` (if the user is signed in) or `FirebaseAuthView` (if the user is not signed in).
- Added necessary imports for the Firebase and authentication services.
This commit adds the `FirebaseAuthView` class, a Flutter widget that serves as the UI for user authentication using Google and GitHub. The class uses the `AuthService` to handle the actual sign-in logic.
Features:
- Added an OutlinedButton for Google Sign-In, styled with Google's colors and logo.
- Added an OutlinedButton for GitHub Sign-In, styled with GitHub's colors and logo.
- Integrated the `AuthService` methods for Google and GitHub sign-in.
This commit introduces the AuthService class, which encapsulates the logic for signing in with Google and GitHub using Firebase Authentication. The class provides methods for initiating the OAuth flows for both providers and for signing out the user.
- Implemented `signInWithGoogle()` to handle Google Sign-In.
- Implemented `signInWithGitHub()` to handle GitHub Sign-In via popup.
- Added `signOut()` method for logging out the user.
- Added `getCurrentUser()` method to fetch the currently authenticated user.
This commit integrates the `BenchmarkService` into the main application setup through the `MultiProvider` in `main.dart`. The changes include:
1. Adding `BenchmarkService` to the list of service providers, allowing it to be accessible throughout the application via dependency injection.
2. Using `ProxyProvider` to ensure `BenchmarkService` gets the `RestApiUtility` instance as a dependency.
3. Modifying the `MyApp` class to fetch the `BenchmarkService` from the provider, making it ready for use in the application's lifecycle.
This addition allows `BenchmarkService` to be centrally managed and readily available for any part of the application that requires benchmark-related functionalities.
This commit enhances the `RestApiUtility` class to support multiple base URLs by incorporating an `ApiType` enum parameter in its methods. The changes include:
1. `_agentBaseUrl`: The base URL for the agent-related API calls.
2. `_benchmarkBaseUrl`: A hard-coded base URL for benchmark-related API calls.
3. `_getEffectiveBaseUrl`: A new private method that determines the effective base URL based on the given `ApiType`.
All public methods (`get`, `post`, `getBinary`) have been updated to include an optional `ApiType` parameter, which defaults to `ApiType.agent`. Based on this parameter, `_getEffectiveBaseUrl` is called to decide the base URL for the HTTP request.
This change allows for flexible API calls without the need to instantiate multiple `RestApiUtility` objects for different services.
This commit extends the `SkillTreeViewModel` to include `BenchmarkService` as a dependency. This integration allows for leveraging benchmark-related API calls within the skill tree logic.
Two new methods have been added to `SkillTreeViewModel`:
1. `callGenerateReport`: This method attempts to call the `generateReport` function from the `BenchmarkService`. Currently, it only prints the API response and is incomplete in terms of full functionality.
2. `callPollUpdates`: Similar to `callGenerateReport`, this method aims to call `pollUpdates` from `BenchmarkService` and prints the API response. This is also incomplete and will require further development.
Both methods are preliminary and will require additional features to become fully functional.
This commit introduces the `BenchmarkService` class, which encapsulates API calls related to benchmarking operations. The class includes two methods:
1. `generateReport`: Takes a `ReportRequestBody` object as input and performs a POST request to the `/reports` URL, serializing the object to JSON format.
2. `pollUpdates`: Accepts a UNIX UTC timestamp as an argument and performs a GET request to the `/updates?last_update_time=<timestamp>` URL.
Both methods use the `RestApiUtility` for making HTTP requests and are designed to work with different base URLs, controlled by the `ApiType` enum.
This commit adds a new enum, `ApiType`, to allow dynamic selection between different base URLs for API calls. The enum has two values: `agent` and `benchmark`, corresponding to different services.
The `ApiType` enum is designed to be passed as a parameter to the `RestApiUtility` methods, enabling the utility to decide which base URL to use for HTTP requests.
This commit introduces a new Dart class, `ReportRequestBody`, which represents the request body for generating reports in the `BenchmarkService`. The class includes a `toJson` method for easy serialization to JSON format.
- `category`: Specifies the category of the report (e.g., "coding").
- `tests`: A list of tests to be included in the report.
This commit substantially upgrades the SkillTreeViewModel by incorporating asynchronous initialization from a JSON asset. Now, both nodes and edges of the skill tree are dynamically generated based on the JSON data. This not only enhances the modularity of the code but also simplifies the process of updating or modifying the skill tree.
Other improvements include:
- Changed node IDs from integers to strings for better flexibility.
- Added a function to get a node by its ID, improving code reusability.
- Introduced error handling for potential issues during JSON parsing or node retrieval.
- Updated the sibling, level, and subtree separation configurations for the graph view layout.
These changes make the skill tree more dynamic and maintainable, setting the stage for future extensions.
This commit refactors the SkillTreeView class to include asynchronous initialization through FutureBuilder. The new version also replaces the integer-based node IDs with string-based IDs, aligning better with the SkillTreeNode model. The code now clears previous graph nodes and edges before adding new ones, preventing duplication. Additionally, the TreeNodeView component is now populated dynamically with data from the SkillTreeNode model, making the tree view more robust and integrated.
This commit updates the TreeNodeView class from a stateless widget to a stateful widget to handle hover interactions. The new version also replaces the old simple text-based representation with a more interactive and visually appealing design that includes icons and hover effects. The SkillTreeNode model is now used to populate the node information, making the TreeNodeView more dynamic and integrated with the rest of the application.
This commit extends the SkillTreeNode class to incorporate new attributes such as 'data', 'label', and 'shape', making the model more comprehensive. The JSON deserialization is also updated to handle optional or missing fields by providing default values, improving the robustness of the model.
This commit updates the SkillNodeData class to handle optional or missing JSON fields more robustly. Now, the model provides default values for each field, ensuring that the object can be instantiated successfully even if some JSON fields are missing or set to null.
This commit updates the Info class to provide default values for optional or missing fields in the JSON payload. This ensures that the model can be successfully instantiated even when some JSON fields are absent or set to null.
This commit modifies the Ground class to make it more robust against optional or missing fields in the incoming JSON data. Default values have been added to ensure that the model can be instantiated even if some JSON fields are missing or set to null.
This commit adds the tree_structure.json file to the assets directory, which contains the initial skill tree structure. This JSON file will serve as the data source for rendering the skill tree nodes and edges in the application.
* Add TestQueueView to Main Layout
This commit integrates the TestQueueView into the main layout. The layout now conditionally displays the TestQueueView based on whether a node in the SkillTree is selected.
- TestQueueView appears when a SkillTree node is selected.
- Main layout adjusts to accommodate TestQueueView alongside SkillTreeView and ChatView.
- Implemented responsive layout logic to manage the widths of the different views based on the screen width and the state of the SkillTree.
* Extend SkillTreeViewModel to Track Selected Node Hierarchy
This commit enhances the SkillTreeViewModel to maintain a list of nodes that form a hierarchy from the currently selected node to the root. This allows for more interactive and informative views that can leverage this hierarchical data.
- Added a new property `selectedNodeHierarchy` to keep track of the node hierarchy.
- Modified the `toggleNodeSelection` method to populate or clear `selectedNodeHierarchy` based on node selection.
- Introduced a new method `populateSelectedNodeHierarchy` to build the hierarchy from the selected node to the root.
* Extract skill tree view model reset state to method
* Implement UI enhancements for TaskQueueView
This commit introduces several UI improvements to the TaskQueueView:
- Tiles are padded 20 units from both the leading and trailing edges.
- Tiles now have a white background.
- Added a thin black border to the tiles.
- Incorporated a slight corner radius for the tiles.
- Centered the title and subtitle horizontally within the tiles.
- Added a checkmark button with a tooltip at the bottom-right corner for running a suite of tests.
These changes aim to improve the user experience and visual appeal of the TaskQueueView.
* Make MainLayout a consumer of SkillTreeViewModel
This commit replaces the placeholder implementation of the SkillTreeView class with a complete, functional version.
Features:
- Initializes the skill tree from the SkillTreeViewModel during `initState`.
- Dynamically creates Node and Edge objects for GraphView based on ViewModel data.
- Utilizes the TreeNodeView to render individual nodes.
- Integrates node selection functionality from the ViewModel.
- Adds InteractiveViewer for zoom and pan capabilities.
The new SkillTreeView is designed to work closely with SkillTreeViewModel to manage and display the skill tree.
This commit adds the TreeNodeView class, a StatelessWidget responsible for rendering individual nodes in the skill tree.
Features:
- Displays the node ID in the view.
- Uses the Provider package to interact with the SkillTreeViewModel.
- Includes an onTap method to toggle node selection state.
- Updates the UI to reflect the selected state by changing the background color.
The TreeNodeView is designed to work in conjunction with SkillTreeViewModel to manage node selection states.
The SkillTreeViewModel class serves as the view model for the skill tree and extends Flutter's ChangeNotifier for state management.
Features include:
- Storing and managing the list of SkillTreeNodes and SkillTreeEdges.
- Managing the state of the selected node.
- Initializing the skill tree with predefined nodes and edges.
- Methods for toggling node selection, allowing for only a single node to be selected at any given time.
The view model utilizes the GraphView package for visualization and layout.
The SkillTreeEdge model represents the relationship between different skill nodes.
It includes:
- Edge ID
- Source node ID
- Destination node ID
- Arrows property to indicate directionality
The SkillNodeData model aggregates various data related to a skill node.
It includes:
- Node name
- Node category
- Associated task
- Dependencies
- Cutoff value
- Ground object for evaluation details
- Info object for metadata
The Info data model holds metadata about a skill node.
It includes:
- The difficulty level of the skill node
- A description of the skill node
- A list of potential side effects related to the skill node
The Ground data model stores evaluation information for each skill node.
It includes:
- The answer to be evaluated
- A list of terms that should be contained in the answer
- A list of terms that should not be contained in the answer
- A list of associated files
- A map for additional evaluation criteria
Added the downloadArtifact method to the ChatService class, enabling the download of artifacts in the Flutter web application. The function uses the dart:html package to trigger a browser-based file download, allowing users to save artifacts locally. This implementation complements the existing REST API and enhances the user experience.
Implemented auto-scrolling in the chat message list to ensure that the view scrolls down to the most recent message when a new chat is added. This behavior only triggers if the user is already at the bottom of the list, providing a seamless user experience.
- Added a new boolean state `isContinuousMode` to the `ChatInputField` widget to handle the continuous mode feature.
- Introduced a new callback function `onContinuousModePressed` to manage the state of the continuous mode from an external source.
- Conditionally rendered the send button based on the `isContinuousMode` state.
- Enhanced the UI by adding a button to toggle between continuous mode and single message mode, which triggers the `onContinuousModePressed` callback.
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.
Updated the StepRequestBody class to allow both 'input' and 'additionalInput' to be optional. Added logic in toJson() method to return an empty JSON object if both fields are null.
This commit wraps the TaskView and ChatView in a SafeArea widget to ensure that they are not hidden behind the CupertinoTabView. This addresses the issue where parts of these views were obscured, particularly when using the app on smaller screens.
- Wrapped TaskView in SafeArea
- Wrapped ChatView in SafeArea
This change improves the user experience by ensuring that all content is visible and accessible.
This commit integrates the actual JSON response received from the API into the AgentMessageTile. Now, each AgentMessageTile will display the associated JSON response when expanded.
- Converted Map<String, dynamic> JSON response to a string using jsonEncode.
- Passed the JSON-formatted string to JsonCodeSnippetView.
- Updated AgentMessageTile to include this change.
This change enhances the debugging and transparency features of the chat interface.
Update TaskListTile to truncate task titles that overflow.
- Modify the Text widget to limit it to a single line.
- Add TextOverflow.ellipsis to show an ellipsis when the text overflows.
Ensure that only one TaskListTile can be selected at a time.
- Refactor TaskListTile to be a StatelessWidget.
- Remove internal state `_isSelected` from TaskListTile.
- Add a `selected` boolean prop to TaskListTile to control its selection state from the parent.
- Update the parent widget to manage the selection state and pass it down to TaskListTile.