mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2026-01-06 07:44:35 +01:00
dynamically load commands from registry
This commit is contained in:
@@ -3,10 +3,12 @@ import json
|
||||
from config import Config
|
||||
from call_ai_function import call_ai_function
|
||||
from json_parser import fix_and_parse_json
|
||||
from auto_gpt.commands import command
|
||||
|
||||
cfg = Config()
|
||||
|
||||
# Evaluating code
|
||||
|
||||
@command("evaluate_code", "Evaluate Code", '"code": "<full _code_string>"')
|
||||
def evaluate_code(code: str) -> List[str]:
|
||||
function_string = "def analyze_code(code: str) -> List[str]:"
|
||||
args = [code]
|
||||
@@ -18,7 +20,7 @@ def evaluate_code(code: str) -> List[str]:
|
||||
|
||||
|
||||
# Improving code
|
||||
|
||||
@command("improve_code", "Get Improved Code", '"suggestions": "<list_of_suggestions>", "code": "<full_code_string>"')
|
||||
def improve_code(suggestions: List[str], code: str) -> str:
|
||||
function_string = (
|
||||
"def generate_improved_code(suggestions: List[str], code: str) -> str:"
|
||||
@@ -32,7 +34,7 @@ def improve_code(suggestions: List[str], code: str) -> str:
|
||||
|
||||
# Writing tests
|
||||
|
||||
|
||||
@command("write_tests", "Write Tests", '"code": "<full_code_string>", "focus": "<list_of_focus_areas>"')
|
||||
def write_tests(code: str, focus: List[str]) -> str:
|
||||
function_string = (
|
||||
"def create_test_cases(code: str, focus: Optional[str] = None) -> str:"
|
||||
|
||||
Reference in New Issue
Block a user