mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-22 00:14:23 +01:00
Fix everything (#1444)
* Pi's message. * Fix most everything. * Blacked
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
from autogpt.config import Config
|
||||
from autogpt.llm_utils import create_chat_completion
|
||||
|
||||
cfg = Config()
|
||||
|
||||
from autogpt.llm_utils import create_chat_completion
|
||||
|
||||
|
||||
# This is a magic function that can do anything with no-code. See
|
||||
# https://github.com/Torantulino/AI-Functions for more info.
|
||||
def call_ai_function(function, args, description, model=None):
|
||||
def call_ai_function(function, args, description, model=None) -> str:
|
||||
"""Call an AI function"""
|
||||
if model is None:
|
||||
model = cfg.smart_llm_model
|
||||
@@ -18,11 +17,10 @@ def call_ai_function(function, args, description, model=None):
|
||||
messages = [
|
||||
{
|
||||
"role": "system",
|
||||
"content": f"You are now the following python function: ```# {description}\n{function}```\n\nOnly respond with your `return` value.",
|
||||
"content": f"You are now the following python function: ```# {description}"
|
||||
f"\n{function}```\n\nOnly respond with your `return` value.",
|
||||
},
|
||||
{"role": "user", "content": args},
|
||||
]
|
||||
|
||||
response = create_chat_completion(model=model, messages=messages, temperature=0)
|
||||
|
||||
return response
|
||||
return create_chat_completion(model=model, messages=messages, temperature=0)
|
||||
|
||||
Reference in New Issue
Block a user