-
Notifications
You must be signed in to change notification settings - Fork 1
Finish dataset migration #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ddee097
feat: add mcp_coding_task and rename logs_dir to log_dir across confi…
ericwindmill c9b75b0
checkin
ericwindmill 42e09d3
feat: add local venv support for CLI processes, enable task-id variab…
ericwindmill 76e263c
Apply suggestions from code review
ericwindmill ea4f550
support windows
ericwindmill fbaf908
Merge branch 'init-skills-migration' of https://github.com/flutter/ev…
ericwindmill 7f4bb33
Merge branch 'main' of https://github.com/flutter/evals into init-ski…
ericwindmill 7b271bc
remove dead code
ericwindmill File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| # Pyrefly configuration | ||
| # Tell Pyrefly to use the repo-root venv Python interpreter | ||
|
|
||
| python-interpreter = "../../.venv/bin/python" | ||
| python-interpreter = "../../../dash_evals/.venv/bin/python" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
packages/dash_evals/src/dash_evals/runner/tasks/mcp_coding_task.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| """Tests the agent's ability to use the Dart MCP server""" | ||
|
|
||
| from inspect_ai import Task, task | ||
| from inspect_ai.dataset import Dataset | ||
| from inspect_ai.model import ChatMessageSystem | ||
| from inspect_ai.scorer import model_graded_fact | ||
| from inspect_ai.solver import Generate, Solver, TaskState, solver | ||
|
|
||
| from dash_evals.runner.scorers import export_workspace, mcp_tool_usage | ||
| from dash_evals.runner.solvers import setup_workspace | ||
|
|
||
| from .task_helpers import ( | ||
| append_context_injection, | ||
| append_model_interaction, | ||
| build_task_metadata, | ||
| ) | ||
|
|
||
|
|
||
| @solver | ||
| def _add_working_dir_system_message() -> Solver: | ||
| """Adds a dynamic system message with the working directory.""" | ||
|
|
||
| async def solve(state: TaskState, generate: Generate) -> TaskState: | ||
| working_dir = state.metadata.get("working_dir", "") | ||
| host_workspace = state.metadata.get("host_workspace") | ||
|
|
||
| if host_workspace: | ||
| # Container sandbox | ||
| current_dir = f"/workspace/{working_dir}" | ||
| else: | ||
| # Local sandbox | ||
| current_dir = working_dir | ||
|
|
||
| message = f""" | ||
| You are an expert Dart and Flutter developer. Use all the tools available to | ||
| you to accomplish the task and ensure the result is free of errors. | ||
|
|
||
| The current project directory is {current_dir} | ||
|
|
||
| For MCP tools, use the following root path: | ||
| file://{current_dir} | ||
| """ | ||
| state.messages.insert(0, ChatMessageSystem(content=message.strip())) | ||
| return state | ||
|
|
||
| return solve | ||
|
|
||
|
|
||
| @task | ||
| def mcp_coding_task(dataset: Dataset, config: dict) -> Task: | ||
| """ | ||
| Tests the agent's ability to use the Dart MCP server for generic coding tasks. | ||
|
|
||
| Args: | ||
| dataset: Inspect dataset loaded from JSONL. | ||
| config: Task configuration containing dataset, context, and variant. | ||
| """ | ||
| solver_chain = [_add_working_dir_system_message()] | ||
|
|
||
| append_context_injection(solver_chain, config) | ||
| append_model_interaction(solver_chain, config) | ||
|
|
||
| scorers: list = [model_graded_fact(), mcp_tool_usage()] | ||
| if config.get("save_examples"): | ||
| scorers.append(export_workspace()) | ||
|
|
||
| return Task( | ||
| name=config["task_name"], | ||
| dataset=dataset, | ||
| setup=[setup_workspace()], | ||
| solver=solver_chain, | ||
| scorer=scorers, | ||
| time_limit=300, | ||
| metadata=build_task_metadata(config), | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.