AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
Add categories skill tree (#5295)
merwanehamadif67a3529371e
diff --git a/benchmark/agbenchmark/challenges/deprecated/code/1_password_generator/data.json b/benchmark/agbenchmark/challenges/deprecated/code/1_password_generator/data.jsonindex 404b371d96..646c2b926e 100644--- a/benchmark/agbenchmark/challenges/deprecated/code/1_password_generator/data.json+++ b/benchmark/agbenchmark/challenges/deprecated/code/1_password_generator/data.json@@ -23,6 +23,6 @@"difficulty": "basic","side_effects": []},- "name": "PasswordGenerator_Easy",+ "name": "PasswordGenerator","task": "Create a random password generator. The password should have between 8 and 16 characters and should contain letters, numbers and symbols. The password should be printed to the console. The entry point will be a python file that can be run this way: python password_generator.py [--len x] where x is the length of the password. If no length is specified, the password should be 8 characters long. The password_generator can also be imported as a module and called as password = password_generator.generate_password(len=x). Any invalid input should raise a ValueError."}diff --git a/benchmark/agbenchmark/challenges/verticals/code/1_three_sum/data.json b/benchmark/agbenchmark/challenges/verticals/code/1_three_sum/data.jsonindex 3b5f22c4f7..8095628e4f 100644--- a/benchmark/agbenchmark/challenges/verticals/code/1_three_sum/data.json+++ b/benchmark/agbenchmark/challenges/verticals/code/1_three_sum/data.json@@ -5,7 +5,7 @@],"cutoff": 60,"dependencies": [- "TestFunctionCodeGeneration"+ "TestWriteFile"],"eval_id": "29a10990-2584-4602-8b9d-c217f6edbc4f","ground": {diff --git a/benchmark/agbenchmark/challenges/verticals/code/2_password_generator/data.json b/benchmark/agbenchmark/challenges/verticals/code/2_password_generator/data.jsonindex d9a149592b..8a5cf94be5 100644--- a/benchmark/agbenchmark/challenges/verticals/code/2_password_generator/data.json+++ b/benchmark/agbenchmark/challenges/verticals/code/2_password_generator/data.json@@ -4,7 +4,7 @@],"cutoff": 90,"dependencies": [- "TestWriteFile"+ "TestThreeSum"],"eval_id": "0823b577-64f2-477b-856d-16726fe464b0","ground": {@@ -23,6 +23,6 @@"difficulty": "basic","side_effects": []},- "name": "PasswordGenerator_Easy",+ "name": "PasswordGenerator","task": "Create a random password generator. The password should have between 8 and 16 characters and should contain letters, numbers and symbols. The password should be printed to the console. The entry point will be a python file that can be run this way: python password_generator.py [--len x] where x is the length of the password. If no length is specified, the password should be 8 characters long. The password_generator can also be imported as a module and called as password = password_generator.generate_password(len=x). Any invalid input should raise a ValueError."}diff --git a/benchmark/agbenchmark/challenges/verticals/code/3_file_organizer/data.json b/benchmark/agbenchmark/challenges/verticals/code/3_file_organizer/data.jsonindex 45746d1def..ff3d5f37c9 100644--- a/benchmark/agbenchmark/challenges/verticals/code/3_file_organizer/data.json+++ b/benchmark/agbenchmark/challenges/verticals/code/3_file_organizer/data.json@@ -4,7 +4,7 @@],"cutoff": 90,"dependencies": [- "TestPasswordGenerator_Easy"+ "TestPasswordGenerator"],"eval_id": "6ace62be-6c18-431a-947f-72fb20984b58","ground": {@@ -23,6 +23,6 @@"difficulty": "basic","side_effects": []},- "name": "WritingCLI_FileOrganizer",+ "name": "FileOrganizer","task": "Create a file organizer CLI tool in Python that sorts files in a directory based on their file types (e.g., images, documents, audio) and moves them into these corresponding folders: 'images', 'documents', 'audio'. The entry point will be a python file that can be run this way: python organize_files.py --directory_path=YOUR_DIRECTORY_PATH"}diff --git a/benchmark/agbenchmark/challenges/verticals/code/4_url_shortener/data.json b/benchmark/agbenchmark/challenges/verticals/code/4_url_shortener/data.jsonindex 958caed7b0..cd471e8b63 100644--- a/benchmark/agbenchmark/challenges/verticals/code/4_url_shortener/data.json+++ b/benchmark/agbenchmark/challenges/verticals/code/4_url_shortener/data.json@@ -3,7 +3,9 @@"coding"],"cutoff": 150,- "dependencies": [],+ "dependencies": [+ "TestFileOrganizer"+ ],"eval_id": "41ca1035-ceca-4e0c-91ab-66ed0b350273","ground": {"answer": "The correct python file for a basic url shortener CLI",diff --git a/benchmark/agbenchmark/challenges/verticals/code/5_tic_tac_toe/data.json b/benchmark/agbenchmark/challenges/verticals/code/5_tic_tac_toe/data.jsonnew file mode 100644index 0000000000..df02b3c11b--- /dev/null+++ b/benchmark/agbenchmark/challenges/verticals/code/5_tic_tac_toe/data.json@@ -0,0 +1,28 @@+{+ "category": [+ "coding"+ ],+ "cutoff": 150,+ "dependencies": [+ "TestUrlShortener"+ ],+ "eval_id": "54c3d7e9-71d6-476b-b045-cf0aaf118f95",+ "ground": {+ "answer": "The correct python file for a TicTacToe game is written",+ "eval": {+ "type": "python"+ },+ "files": [+ "test.py"+ ],+ "should_contain": [],+ "should_not_contain": []+ },+ "info": {+ "description": "s ability for the agent to create Tic-Tac-Toe game",+ "difficulty": "basic",+ "side_effects": []+ },+ "name": "TicTacToe",+ "task": "Build a Tic-Tac-Toe game using a python CLI. Here are the specifications.\n\nThe Grid: The game board is a 3x3 grid, consisting of 3 rows and 3 columns, creating a total of 9 squares.\n\nPlayers: There are two players. One player uses the number \"1\", and the other player uses the number \"2\".\n\nTaking Turns: Players take turns to put their respective numbers (\"1\" or \"2\") in an empty square of the grid. Once a player has placed their number in a square, it cannot be changed or removed.\n\nObjective: The goal is to get three of your numbers in a row, either horizontally, vertically, or diagonally.\n\nEnd of the Game: The game concludes in one of two ways: One player gets three of their numbers in a row (horizontally, vertically, or diagonally) and is declared the winner.\nAll squares on the grid are filled, and no player has three in a row. This situation is a \"draw\" or a \"tie\".\n\nTechnical specifications:\nBuild a file called tic_tac_toe.py. This file will be called through command lines. You will have to prompt users for their move. Player 1 will always start.\nPlayers will input their move in the following format: \"x,y\" where x and y represent the location in the grid (0,0 is top left, 2,2 is bottom right).\n\nYour primary requirement is to halt the game when appropriate and to print only one of these three exact sentences:\n\n\"Player 1 won!\"\n\"Player 2 won!\"\n\"Draw\"\n\nEdge cases: A player can send an incorrect location. Either the location is incorrect or the square is already filled. In this case, this counts as doing nothing, and the player gets prompted for new locations again.\n\n\nYou will be expected to create a python file called tic_tac_toe.py that will run through command lines by using ```python tic_tac_toe.py```.\n\nHere is an example of how your tic_tac_toe.py game will be tested.\n```\nprocess = subprocess.Popen(\n ['python', 'tic_tac_toe.py'],\n stdout=subprocess.PIPE,\n text=True\n)\n\noutput, _ = process.communicate('\\n'.join([\"0,0\", \"1,0\", \"0,1\", \"1,1\", \"0,2\"]))\n\nassert \"Player 1 won!\" in output\n```"+}diff --git a/benchmark/agbenchmark/challenges/verticals/code/5_tic_tac_toe/data_draft.json b/benchmark/agbenchmark/challenges/verticals/code/5_tic_tac_toe/data_draft.jsondeleted file mode 100644index ed1188f187..0000000000--- a/benchmark/agbenchmark/challenges/verticals/code/5_tic_tac_toe/data_draft.json+++ /dev/null@@ -1,21 +0,0 @@-{- "name": "TicTacToe",- "category": ["coding"],- "task": "Build a Tic-Tac-Toe game using a python CLI. Here are the specifications.\n\nThe Grid: The game board is a 3x3 grid, consisting of 3 rows and 3 columns, creating a total of 9 squares.\n\nPlayers: There are two players. One player uses the number \"1\", and the other player uses the number \"2\".\n\nTaking Turns: Players take turns to put their respective numbers (\"1\" or \"2\") in an empty square of the grid. Once a player has placed their number in a square, it cannot be changed or removed.\n\nObjective: The goal is to get three of your numbers in a row, either horizontally, vertically, or diagonally.\n\nEnd of the Game: The game concludes in one of two ways: One player gets three of their numbers in a row (horizontally, vertically, or diagonally) and is declared the winner.\nAll squares on the grid are filled, and no player has three in a row. This situation is a \"draw\" or a \"tie\".\n\nTechnical specifications:\nBuild a file called tic_tac_toe.py. This file will be called through command lines. You will have to prompt users for their move. Player 1 will always start.\nPlayers will input their move in the following format: \"x,y\" where x and y represent the location in the grid (0,0 is top left, 2,2 is bottom right).\n\nYour primary requirement is to halt the game when appropriate and to print only one of these three exact sentences:\n\n\"Player 1 won!\"\n\"Player 2 won!\"\n\"Draw\"\n\nEdge cases: A player can send an incorrect location. Either the location is incorrect or the square is already filled. In this case, this counts as doing nothing, and the player gets prompted for new locations again.\n\n\nYou will be expected to create a python file called tic_tac_toe.py that will run through command lines by using ```python tic_tac_toe.py```.\n\nHere is an example of how your tic_tac_toe.py game will be tested.\n```\nprocess = subprocess.Popen(\n ['python', 'tic_tac_toe.py'],\n stdout=subprocess.PIPE,\n text=True\n)\n\noutput, _ = process.communicate('\\n'.join([\"0,0\", \"1,0\", \"0,1\", \"1,1\", \"0,2\"]))\n\nassert \"Player 1 won!\" in output\n```",- "dependencies": ["WriteFile"],- "cutoff": 150,- "ground": {- "answer": "The correct python file for a TicTacToe game is written",- "should_contain": [],- "should_not_contain": [],- "files": ["test.py"],- "eval": {- "type": "python"- }- },- "info": {- "difficulty": "basic",- "description": "s ability for the agent to create Tic-Tac-Toe game",- "side_effects": []- }-}diff --git a/benchmark/agbenchmark/challenges/verticals/code/6_battleship/data.json b/benchmark/agbenchmark/challenges/verticals/code/6_battleship/data.jsonnew file mode 100644index 0000000000..21b5b7d336--- /dev/null+++ b/benchmark/agbenchmark/challenges/verticals/code/6_battleship/data.json@@ -0,0 +1,26 @@+{+ "category": [+ "coding"+ ],+ "cutoff": 90,+ "dependencies": [+ "TestUrlShortener"+ ],+ "eval_id": "5a32418d-1c3a-4af1-8dc4-8d4c29bed21a",+ "ground": {+ "answer": "The implementation of battleship that passes all the tests.",+ "eval": {+ "type": "pytest"+ },+ "files": [],+ "should_contain": [],+ "should_not_contain": []+ },+ "info": {+ "description": "s ability for the agent to create a Battleship.",+ "difficulty": "expert",+ "side_effects": []+ },+ "name": "Battleship",+ "task": "Build a battleship game\n\nSpecifications:\n\nOverview: Battleship is a two-player strategy game where each player places their fleet of ships on a grid and tries to sink the opponent's fleet by guessing their locations.\nPlayers take turns calling out a row and column, attempting to name a square containing one of the opponent's ships.\n\nThe Grid: Each player's grid is a 10x10 grid, identified by rows (using numbers 1-10) and columns (using letters A-J).\n\nShips:\n\nCarrier - 5 squares\nBattleship - 4 squares\nCruiser - 3 squares\nSubmarine - 3 squares\nDestroyer - 2 squares\nEach ship occupies contiguous squares on the grid, arranged either horizontally or vertically.\n\nSetup:\n\nAt the start of the game, each player places their fleet on their grid. This setup is hidden from the opponent.\nThe game begins with Player 1, followed by Player 2, and so on.\nTaking Turns:\n\nOn a player's turn, they announce a grid square (e.g., \"D5\").\nThe opponent announces whether that square is a \"hit\" (if there's a part of a ship on that square) or \"miss\" (if the square is empty).\nIf a player hits a square occupied by a ship, they get another turn to guess. This continues until they make a miss, at which point their turn ends.\nIf a player hits all the squares occupied by a ship, the opponent must announce the sinking of that specific ship, e.g., \"You sank my Battleship!\"\n\nObjective: The goal is to sink all of your opponent's ships before they sink yours.\n\nEnd of the Game: The game ends when one player has sunk all of the opponent's ships. The winner is the player who sinks all the opposing fleet first.\n\nTechnical details:\nIn your root folder you will find an abstract class that defines the public interface of the Battleship class you will have to build:\n```\nfrom abc import ABC, abstractmethod\nfrom typing import Optional\n\nfrom pydantic import BaseModel, validator\n\n\n# Models for the request and response payloads\nclass ShipPlacement(BaseModel):\n ship_type: str\n start: dict # {\"row\": int, \"column\": str}\n direction: str\n\n @validator(\"start\")\n def validate_start(cls, start):\n row, column = start.get(\"row\"), start.get(\"column\")\n\n if not (1 <= row <= 10):\n raise ValueError(\"Row must be between 1 and 10 inclusive.\")\n\n if column not in list(\"ABCDEFGHIJ\"):\n raise ValueError(\"Column must be one of A, B, C, D, E, F, G, H, I, J.\")\n\n return start\n\n\nclass Turn(BaseModel):\n target: dict # {\"row\": int, \"column\": str}\n\n\nclass TurnResponse(BaseModel):\n result: str\n ship_type: Optional[str] # This would be None if the result is a miss\n\n\nclass GameStatus(BaseModel):\n is_game_over: bool\n winner: Optional[str]\n\n\nfrom typing import List\n\n\nclass Game(BaseModel):\n game_id: str\n players: List[str]\n board: dict # This could represent the state of the game board, you might need to flesh this out further\n ships: List[ShipPlacement] # List of ship placements for this game\n turns: List[Turn] # List of turns that have been taken\n\n\nclass AbstractBattleship(ABC):\n SHIP_LENGTHS = {\n \"carrier\": 5,\n \"battleship\": 4,\n \"cruiser\": 3,\n \"submarine\": 3,\n \"destroyer\": 2,\n }\n\n @abstractmethod\n def create_ship_placement(self, game_id: str, placement: ShipPlacement) -> None:\n \"\"\"\n Place a ship on the grid.\n \"\"\"\n pass\n\n @abstractmethod\n def create_turn(self, game_id: str, turn: Turn) -> TurnResponse:\n \"\"\"\n Players take turns to target a grid cell.\n \"\"\"\n pass\n\n @abstractmethod\n def get_game_status(self, game_id: str) -> GameStatus:\n \"\"\"\n Check if the game is over and get the winner if there's one.\n \"\"\"\n pass\n\n @abstractmethod\n def get_winner(self, game_id: str) -> str:\n \"\"\"\n Get the winner of the game.\n \"\"\"\n pass\n\n @abstractmethod\n def get_game(self) -> Game:\n \"\"\"\n Retrieve the state of the game.\n \"\"\"\n pass\n\n @abstractmethod\n def delete_game(self, game_id: str) -> None:\n \"\"\"\n Delete a game given its ID.\n \"\"\"\n pass\n\n @abstractmethod\n def create_game(self, game_id: str) -> None:\n \"\"\"\n Create a new game.\n \"\"\"\n pass\n\n```\nAt any moment you can run ```pytest``` to execute the tests.\nYou have two types of test: \n- positive tests => test the battleship game being used in ideal conditions\n- negative tests => tests the battleship game behaviour when used incorrectly\n\nSuccess criteria:\n- you will need to write a file called battleship.py that implements the abstract Battleship class.\n- this class will have to pass all the tests.\n- you're not allowed to modify any other file than the battleship.py. You can add other files as long as the main entrypoint is the battleship class."+}diff --git a/benchmark/agbenchmark/challenges/verticals/code/6_battleship/data_draft.json b/benchmark/agbenchmark/challenges/verticals/code/6_battleship/data_draft.jsondeleted file mode 100644index 65857404b6..0000000000--- a/benchmark/agbenchmark/challenges/verticals/code/6_battleship/data_draft.json+++ /dev/null@@ -1,21 +0,0 @@-{- "name": "Battleship",- "category": ["coding"],- "task": "Build a battleship game\n\nSpecifications:\n\nOverview: Battleship is a two-player strategy game where each player places their fleet of ships on a grid and tries to sink the opponent's fleet by guessing their locations.\nPlayers take turns calling out a row and column, attempting to name a square containing one of the opponent's ships.\n\nThe Grid: Each player's grid is a 10x10 grid, identified by rows (using numbers 1-10) and columns (using letters A-J).\n\nShips:\n\nCarrier - 5 squares\nBattleship - 4 squares\nCruiser - 3 squares\nSubmarine - 3 squares\nDestroyer - 2 squares\nEach ship occupies contiguous squares on the grid, arranged either horizontally or vertically.\n\nSetup:\n\nAt the start of the game, each player places their fleet on their grid. This setup is hidden from the opponent.\nThe game begins with Player 1, followed by Player 2, and so on.\nTaking Turns:\n\nOn a player's turn, they announce a grid square (e.g., \"D5\").\nThe opponent announces whether that square is a \"hit\" (if there's a part of a ship on that square) or \"miss\" (if the square is empty).\nIf a player hits a square occupied by a ship, they get another turn to guess. This continues until they make a miss, at which point their turn ends.\nIf a player hits all the squares occupied by a ship, the opponent must announce the sinking of that specific ship, e.g., \"You sank my Battleship!\"\n\nObjective: The goal is to sink all of your opponent's ships before they sink yours.\n\nEnd of the Game: The game ends when one player has sunk all of the opponent's ships. The winner is the player who sinks all the opposing fleet first.\n\nTechnical details:\nIn your root folder you will find an abstract class that defines the public interface of the Battleship class you will have to build:\n```\nfrom abc import ABC, abstractmethod\nfrom typing import Optional\n\nfrom pydantic import BaseModel, validator\n\n\n# Models for the request and response payloads\nclass ShipPlacement(BaseModel):\n ship_type: str\n start: dict # {\"row\": int, \"column\": str}\n direction: str\n\n @validator(\"start\")\n def validate_start(cls, start):\n row, column = start.get(\"row\"), start.get(\"column\")\n\n if not (1 <= row <= 10):\n raise ValueError(\"Row must be between 1 and 10 inclusive.\")\n\n if column not in list(\"ABCDEFGHIJ\"):\n raise ValueError(\"Column must be one of A, B, C, D, E, F, G, H, I, J.\")\n\n return start\n\n\nclass Turn(BaseModel):\n target: dict # {\"row\": int, \"column\": str}\n\n\nclass TurnResponse(BaseModel):\n result: str\n ship_type: Optional[str] # This would be None if the result is a miss\n\n\nclass GameStatus(BaseModel):\n is_game_over: bool\n winner: Optional[str]\n\n\nfrom typing import List\n\n\nclass Game(BaseModel):\n game_id: str\n players: List[str]\n board: dict # This could represent the state of the game board, you might need to flesh this out further\n ships: List[ShipPlacement] # List of ship placements for this game\n turns: List[Turn] # List of turns that have been taken\n\n\nclass AbstractBattleship(ABC):\n SHIP_LENGTHS = {\n \"carrier\": 5,\n \"battleship\": 4,\n \"cruiser\": 3,\n \"submarine\": 3,\n \"destroyer\": 2,\n }\n\n @abstractmethod\n def create_ship_placement(self, game_id: str, placement: ShipPlacement) -> None:\n \"\"\"\n Place a ship on the grid.\n \"\"\"\n pass\n\n @abstractmethod\n def create_turn(self, game_id: str, turn: Turn) -> TurnResponse:\n \"\"\"\n Players take turns to target a grid cell.\n \"\"\"\n pass\n\n @abstractmethod\n def get_game_status(self, game_id: str) -> GameStatus:\n \"\"\"\n Check if the game is over and get the winner if there's one.\n \"\"\"\n pass\n\n @abstractmethod\n def get_winner(self, game_id: str) -> str:\n \"\"\"\n Get the winner of the game.\n \"\"\"\n pass\n\n @abstractmethod\n def get_game(self) -> Game:\n \"\"\"\n Retrieve the state of the game.\n \"\"\"\n pass\n\n @abstractmethod\n def delete_game(self, game_id: str) -> None:\n \"\"\"\n Delete a game given its ID.\n \"\"\"\n pass\n\n @abstractmethod\n def create_game(self, game_id: str) -> None:\n \"\"\"\n Create a new game.\n \"\"\"\n pass\n\n```\nAt any moment you can run ```pytest``` to execute the tests.\nYou have two types of test: \n- positive tests => test the battleship game being used in ideal conditions\n- negative tests => tests the battleship game behaviour when used incorrectly\n\nSuccess criteria:\n- you will need to write a file called battleship.py that implements the abstract Battleship class.\n- this class will have to pass all the tests.\n- you're not allowed to modify any other file than the battleship.py. You can add other files as long as the main entrypoint is the battleship class.",- "dependencies": [],- "cutoff": 90,- "ground": {- "answer": "The implementation of battleship that passes all the tests.",- "should_contain": [],- "should_not_contain": [],- "files": [],- "eval": {- "type": "pytest"- }- },- "info": {- "difficulty": "expert",- "description": "s ability for the agent to create a Battleship.",- "side_effects": []- }-}diff --git a/benchmark/agbenchmark/utils/dependencies/graphs.py b/benchmark/agbenchmark/utils/dependencies/graphs.pyindex 2286105e62..3ce44f4fba 100644--- a/benchmark/agbenchmark/utils/dependencies/graphs.py+++ b/benchmark/agbenchmark/utils/dependencies/graphs.py@@ -275,17 +275,64 @@ def graph_interactive_network(graph_data = {"nodes": nt.nodes, "edges": nt.edges}home_path = Path.cwd()-write_pretty_json(graph_data, home_path / "frontend" / "public" / "graph.json")++ flutter_app_path = home_path.parent / "frontend" / "assets"+# Optionally, save to a file# Sync with the flutter UI# this literally only works in the AutoGPT repo, but this part of the code is not reached if BUILD_SKILL_TREE is false+ write_pretty_json(graph_data, flutter_app_path / "tree_structure.json")+ import json++ # Extract node IDs with category "coding"++ coding_tree = filter_tree_by_category(graph_data, "coding")+ write_pretty_json(+ coding_tree,+ flutter_app_path / "coding_tree_structure.json",+ )++ data_tree = filter_tree_by_category(graph_data, "data")write_pretty_json(- graph_data,- str(home_path.parent / "frontend" / "assets" / "tree_structure.json"),+ data_tree,+ flutter_app_path / "data_tree_structure.json",)+ general_tree = filter_tree_by_category(graph_data, "general")+ write_pretty_json(+ coding_tree,+ flutter_app_path / "general_tree_structure.json",+ )++ scrape_synthesize_tree = filter_tree_by_category(graph_data, "scrape_synthesize")+ write_pretty_json(+ scrape_synthesize_tree,+ flutter_app_path / "scrape_synthesize_tree_structure.json",+ )+ # If you want to convert back to JSON+ filtered_json = json.dumps(graph_data, indent=4)+ print(filtered_json)+if html_graph_path:file_path = str(Path(html_graph_path).resolve())nt.write_html(file_path)+++def filter_tree_by_category(graph_data, category):+ category_node_ids = set()+ for node in graph_data["nodes"]:+ if category in node["data"]["category"]:+ category_node_ids.add(node["id"])+ # Filter nodes+ graph_data["nodes"] = [+ node for node in graph_data["nodes"] if node["id"] in category_node_ids+ ]+ # Filter edges+ graph_data["edges"] = [+ edge+ for edge in graph_data["edges"]+ if edge["from"] in category_node_ids or edge["to"] in category_node_ids+ ]+ return graph_datadiff --git a/benchmark/frontend/public/graph.json b/benchmark/frontend/public/graph.jsonindex 91caef96d5..981d2bf739 100644--- a/benchmark/frontend/public/graph.json+++ b/benchmark/frontend/public/graph.json@@ -21,8 +21,8 @@{"arrows": "to","from": "agbenchmark/generate_test.py::TestWriteFile::test_method[challenge_data0]",- "id": "agbenchmark/generate_test.py::TestWriteFile::test_method[challenge_data0]_to_agbenchmark/generate_test.py::TestPasswordGenerator_Easy::test_method[challenge_data0]",- "to": "agbenchmark/generate_test.py::TestPasswordGenerator_Easy::test_method[challenge_data0]"+ "id": "agbenchmark/generate_test.py::TestWriteFile::test_method[challenge_data0]_to_agbenchmark/generate_test.py::TestThreeSum::test_method[challenge_data0]",+ "to": "agbenchmark/generate_test.py::TestThreeSum::test_method[challenge_data0]"},{"arrows": "to",@@ -38,9 +38,33 @@},{"arrows": "to",- "from": "agbenchmark/generate_test.py::TestPasswordGenerator_Easy::test_method[challenge_data0]",- "id": "agbenchmark/generate_test.py::TestPasswordGenerator_Easy::test_method[challenge_data0]_to_agbenchmark/generate_test.py::TestWritingCLI_FileOrganizer::test_method[challenge_data0]",- "to": "agbenchmark/generate_test.py::TestWritingCLI_FileOrganizer::test_method[challenge_data0]"+ "from": "agbenchmark/generate_test.py::TestPasswordGenerator::test_method[challenge_data0]",+ "id": "agbenchmark/generate_test.py::TestPasswordGenerator::test_method[challenge_data0]_to_agbenchmark/generate_test.py::TestFileOrganizer::test_method[challenge_data0]",+ "to": "agbenchmark/generate_test.py::TestFileOrganizer::test_method[challenge_data0]"+ },+ {+ "arrows": "to",+ "from": "agbenchmark/generate_test.py::TestFileOrganizer::test_method[challenge_data0]",+ "id": "agbenchmark/generate_test.py::TestFileOrganizer::test_method[challenge_data0]_to_agbenchmark/generate_test.py::TestUrlShortener::test_method[challenge_data0]",+ "to": "agbenchmark/generate_test.py::TestUrlShortener::test_method[challenge_data0]"+ },+ {+ "arrows": "to",+ "from": "agbenchmark/generate_test.py::TestThreeSum::test_method[challenge_data0]",+ "id": "agbenchmark/generate_test.py::TestThreeSum::test_method[challenge_data0]_to_agbenchmark/generate_test.py::TestPasswordGenerator::test_method[challenge_data0]",+ "to": "agbenchmark/generate_test.py::TestPasswordGenerator::test_method[challenge_data0]"+ },+ {+ "arrows": "to",+ "from": "agbenchmark/generate_test.py::TestUrlShortener::test_method[challenge_data0]",+ "id": "agbenchmark/generate_test.py::TestUrlShortener::test_method[challenge_data0]_to_agbenchmark/generate_test.py::TestTicTacToe::test_method[challenge_data0]",+ "to": "agbenchmark/generate_test.py::TestTicTacToe::test_method[challenge_data0]"+ },+ {+ "arrows": "to",+ "from": "agbenchmark/generate_test.py::TestUrlShortener::test_method[challenge_data0]",+ "id": "agbenchmark/generate_test.py::TestUrlShortener::test_method[challenge_data0]_to_agbenchmark/generate_test.py::TestBattleship::test_method[challenge_data0]",+ "to": "agbenchmark/generate_test.py::TestBattleship::test_method[challenge_data0]"},{"arrows": "to",@@ -283,6 +307,40 @@"label": "BasicRetrieval","shape": "dot"},+ {+ "color": "grey",+ "data": {+ "category": [+ "coding"+ ],+ "cutoff": 150,+ "dependencies": [+ "TestUrlShortener"+ ],+ "eval_id": "54c3d7e9-71d6-476b-b045-cf0aaf118f95",+ "ground": {+ "answer": "The correct python file for a TicTacToe game is written",+ "eval": {+ "type": "python"+ },+ "files": [+ "test.py"+ ],+ "should_contain": [],+ "should_not_contain": []+ },+ "info": {+ "description": "s ability for the agent to create Tic-Tac-Toe game",+ "difficulty": "basic",+ "side_effects": []+ },+ "name": "TestTicTacToe",+ "task": "Build a Tic-Tac-Toe game using a python CLI. Here are the specifications.\n\nThe Grid: The game board is a 3x3 grid, consisting of 3 rows and 3 columns, creating a total of 9 squares.\n\nPlayers: There are two players. One player uses the number \"1\", and the other player uses the number \"2\".\n\nTaking Turns: Players take turns to put their respective numbers (\"1\" or \"2\") in an empty square of the grid. Once a player has placed their number in a square, it cannot be changed or removed.\n\nObjective: The goal is to get three of your numbers in a row, either horizontally, vertically, or diagonally.\n\nEnd of the Game: The game concludes in one of two ways: One player gets three of their numbers in a row (horizontally, vertically, or diagonally) and is declared the winner.\nAll squares on the grid are filled, and no player has three in a row. This situation is a \"draw\" or a \"tie\".\n\nTechnical specifications:\nBuild a file called tic_tac_toe.py. This file will be called through command lines. You will have to prompt users for their move. Player 1 will always start.\nPlayers will input their move in the following format: \"x,y\" where x and y represent the location in the grid (0,0 is top left, 2,2 is bottom right).\n\nYour primary requirement is to halt the game when appropriate and to print only one of these three exact sentences:\n\n\"Player 1 won!\"\n\"Player 2 won!\"\n\"Draw\"\n\nEdge cases: A player can send an incorrect location. Either the location is incorrect or the square is already filled. In this case, this counts as doing nothing, and the player gets prompted for new locations again.\n\n\nYou will be expected to create a python file called tic_tac_toe.py that will run through command lines by using ```python tic_tac_toe.py```.\n\nHere is an example of how your tic_tac_toe.py game will be tested.\n```\nprocess = subprocess.Popen(\n ['python', 'tic_tac_toe.py'],\n stdout=subprocess.PIPE,\n text=True\n)\n\noutput, _ = process.communicate('\\n'.join([\"0,0\", \"1,0\", \"0,1\", \"1,1\", \"0,2\"]))\n\nassert \"Player 1 won!\" in output\n```"+ },+ "id": "agbenchmark/generate_test.py::TestTicTacToe::test_method[challenge_data0]",+ "label": "TicTacToe",+ "shape": "dot"+ },{"color": "grey","data": {@@ -291,7 +349,7 @@],"cutoff": 90,"dependencies": [- "TestWriteFile"+ "TestThreeSum"],"eval_id": "0823b577-64f2-477b-856d-16726fe464b0","ground": {@@ -310,11 +368,11 @@"difficulty": "basic","side_effects": []},- "name": "TestPasswordGenerator_Easy",+ "name": "TestPasswordGenerator","task": "Create a random password generator. The password should have between 8 and 16 characters and should contain letters, numbers and symbols. The password should be printed to the console. The entry point will be a python file that can be run this way: python password_generator.py [--len x] where x is the length of the password. If no length is specified, the password should be 8 characters long. The password_generator can also be imported as a module and called as password = password_generator.generate_password(len=x). Any invalid input should raise a ValueError."},- "id": "agbenchmark/generate_test.py::TestPasswordGenerator_Easy::test_method[challenge_data0]",- "label": "PasswordGenerator_Easy",+ "id": "agbenchmark/generate_test.py::TestPasswordGenerator::test_method[challenge_data0]",+ "label": "PasswordGenerator","shape": "dot"},{@@ -325,7 +383,7 @@],"cutoff": 90,"dependencies": [- "TestPasswordGenerator_Easy"+ "TestPasswordGenerator"],"eval_id": "6ace62be-6c18-431a-947f-72fb20984b58","ground": {@@ -344,11 +402,11 @@"difficulty": "basic","side_effects": []},- "name": "TestWritingCLI_FileOrganizer",+ "name": "TestFileOrganizer","task": "Create a file organizer CLI tool in Python that sorts files in a directory based on their file types (e.g., images, documents, audio) and moves them into these corresponding folders: 'images', 'documents', 'audio'. The entry point will be a python file that can be run this way: python organize_files.py --directory_path=YOUR_DIRECTORY_PATH"},- "id": "agbenchmark/generate_test.py::TestWritingCLI_FileOrganizer::test_method[challenge_data0]",- "label": "WritingCLI_FileOrganizer",+ "id": "agbenchmark/generate_test.py::TestFileOrganizer::test_method[challenge_data0]",+ "label": "FileOrganizer","shape": "dot"},{@@ -360,7 +418,7 @@],"cutoff": 60,"dependencies": [- "TestFunctionCodeGeneration"+ "TestWriteFile"],"eval_id": "29a10990-2584-4602-8b9d-c217f6edbc4f","ground": {@@ -390,6 +448,38 @@"label": "ThreeSum","shape": "dot"},+ {+ "color": "grey",+ "data": {+ "category": [+ "coding"+ ],+ "cutoff": 90,+ "dependencies": [+ "TestUrlShortener"+ ],+ "eval_id": "5a32418d-1c3a-4af1-8dc4-8d4c29bed21a",+ "ground": {+ "answer": "The implementation of battleship that passes all the tests.",+ "eval": {+ "type": "pytest"+ },+ "files": [],+ "should_contain": [],+ "should_not_contain": []+ },+ "info": {+ "description": "s ability for the agent to create a Battleship.",+ "difficulty": "expert",+ "side_effects": []+ },+ "name": "TestBattleship",+ "task": "Build a battleship game\n\nSpecifications:\n\nOverview: Battleship is a two-player strategy game where each player places their fleet of ships on a grid and tries to sink the opponent's fleet by guessing their locations.\nPlayers take turns calling out a row and column, attempting to name a square containing one of the opponent's ships.\n\nThe Grid: Each player's grid is a 10x10 grid, identified by rows (using numbers 1-10) and columns (using letters A-J).\n\nShips:\n\nCarrier - 5 squares\nBattleship - 4 squares\nCruiser - 3 squares\nSubmarine - 3 squares\nDestroyer - 2 squares\nEach ship occupies contiguous squares on the grid, arranged either horizontally or vertically.\n\nSetup:\n\nAt the start of the game, each player places their fleet on their grid. This setup is hidden from the opponent.\nThe game begins with Player 1, followed by Player 2, and so on.\nTaking Turns:\n\nOn a player's turn, they announce a grid square (e.g., \"D5\").\nThe opponent announces whether that square is a \"hit\" (if there's a part of a ship on that square) or \"miss\" (if the square is empty).\nIf a player hits a square occupied by a ship, they get another turn to guess. This continues until they make a miss, at which point their turn ends.\nIf a player hits all the squares occupied by a ship, the opponent must announce the sinking of that specific ship, e.g., \"You sank my Battleship!\"\n\nObjective: The goal is to sink all of your opponent's ships before they sink yours.\n\nEnd of the Game: The game ends when one player has sunk all of the opponent's ships. The winner is the player who sinks all the opposing fleet first.\n\nTechnical details:\nIn your root folder you will find an abstract class that defines the public interface of the Battleship class you will have to build:\n```\nfrom abc import ABC, abstractmethod\nfrom typing import Optional\n\nfrom pydantic import BaseModel, validator\n\n\n# Models for the request and response payloads\nclass ShipPlacement(BaseModel):\n ship_type: str\n start: dict # {\"row\": int, \"column\": str}\n direction: str\n\n @validator(\"start\")\n def validate_start(cls, start):\n row, column = start.get(\"row\"), start.get(\"column\")\n\n if not (1 <= row <= 10):\n raise ValueError(\"Row must be between 1 and 10 inclusive.\")\n\n if column not in list(\"ABCDEFGHIJ\"):\n raise ValueError(\"Column must be one of A, B, C, D, E, F, G, H, I, J.\")\n\n return start\n\n\nclass Turn(BaseModel):\n target: dict # {\"row\": int, \"column\": str}\n\n\nclass TurnResponse(BaseModel):\n result: str\n ship_type: Optional[str] # This would be None if the result is a miss\n\n\nclass GameStatus(BaseModel):\n is_game_over: bool\n winner: Optional[str]\n\n\nfrom typing import List\n\n\nclass Game(BaseModel):\n game_id: str\n players: List[str]\n board: dict # This could represent the state of the game board, you might need to flesh this out further\n ships: List[ShipPlacement] # List of ship placements for this game\n turns: List[Turn] # List of turns that have been taken\n\n\nclass AbstractBattleship(ABC):\n SHIP_LENGTHS = {\n \"carrier\": 5,\n \"battleship\": 4,\n \"cruiser\": 3,\n \"submarine\": 3,\n \"destroyer\": 2,\n }\n\n @abstractmethod\n def create_ship_placement(self, game_id: str, placement: ShipPlacement) -> None:\n \"\"\"\n Place a ship on the grid.\n \"\"\"\n pass\n\n @abstractmethod\n def create_turn(self, game_id: str, turn: Turn) -> TurnResponse:\n \"\"\"\n Players take turns to target a grid cell.\n \"\"\"\n pass\n\n @abstractmethod\n def get_game_status(self, game_id: str) -> GameStatus:\n \"\"\"\n Check if the game is over and get the winner if there's one.\n \"\"\"\n pass\n\n @abstractmethod\n def get_winner(self, game_id: str) -> str:\n \"\"\"\n Get the winner of the game.\n \"\"\"\n pass\n\n @abstractmethod\n def get_game(self) -> Game:\n \"\"\"\n Retrieve the state of the game.\n \"\"\"\n pass\n\n @abstractmethod\n def delete_game(self, game_id: str) -> None:\n \"\"\"\n Delete a game given its ID.\n \"\"\"\n pass\n\n @abstractmethod\n def create_game(self, game_id: str) -> None:\n \"\"\"\n Create a new game.\n \"\"\"\n pass\n\n```\nAt any moment you can run ```pytest``` to execute the tests.\nYou have two types of test: \n- positive tests => test the battleship game being used in ideal conditions\n- negative tests => tests the battleship game behaviour when used incorrectly\n\nSuccess criteria:\n- you will need to write a file called battleship.py that implements the abstract Battleship class.\n- this class will have to pass all the tests.\n- you're not allowed to modify any other file than the battleship.py. You can add other files as long as the main entrypoint is the battleship class."+ },+ "id": "agbenchmark/generate_test.py::TestBattleship::test_method[challenge_data0]",+ "label": "Battleship",+ "shape": "dot"+ },{"color": "grey","data": {@@ -397,7 +487,9 @@"coding"],"cutoff": 150,- "dependencies": [],+ "dependencies": [+ "TestFileOrganizer"+ ],"eval_id": "41ca1035-ceca-4e0c-91ab-66ed0b350273","ground": {"answer": "The correct python file for a basic url shortener CLI",diff --git a/frontend/assets/coding_tree_structure.json b/frontend/assets/coding_tree_structure.jsonnew file mode 100644index 0000000000..561eeed670--- /dev/null+++ b/frontend/assets/coding_tree_structure.json@@ -0,0 +1,249 @@+{+ "edges": [+ {+ "arrows": "to",+ "from": "agbenchmark/generate_test.py::TestWriteFile::test_method[challenge_data0]",+ "id": "agbenchmark/generate_test.py::TestWriteFile::test_method[challenge_data0]_to_agbenchmark/generate_test.py::TestThreeSum::test_method[challenge_data0]",+ "to": "agbenchmark/generate_test.py::TestThreeSum::test_method[challenge_data0]"+ },+ {+ "arrows": "to",+ "from": "agbenchmark/generate_test.py::TestPasswordGenerator::test_method[challenge_data0]",+ "id": "agbenchmark/generate_test.py::TestPasswordGenerator::test_method[challenge_data0]_to_agbenchmark/generate_test.py::TestFileOrganizer::test_method[challenge_data0]",+ "to": "agbenchmark/generate_test.py::TestFileOrganizer::test_method[challenge_data0]"+ },+ {+ "arrows": "to",+ "from": "agbenchmark/generate_test.py::TestFileOrganizer::test_method[challenge_data0]",+ "id": "agbenchmark/generate_test.py::TestFileOrganizer::test_method[challenge_data0]_to_agbenchmark/generate_test.py::TestUrlShortener::test_method[challenge_data0]",+ "to": "agbenchmark/generate_test.py::TestUrlShortener::test_method[challenge_data0]"+ },+ {+ "arrows": "to",+ "from": "agbenchmark/generate_test.py::TestThreeSum::test_method[challenge_data0]",+ "id": "agbenchmark/generate_test.py::TestThreeSum::test_method[challenge_data0]_to_agbenchmark/generate_test.py::TestPasswordGenerator::test_method[challenge_data0]",+ "to": "agbenchmark/generate_test.py::TestPasswordGenerator::test_method[challenge_data0]"+ },+ {+ "arrows": "to",+ "from": "agbenchmark/generate_test.py::TestUrlShortener::test_method[challenge_data0]",+ "id": "agbenchmark/generate_test.py::TestUrlShortener::test_method[challenge_data0]_to_agbenchmark/generate_test.py::TestTicTacToe::test_method[challenge_data0]",+ "to": "agbenchmark/generate_test.py::TestTicTacToe::test_method[challenge_data0]"+ },+ {+ "arrows": "to",+ "from": "agbenchmark/generate_test.py::TestUrlShortener::test_method[challenge_data0]",+ "id": "agbenchmark/generate_test.py::TestUrlShortener::test_method[challenge_data0]_to_agbenchmark/generate_test.py::TestBattleship::test_method[challenge_data0]",+ "to": "agbenchmark/generate_test.py::TestBattleship::test_method[challenge_data0]"+ }+ ],+ "nodes": [+ {+ "color": "grey",+ "data": {+ "category": [+ "coding"+ ],+ "cutoff": 150,+ "dependencies": [+ "TestUrlShortener"+ ],+ "eval_id": "54c3d7e9-71d6-476b-b045-cf0aaf118f95",+ "ground": {+ "answer": "The correct python file for a TicTacToe game is written",+ "eval": {+ "type": "python"+ },+ "files": [+ "test.py"+ ],+ "should_contain": [],+ "should_not_contain": []+ },+ "info": {+ "description": "s ability for the agent to create Tic-Tac-Toe game",+ "difficulty": "basic",+ "side_effects": []+ },+ "name": "TestTicTacToe",+ "task": "Build a Tic-Tac-Toe game using a python CLI. Here are the specifications.\n\nThe Grid: The game board is a 3x3 grid, consisting of 3 rows and 3 columns, creating a total of 9 squares.\n\nPlayers: There are two players. One player uses the number \"1\", and the other player uses the number \"2\".\n\nTaking Turns: Players take turns to put their respective numbers (\"1\" or \"2\") in an empty square of the grid. Once a player has placed their number in a square, it cannot be changed or removed.\n\nObjective: The goal is to get three of your numbers in a row, either horizontally, vertically, or diagonally.\n\nEnd of the Game: The game concludes in one of two ways: One player gets three of their numbers in a row (horizontally, vertically, or diagonally) and is declared the winner.\nAll squares on the grid are filled, and no player has three in a row. This situation is a \"draw\" or a \"tie\".\n\nTechnical specifications:\nBuild a file called tic_tac_toe.py. This file will be called through command lines. You will have to prompt users for their move. Player 1 will always start.\nPlayers will input their move in the following format: \"x,y\" where x and y represent the location in the grid (0,0 is top left, 2,2 is bottom right).\n\nYour primary requirement is to halt the game when appropriate and to print only one of these three exact sentences:\n\n\"Player 1 won!\"\n\"Player 2 won!\"\n\"Draw\"\n\nEdge cases: A player can send an incorrect location. Either the location is incorrect or the square is already filled. In this case, this counts as doing nothing, and the player gets prompted for new locations again.\n\n\nYou will be expected to create a python file called tic_tac_toe.py that will run through command lines by using ```python tic_tac_toe.py```.\n\nHere is an example of how your tic_tac_toe.py game will be tested.\n```\nprocess = subprocess.Popen(\n ['python', 'tic_tac_toe.py'],\n stdout=subprocess.PIPE,\n text=True\n)\n\noutput, _ = process.communicate('\\n'.join([\"0,0\", \"1,0\", \"0,1\", \"1,1\", \"0,2\"]))\n\nassert \"Player 1 won!\" in output\n```"+ },+ "id": "agbenchmark/generate_test.py::TestTicTacToe::test_method[challenge_data0]",+ "label": "TicTacToe",+ "shape": "dot"+ },+ {+ "color": "grey",+ "data": {+ "category": [+ "coding"+ ],+ "cutoff": 90,+ "dependencies": [+ "TestThreeSum"+ ],+ "eval_id": "0823b577-64f2-477b-856d-16726fe464b0",+ "ground": {+ "answer": "password_generator.py is created and satisfies the requirements.",+ "eval": {+ "type": "python"+ },+ "files": [+ "test.py"+ ],+ "should_contain": [],+ "should_not_contain": []+ },+ "info": {+ "description": "s ability for the agent to create a random password generator.",+ "difficulty": "basic",+ "side_effects": []+ },+ "name": "TestPasswordGenerator",+ "task": "Create a random password generator. The password should have between 8 and 16 characters and should contain letters, numbers and symbols. The password should be printed to the console. The entry point will be a python file that can be run this way: python password_generator.py [--len x] where x is the length of the password. If no length is specified, the password should be 8 characters long. The password_generator can also be imported as a module and called as password = password_generator.generate_password(len=x). Any invalid input should raise a ValueError."+ },+ "id": "agbenchmark/generate_test.py::TestPasswordGenerator::test_method[challenge_data0]",+ "label": "PasswordGenerator",+ "shape": "dot"+ },+ {+ "color": "grey",+ "data": {+ "category": [+ "coding"+ ],+ "cutoff": 90,+ "dependencies": [+ "TestPasswordGenerator"+ ],+ "eval_id": "6ace62be-6c18-431a-947f-72fb20984b58",+ "ground": {+ "answer": "The correct python file is written and organizes the files accordingly",+ "eval": {+ "type": "python"+ },+ "files": [+ "test.py"+ ],+ "should_contain": [],+ "should_not_contain": []+ },+ "info": {+ "description": "s ability for the agent to create a random password generator.",+ "difficulty": "basic",+ "side_effects": []+ },+ "name": "TestFileOrganizer",+ "task": "Create a file organizer CLI tool in Python that sorts files in a directory based on their file types (e.g., images, documents, audio) and moves them into these corresponding folders: 'images', 'documents', 'audio'. The entry point will be a python file that can be run this way: python organize_files.py --directory_path=YOUR_DIRECTORY_PATH"+ },+ "id": "agbenchmark/generate_test.py::TestFileOrganizer::test_method[challenge_data0]",+ "label": "FileOrganizer",+ "shape": "dot"+ },+ {+ "color": "grey",+ "data": {+ "category": [+ "coding",+ "iterate"+ ],+ "cutoff": 60,+ "dependencies": [+ "TestWriteFile"+ ],+ "eval_id": "29a10990-2584-4602-8b9d-c217f6edbc4f",+ "ground": {+ "answer": "The three_sum function coded properly.",+ "eval": {+ "type": "python"+ },+ "files": [+ "test.py"+ ],+ "should_contain": [+ "[0, 1, 2]",+ "[0, 2, 5]",+ "[0, 2, 3]"+ ],+ "should_not_contain": []+ },+ "info": {+ "description": "s ability for the agent to create the three_sum function.",+ "difficulty": "basic",+ "side_effects": []+ },+ "name": "TestThreeSum",+ "task": "Create a three_sum function in a file called sample_code.py. Given an array of integers, return indices of the three numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the same element twice. Example: Given nums = [2, 7, 11, 15], target = 20, Because nums[0] + nums[1] + nums[2] = 2 + 7 + 11 = 20, return [0, 1, 2]."+ },+ "id": "agbenchmark/generate_test.py::TestThreeSum::test_method[challenge_data0]",+ "label": "ThreeSum",+ "shape": "dot"+ },+ {+ "color": "grey",+ "data": {+ "category": [+ "coding"+ ],+ "cutoff": 90,+ "dependencies": [+ "TestUrlShortener"+ ],+ "eval_id": "5a32418d-1c3a-4af1-8dc4-8d4c29bed21a",+ "ground": {+ "answer": "The implementation of battleship that passes all the tests.",+ "eval": {+ "type": "pytest"+ },+ "files": [],+ "should_contain": [],+ "should_not_contain": []+ },+ "info": {+ "description": "s ability for the agent to create a Battleship.",+ "difficulty": "expert",+ "side_effects": []+ },+ "name": "TestBattleship",+ "task": "Build a battleship game\n\nSpecifications:\n\nOverview: Battleship is a two-player strategy game where each player places their fleet of ships on a grid and tries to sink the opponent's fleet by guessing their locations.\nPlayers take turns calling out a row and column, attempting to name a square containing one of the opponent's ships.\n\nThe Grid: Each player's grid is a 10x10 grid, identified by rows (using numbers 1-10) and columns (using letters A-J).\n\nShips:\n\nCarrier - 5 squares\nBattleship - 4 squares\nCruiser - 3 squares\nSubmarine - 3 squares\nDestroyer - 2 squares\nEach ship occupies contiguous squares on the grid, arranged either horizontally or vertically.\n\nSetup:\n\nAt the start of the game, each player places their fleet on their grid. This setup is hidden from the opponent.\nThe game begins with Player 1, followed by Player 2, and so on.\nTaking Turns:\n\nOn a player's turn, they announce a grid square (e.g., \"D5\").\nThe opponent announces whether that square is a \"hit\" (if there's a part of a ship on that square) or \"miss\" (if the square is empty).\nIf a player hits a square occupied by a ship, they get another turn to guess. This continues until they make a miss, at which point their turn ends.\nIf a player hits all the squares occupied by a ship, the opponent must announce the sinking of that specific ship, e.g., \"You sank my Battleship!\"\n\nObjective: The goal is to sink all of your opponent's ships before they sink yours.\n\nEnd of the Game: The game ends when one player has sunk all of the opponent's ships. The winner is the player who sinks all the opposing fleet first.\n\nTechnical details:\nIn your root folder you will find an abstract class that defines the public interface of the Battleship class you will have to build:\n```\nfrom abc import ABC, abstractmethod\nfrom typing import Optional\n\nfrom pydantic import BaseModel, validator\n\n\n# Models for the request and response payloads\nclass ShipPlacement(BaseModel):\n ship_type: str\n start: dict # {\"row\": int, \"column\": str}\n direction: str\n\n @validator(\"start\")\n def validate_start(cls, start):\n row, column = start.get(\"row\"), start.get(\"column\")\n\n if not (1 <= row <= 10):\n raise ValueError(\"Row must be between 1 and 10 inclusive.\")\n\n if column not in list(\"ABCDEFGHIJ\"):\n raise ValueError(\"Column must be one of A, B, C, D, E, F, G, H, I, J.\")\n\n return start\n\n\nclass Turn(BaseModel):\n target: dict # {\"row\": int, \"column\": str}\n\n\nclass TurnResponse(BaseModel):\n result: str\n ship_type: Optional[str] # This would be None if the result is a miss\n\n\nclass GameStatus(BaseModel):\n is_game_over: bool\n winner: Optional[str]\n\n\nfrom typing import List\n\n\nclass Game(BaseModel):\n game_id: str\n players: List[str]\n board: dict # This could represent the state of the game board, you might need to flesh this out further\n ships: List[ShipPlacement] # List of ship placements for this game\n turns: List[Turn] # List of turns that have been taken\n\n\nclass AbstractBattleship(ABC):\n SHIP_LENGTHS = {\n \"carrier\": 5,\n \"battleship\": 4,\n \"cruiser\": 3,\n \"submarine\": 3,\n \"destroyer\": 2,\n }\n\n @abstractmethod\n def create_ship_placement(self, game_id: str, placement: ShipPlacement) -> None:\n \"\"\"\n Place a ship on the grid.\n \"\"\"\n pass\n\n @abstractmethod\n def create_turn(self, game_id: str, turn: Turn) -> TurnResponse:\n \"\"\"\n Players take turns to target a grid cell.\n \"\"\"\n pass\n\n @abstractmethod\n def get_game_status(self, game_id: str) -> GameStatus:\n \"\"\"\n Check if the game is over and get the winner if there's one.\n \"\"\"\n pass\n\n @abstractmethod\n def get_winner(self, game_id: str) -> str:\n \"\"\"\n Get the winner of the game.\n \"\"\"\n pass\n\n @abstractmethod\n def get_game(self) -> Game:\n \"\"\"\n Retrieve the state of the game.\n \"\"\"\n pass\n\n @abstractmethod\n def delete_game(self, game_id: str) -> None:\n \"\"\"\n Delete a game given its ID.\n \"\"\"\n pass\n\n @abstractmethod\n def create_game(self, game_id: str) -> None:\n \"\"\"\n Create a new game.\n \"\"\"\n pass\n\n```\nAt any moment you can run ```pytest``` to execute the tests.\nYou have two types of test: \n- positive tests => test the battleship game being used in ideal conditions\n- negative tests => tests the battleship game behaviour when used incorrectly\n\nSuccess criteria:\n- you will need to write a file called battleship.py that implements the abstract Battleship class.\n- this class will have to pass all the tests.\n- you're not allowed to modify any other file than the battleship.py. You can add other files as long as the main entrypoint is the battleship class."+ },+ "id": "agbenchmark/generate_test.py::TestBattleship::test_method[challenge_data0]",+ "label": "Battleship",+ "shape": "dot"+ },+ {+ "color": "grey",+ "data": {+ "category": [+ "coding"+ ],+ "cutoff": 150,+ "dependencies": [+ "TestFileOrganizer"+ ],+ "eval_id": "41ca1035-ceca-4e0c-91ab-66ed0b350273",+ "ground": {+ "answer": "The correct python file for a basic url shortener CLI",+ "eval": {+ "type": "python"+ },+ "files": [+ "test.py"+ ],+ "should_contain": [],+ "should_not_contain": []+ },+ "info": {+ "description": "s ability for the agent to create a URL shortener.",+ "difficulty": "basic",+ "side_effects": []+ },+ "name": "TestUrlShortener",+ "task": "Build a basic URL shortener using a python CLI. Here are the specifications.\n\nFunctionality: The program should have two primary functionalities.\n\nShorten a given URL.\nRetrieve the original URL from a shortened URL.\n\nCLI: The command-line interface should accept a URL as its first input. It should be able to determine if the url is a shortened url or not. If the url is not shortened, it will display ONLY the shortened url, otherwise, it will display ONLY the original unshortened URL. Afterwards, it should prompt the user for another URL to process.\n\nTechnical specifications:\nBuild a file called url_shortener.py. This file will be called through command lines.\n\nEdge cases:\nFor the sake of simplicity, there will be no edge cases, you can assume the input is always correct and the user immediately passes the shortened version of the url he just shortened.\n\nYou will be expected to create a python file called url_shortener.py that will run through command lines by using python url_shortener.py.\n\nThe url_shortener.py will be tested this way:\n```\nimport unittest\nfrom url_shortener import shorten_url, retrieve_url\n\nclass TestURLShortener(unittest.TestCase):\n def test_url_retrieval(self):\n # Shorten the URL to get its shortened form\n shortened_url = shorten_url('https://www.example.com')\n\n # Retrieve the original URL using the shortened URL directly\n retrieved_url = retrieve_url(shortened_url)\n\n self.assertEqual(retrieved_url, 'https://www.example.com', \"Retrieved URL does not match the original!\")\n\nif __name__ == \"__main__\":\n unittest.main()\n```"+ },+ "id": "agbenchmark/generate_test.py::TestUrlShortener::test_method[challenge_data0]",+ "label": "UrlShortener",+ "shape": "dot"+ }+ ]+}diff --git a/frontend/assets/data_tree_structure.json b/frontend/assets/data_tree_structure.jsonnew file mode 100644index 0000000000..1f1a2ad139--- /dev/null+++ b/frontend/assets/data_tree_structure.json@@ -0,0 +1,4 @@+{+ "edges": [],+ "nodes": []+}diff --git a/frontend/assets/general_tree_structure.json b/frontend/assets/general_tree_structure.jsonnew file mode 100644index 0000000000..1f1a2ad139--- /dev/null+++ b/frontend/assets/general_tree_structure.json@@ -0,0 +1,4 @@+{+ "edges": [],+ "nodes": []+}diff --git a/frontend/assets/scrape_synthesize_tree_structure.json b/frontend/assets/scrape_synthesize_tree_structure.jsonnew file mode 100644index 0000000000..1f1a2ad139--- /dev/null+++ b/frontend/assets/scrape_synthesize_tree_structure.json@@ -0,0 +1,4 @@+{+ "edges": [],+ "nodes": []+}diff --git a/frontend/assets/tree_structure.json b/frontend/assets/tree_structure.jsonindex 91caef96d5..981d2bf739 100644--- a/frontend/assets/tree_structure.json+++ b/frontend/assets/tree_structure.json@@ -21,8 +21,8 @@{"arrows": "to","from": "agbenchmark/generate_test.py::TestWriteFile::test_method[challenge_data0]",- "id": "agbenchmark/generate_test.py::TestWriteFile::test_method[challenge_data0]_to_agbenchmark/generate_test.py::TestPasswordGenerator_Easy::test_method[challenge_data0]",- "to": "agbenchmark/generate_test.py::TestPasswordGenerator_Easy::test_method[challenge_data0]"+ "id": "agbenchmark/generate_test.py::TestWriteFile::test_method[challenge_data0]_to_agbenchmark/generate_test.py::TestThreeSum::test_method[challenge_data0]",+ "to": "agbenchmark/generate_test.py::TestThreeSum::test_method[challenge_data0]"},{"arrows": "to",@@ -38,9 +38,33 @@},{"arrows": "to",- "from": "agbenchmark/generate_test.py::TestPasswordGenerator_Easy::test_method[challenge_data0]",- "id": "agbenchmark/generate_test.py::TestPasswordGenerator_Easy::test_method[challenge_data0]_to_agbenchmark/generate_test.py::TestWritingCLI_FileOrganizer::test_method[challenge_data0]",- "to": "agbenchmark/generate_test.py::TestWritingCLI_FileOrganizer::test_method[challenge_data0]"+ "from": "agbenchmark/generate_test.py::TestPasswordGenerator::test_method[challenge_data0]",+ "id": "agbenchmark/generate_test.py::TestPasswordGenerator::test_method[challenge_data0]_to_agbenchmark/generate_test.py::TestFileOrganizer::test_method[challenge_data0]",+ "to": "agbenchmark/generate_test.py::TestFileOrganizer::test_method[challenge_data0]"+ },+ {+ "arrows": "to",+ "from": "agbenchmark/generate_test.py::TestFileOrganizer::test_method[challenge_data0]",+ "id": "agbenchmark/generate_test.py::TestFileOrganizer::test_method[challenge_data0]_to_agbenchmark/generate_test.py::TestUrlShortener::test_method[challenge_data0]",+ "to": "agbenchmark/generate_test.py::TestUrlShortener::test_method[challenge_data0]"+ },+ {+ "arrows": "to",+ "from": "agbenchmark/generate_test.py::TestThreeSum::test_method[challenge_data0]",+ "id": "agbenchmark/generate_test.py::TestThreeSum::test_method[challenge_data0]_to_agbenchmark/generate_test.py::TestPasswordGenerator::test_method[challenge_data0]",+ "to": "agbenchmark/generate_test.py::TestPasswordGenerator::test_method[challenge_data0]"+ },+ {+ "arrows": "to",+ "from": "agbenchmark/generate_test.py::TestUrlShortener::test_method[challenge_data0]",+ "id": "agbenchmark/generate_test.py::TestUrlShortener::test_method[challenge_data0]_to_agbenchmark/generate_test.py::TestTicTacToe::test_method[challenge_data0]",+ "to": "agbenchmark/generate_test.py::TestTicTacToe::test_method[challenge_data0]"+ },+ {+ "arrows": "to",+ "from": "agbenchmark/generate_test.py::TestUrlShortener::test_method[challenge_data0]",+ "id": "agbenchmark/generate_test.py::TestUrlShortener::test_method[challenge_data0]_to_agbenchmark/generate_test.py::TestBattleship::test_method[challenge_data0]",+ "to": "agbenchmark/generate_test.py::TestBattleship::test_method[challenge_data0]"},{"arrows": "to",@@ -283,6 +307,40 @@"label": "BasicRetrieval","shape": "dot"},+ {+ "color": "grey",+ "data": {+ "category": [+ "coding"+ ],+ "cutoff": 150,+ "dependencies": [+ "TestUrlShortener"+ ],+ "eval_id": "54c3d7e9-71d6-476b-b045-cf0aaf118f95",+ "ground": {+ "answer": "The correct python file for a TicTacToe game is written",+ "eval": {+ "type": "python"+ },+ "files": [+ "test.py"+ ],+ "should_contain": [],+ "should_not_contain": []+ },+ "info": {+ "description": "s ability for the agent to create Tic-Tac-Toe game",+ "difficulty": "basic",+ "side_effects": []+ },+ "name": "TestTicTacToe",+ "task": "Build a Tic-Tac-Toe game using a python CLI. Here are the specifications.\n\nThe Grid: The game board is a 3x3 grid, consisting of 3 rows and 3 columns, creating a total of 9 squares.\n\nPlayers: There are two players. One player uses the number \"1\", and the other player uses the number \"2\".\n\nTaking Turns: Players take turns to put their respective numbers (\"1\" or \"2\") in an empty square of the grid. Once a player has placed their number in a square, it cannot be changed or removed.\n\nObjective: The goal is to get three of your numbers in a row, either horizontally, vertically, or diagonally.\n\nEnd of the Game: The game concludes in one of two ways: One player gets three of their numbers in a row (horizontally, vertically, or diagonally) and is declared the winner.\nAll squares on the grid are filled, and no player has three in a row. This situation is a \"draw\" or a \"tie\".\n\nTechnical specifications:\nBuild a file called tic_tac_toe.py. This file will be called through command lines. You will have to prompt users for their move. Player 1 will always start.\nPlayers will input their move in the following format: \"x,y\" where x and y represent the location in the grid (0,0 is top left, 2,2 is bottom right).\n\nYour primary requirement is to halt the game when appropriate and to print only one of these three exact sentences:\n\n\"Player 1 won!\"\n\"Player 2 won!\"\n\"Draw\"\n\nEdge cases: A player can send an incorrect location. Either the location is incorrect or the square is already filled. In this case, this counts as doing nothing, and the player gets prompted for new locations again.\n\n\nYou will be expected to create a python file called tic_tac_toe.py that will run through command lines by using ```python tic_tac_toe.py```.\n\nHere is an example of how your tic_tac_toe.py game will be tested.\n```\nprocess = subprocess.Popen(\n ['python', 'tic_tac_toe.py'],\n stdout=subprocess.PIPE,\n text=True\n)\n\noutput, _ = process.communicate('\\n'.join([\"0,0\", \"1,0\", \"0,1\", \"1,1\", \"0,2\"]))\n\nassert \"Player 1 won!\" in output\n```"+ },+ "id": "agbenchmark/generate_test.py::TestTicTacToe::test_method[challenge_data0]",+ "label": "TicTacToe",+ "shape": "dot"+ },{"color": "grey","data": {@@ -291,7 +349,7 @@],"cutoff": 90,"dependencies": [- "TestWriteFile"+ "TestThreeSum"],"eval_id": "0823b577-64f2-477b-856d-16726fe464b0","ground": {@@ -310,11 +368,11 @@"difficulty": "basic","side_effects": []},- "name": "TestPasswordGenerator_Easy",+ "name": "TestPasswordGenerator","task": "Create a random password generator. The password should have between 8 and 16 characters and should contain letters, numbers and symbols. The password should be printed to the console. The entry point will be a python file that can be run this way: python password_generator.py [--len x] where x is the length of the password. If no length is specified, the password should be 8 characters long. The password_generator can also be imported as a module and called as password = password_generator.generate_password(len=x). Any invalid input should raise a ValueError."},- "id": "agbenchmark/generate_test.py::TestPasswordGenerator_Easy::test_method[challenge_data0]",- "label": "PasswordGenerator_Easy",+ "id": "agbenchmark/generate_test.py::TestPasswordGenerator::test_method[challenge_data0]",+ "label": "PasswordGenerator","shape": "dot"},{@@ -325,7 +383,7 @@],"cutoff": 90,"dependencies": [- "TestPasswordGenerator_Easy"+ "TestPasswordGenerator"],"eval_id": "6ace62be-6c18-431a-947f-72fb20984b58","ground": {@@ -344,11 +402,11 @@"difficulty": "basic","side_effects": []},- "name": "TestWritingCLI_FileOrganizer",+ "name": "TestFileOrganizer","task": "Create a file organizer CLI tool in Python that sorts files in a directory based on their file types (e.g., images, documents, audio) and moves them into these corresponding folders: 'images', 'documents', 'audio'. The entry point will be a python file that can be run this way: python organize_files.py --directory_path=YOUR_DIRECTORY_PATH"},- "id": "agbenchmark/generate_test.py::TestWritingCLI_FileOrganizer::test_method[challenge_data0]",- "label": "WritingCLI_FileOrganizer",+ "id": "agbenchmark/generate_test.py::TestFileOrganizer::test_method[challenge_data0]",+ "label": "FileOrganizer","shape": "dot"},{@@ -360,7 +418,7 @@],"cutoff": 60,"dependencies": [- "TestFunctionCodeGeneration"+ "TestWriteFile"],"eval_id": "29a10990-2584-4602-8b9d-c217f6edbc4f","ground": {@@ -390,6 +448,38 @@"label": "ThreeSum","shape": "dot"},+ {+ "color": "grey",+ "data": {+ "category": [+ "coding"+ ],+ "cutoff": 90,+ "dependencies": [+ "TestUrlShortener"+ ],+ "eval_id": "5a32418d-1c3a-4af1-8dc4-8d4c29bed21a",+ "ground": {+ "answer": "The implementation of battleship that passes all the tests.",+ "eval": {+ "type": "pytest"+ },+ "files": [],+ "should_contain": [],+ "should_not_contain": []+ },+ "info": {+ "description": "s ability for the agent to create a Battleship.",+ "difficulty": "expert",+ "side_effects": []+ },+ "name": "TestBattleship",+ "task": "Build a battleship game\n\nSpecifications:\n\nOverview: Battleship is a two-player strategy game where each player places their fleet of ships on a grid and tries to sink the opponent's fleet by guessing their locations.\nPlayers take turns calling out a row and column, attempting to name a square containing one of the opponent's ships.\n\nThe Grid: Each player's grid is a 10x10 grid, identified by rows (using numbers 1-10) and columns (using letters A-J).\n\nShips:\n\nCarrier - 5 squares\nBattleship - 4 squares\nCruiser - 3 squares\nSubmarine - 3 squares\nDestroyer - 2 squares\nEach ship occupies contiguous squares on the grid, arranged either horizontally or vertically.\n\nSetup:\n\nAt the start of the game, each player places their fleet on their grid. This setup is hidden from the opponent.\nThe game begins with Player 1, followed by Player 2, and so on.\nTaking Turns:\n\nOn a player's turn, they announce a grid square (e.g., \"D5\").\nThe opponent announces whether that square is a \"hit\" (if there's a part of a ship on that square) or \"miss\" (if the square is empty).\nIf a player hits a square occupied by a ship, they get another turn to guess. This continues until they make a miss, at which point their turn ends.\nIf a player hits all the squares occupied by a ship, the opponent must announce the sinking of that specific ship, e.g., \"You sank my Battleship!\"\n\nObjective: The goal is to sink all of your opponent's ships before they sink yours.\n\nEnd of the Game: The game ends when one player has sunk all of the opponent's ships. The winner is the player who sinks all the opposing fleet first.\n\nTechnical details:\nIn your root folder you will find an abstract class that defines the public interface of the Battleship class you will have to build:\n```\nfrom abc import ABC, abstractmethod\nfrom typing import Optional\n\nfrom pydantic import BaseModel, validator\n\n\n# Models for the request and response payloads\nclass ShipPlacement(BaseModel):\n ship_type: str\n start: dict # {\"row\": int, \"column\": str}\n direction: str\n\n @validator(\"start\")\n def validate_start(cls, start):\n row, column = start.get(\"row\"), start.get(\"column\")\n\n if not (1 <= row <= 10):\n raise ValueError(\"Row must be between 1 and 10 inclusive.\")\n\n if column not in list(\"ABCDEFGHIJ\"):\n raise ValueError(\"Column must be one of A, B, C, D, E, F, G, H, I, J.\")\n\n return start\n\n\nclass Turn(BaseModel):\n target: dict # {\"row\": int, \"column\": str}\n\n\nclass TurnResponse(BaseModel):\n result: str\n ship_type: Optional[str] # This would be None if the result is a miss\n\n\nclass GameStatus(BaseModel):\n is_game_over: bool\n winner: Optional[str]\n\n\nfrom typing import List\n\n\nclass Game(BaseModel):\n game_id: str\n players: List[str]\n board: dict # This could represent the state of the game board, you might need to flesh this out further\n ships: List[ShipPlacement] # List of ship placements for this game\n turns: List[Turn] # List of turns that have been taken\n\n\nclass AbstractBattleship(ABC):\n SHIP_LENGTHS = {\n \"carrier\": 5,\n \"battleship\": 4,\n \"cruiser\": 3,\n \"submarine\": 3,\n \"destroyer\": 2,\n }\n\n @abstractmethod\n def create_ship_placement(self, game_id: str, placement: ShipPlacement) -> None:\n \"\"\"\n Place a ship on the grid.\n \"\"\"\n pass\n\n @abstractmethod\n def create_turn(self, game_id: str, turn: Turn) -> TurnResponse:\n \"\"\"\n Players take turns to target a grid cell.\n \"\"\"\n pass\n\n @abstractmethod\n def get_game_status(self, game_id: str) -> GameStatus:\n \"\"\"\n Check if the game is over and get the winner if there's one.\n \"\"\"\n pass\n\n @abstractmethod\n def get_winner(self, game_id: str) -> str:\n \"\"\"\n Get the winner of the game.\n \"\"\"\n pass\n\n @abstractmethod\n def get_game(self) -> Game:\n \"\"\"\n Retrieve the state of the game.\n \"\"\"\n pass\n\n @abstractmethod\n def delete_game(self, game_id: str) -> None:\n \"\"\"\n Delete a game given its ID.\n \"\"\"\n pass\n\n @abstractmethod\n def create_game(self, game_id: str) -> None:\n \"\"\"\n Create a new game.\n \"\"\"\n pass\n\n```\nAt any moment you can run ```pytest``` to execute the tests.\nYou have two types of test: \n- positive tests => test the battleship game being used in ideal conditions\n- negative tests => tests the battleship game behaviour when used incorrectly\n\nSuccess criteria:\n- you will need to write a file called battleship.py that implements the abstract Battleship class.\n- this class will have to pass all the tests.\n- you're not allowed to modify any other file than the battleship.py. You can add other files as long as the main entrypoint is the battleship class."+ },+ "id": "agbenchmark/generate_test.py::TestBattleship::test_method[challenge_data0]",+ "label": "Battleship",+ "shape": "dot"+ },{"color": "grey","data": {@@ -397,7 +487,9 @@"coding"],"cutoff": 150,- "dependencies": [],+ "dependencies": [+ "TestFileOrganizer"+ ],"eval_id": "41ca1035-ceca-4e0c-91ab-66ed0b350273","ground": {"answer": "The correct python file for a basic url shortener CLI",