autogpt 还原,开新分支编写
This commit is contained in:
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user