autogpt 还原,开新分支编写

This commit is contained in:
w_xiaolizu
2023-05-30 16:38:01 +08:00
parent 548532e522
commit 519df19f43
65 changed files with 3352 additions and 1868 deletions

View File

@ -1,13 +1,9 @@
from __future__ import annotations
import json
from typing import TYPE_CHECKING
from autogpt.commands.command import command
from autogpt.llm.utils import call_ai_function
if TYPE_CHECKING:
from autogpt.config import Config
from autogpt.llm_utils import call_ai_function
@command(
@ -15,7 +11,7 @@ if TYPE_CHECKING:
"Get Improved Code",
'"suggestions": "<list_of_suggestions>", "code": "<full_code_string>"',
)
def improve_code(suggestions: list[str], code: str, config: Config) -> str:
def improve_code(suggestions: list[str], code: str) -> str:
"""
A function that takes in code and suggestions and returns a response from create
chat completion api call.
@ -36,4 +32,4 @@ def improve_code(suggestions: list[str], code: str, config: Config) -> str:
" provided, making no other changes."
)
return call_ai_function(function_string, args, description_string, config=config)
return call_ai_function(function_string, args, description_string)