* Pi's message.

* Fix most everything.

* Blacked

* Add Typing, Docstrings everywhere, organize the code a bit.

* Black

* fix import

* Update message, dedupe.

* Increase backoff time.

* bump up retries
This commit is contained in:
BillSchumacher
2023-04-15 07:56:23 -05:00
committed by GitHub
parent e986af5de0
commit 1073954fb7
64 changed files with 2254 additions and 1883 deletions

View File

@@ -0,0 +1,25 @@
"""Code evaluation module."""
from typing import List
from autogpt.llm_utils import call_ai_function
def evaluate_code(code: str) -> List[str]:
"""
A function that takes in a string and returns a response from create chat
completion api call.
Parameters:
code (str): Code to be evaluated.
Returns:
A result string from create chat completion. A list of suggestions to
improve the code.
"""
function_string = "def analyze_code(code: str) -> List[str]:"
args = [code]
description_string = (
"Analyzes the given code and returns a list of suggestions" " for improvements."
)
return call_ai_function(function_string, args, description_string)