Commit Graph

23 Commits

Author SHA1 Message Date
hunteraraujo
22ea449850 Integrate LeaderboardService into SkillTreeViewModel
This commit integrates the `LeaderboardService` into `SkillTreeViewModel` to enable benchmark report submissions to the leaderboard. A `BenchmarkRun` object is created from the evaluation response and submitted using the `submitReport` method from `LeaderboardService`.
2023-09-20 19:36:25 -07:00
hunteraraujo
377d0af228 Refactor SkillTreeViewModel and Update TaskQueueView UI for Task Status (#5269)
* Refactor SkillTreeViewModel and Update TaskQueueView UI for Task Status

* Notify UI when updating benchmark status
2023-09-19 23:30:22 -07:00
hunteraraujo
99035103e0 Rename benchmark_service directory to benchmark 2023-09-19 22:16:58 -07:00
hunteraraujo
525571c32e Enhance runBenchmark with TestSuite Tracking (#5268) 2023-09-19 21:31:02 -07:00
hunteraraujo
80682b41cb Add Early Termination to runBenchmark on Benchmark Failure (#5267) 2023-09-19 20:24:52 -07:00
hunteraraujo
a37b486227 Enhance SkillTreeViewModel to Manage Benchmark Status (#5266)
Enhance SkillTreeViewModel to Manage Benchmark Execution and Status
2023-09-19 20:20:31 -07:00
hunteraraujo
5afab461ee Refactor Benchmarking Workflow and Introduce New Data Models (#5264)
* New benchmark data models

* Update _benchmarkBaseUrl

* Remove ReportRequestBody

* Update benchmark service methods for proxy approach

* Add eval id to SkillNodeData

* Refactor runBenchmark Method for proxy approach
2023-09-19 17:01:15 -07:00
hunteraraujo
bf03dd8739 Refactor runBenchmark in SkillTreeViewModel for New Report Generation Flow
This commit updates the runBenchmark method in the SkillTreeViewModel class to align with the new report generation flow. The updated method does the following:

1. Checks if a benchmark is already running to prevent overlapping runs.
2. Sets a flag to indicate that the benchmark is running and notifies the UI.
3. Reverses the selected node hierarchy for report generation.
4. Loops through each node in the reversed hierarchy to:
  - Generate a unique UUID for each test run.
  - Create a ReportRequestBody object.
  - Call the generateSingleReport method in the BenchmarkService.
  - Update the UI after each single report is generated.

5. After all single reports are generated, it calls the generateCombinedReport method in the BenchmarkService, passing in all the generated UUIDs.

6. Finally, it sets the benchmark running flag to false and notifies the UI.

This change improves the report generation flow and allows for both individual and combined reports.
2023-09-18 19:55:01 -07:00
hunteraraujo
93094c7223 Extend TaskViewModel to Support Test Suites and Combined Data Sources
This commit significantly expands the functionalities of TaskViewModel to manage both tasks and test suites in a unified manner. The view model now serves as the primary business logic class that interacts with the UI for task and test suite management.

Key Enhancements:
- Introduced `_testSuites` list to store TestSuite objects.
- Added `combinedDataSource` to hold both tasks and test suites.
- Introduced `selectTestSuite` and `deselectTestSuite` methods for TestSuite selection management.
- Added methods for TestSuite CRUD operations (`addTestSuite`, `fetchTestSuites`, `_saveTestSuitesToPrefs`).
- Created `fetchAndCombineData` method to fetch and combine tasks and test suites into a single list, `combinedDataSource`.

This update provides a more robust and unified approach for managing tasks and test suites, thereby improving the application's modularity and scalability.
2023-09-18 15:03:53 -07:00
hunteraraujo
e90eb0fd61 Update ApiSettingsViewModel _baseURL 2023-09-18 13:31:48 -07:00
hunteraraujo
4463f75756 Fix issue where side bar view is not disabled 2023-09-16 22:19:42 -07:00
hunteraraujo
60ae12dfd5 Implement UI Disable Feature During Benchmark Run
Added a state variable isBenchmarkRunning in SkillTreeViewModel to track the status of benchmark execution. This state variable is used to conditionally disable specific UI components:

- The "Initiate test suite" button in TaskQueueView is disabled during the benchmark.
- All IconButtons in SideBarView are disabled during the benchmark.
- Node selection in SkillTreeView is disabled during the benchmark.

This ensures that the user cannot interact with these components while a benchmark test is running, thereby improving UX and preventing potential issues.
2023-09-16 19:24:54 -07:00
hunteraraujo
6b921b5eda Refactor test suite button + rename method to runBenchmark 2023-09-16 18:56:42 -07:00
hunteraraujo
25ce1d6be0 Fix regression with deleting tasks 2023-09-16 17:28:58 -07:00
hunteraraujo
a97e0dbe62 Integrate BenchmarkService into SkillTreeViewModel with Incomplete Methods
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.
2023-09-14 20:07:18 -07:00
hunteraraujo
3bba27dd3c Integrate JSON-based Skill Tree Initialization in ViewModel
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.
2023-09-13 17:53:24 -07:00
hunteraraujo
314cce75b5 Integrate TaskQueueView and Enhance SkillTree Functionality (#5206)
* 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
2023-09-12 14:01:32 -07:00
hunteraraujo
e1a5a2a481 Clear skill tree state when initializing tree 2023-09-10 15:12:52 -07:00
hunteraraujo
d6b0894c6b Add SkillTreeViewModel for managing skill tree state
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.
2023-09-10 14:28:17 -07:00
hunteraraujo
a933f117fb Add the ability to deselect a task 2023-09-06 12:21:30 -07:00
hunteraraujo
a8023c2598 Fix empty user chats 2023-09-06 12:15:57 -07:00
hunteraraujo
5cd1abab94 Implement Continuous Mode in ChatViewModel
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.
2023-09-06 11:42:45 -07:00
hunteraraujo
ef2d64513b Merge commit 'e5d30a9f6d0854e20049309333c2f637cd03025c' as 'frontend' 2023-09-06 11:22:37 -07:00