mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-22 16:34:25 +01:00
linting
This commit is contained in:
@@ -4,16 +4,16 @@ from __future__ import annotations
|
||||
|
||||
import contextlib
|
||||
import json
|
||||
from typing import Dict, Any
|
||||
from typing import Any, Dict
|
||||
|
||||
from colorama import Fore
|
||||
from regex import regex
|
||||
|
||||
from autogpt.config import Config
|
||||
from autogpt.json_utils.json_fix_general import correct_json
|
||||
from autogpt.llm_utils import call_ai_function
|
||||
from autogpt.logs import logger
|
||||
from autogpt.speech import say_text
|
||||
from autogpt.config import Config
|
||||
|
||||
JSON_SCHEMA = """
|
||||
{
|
||||
@@ -102,7 +102,10 @@ def fix_json_using_multiple_techniques(assistant_reply: str) -> Dict[Any, Any]:
|
||||
if assistant_reply_json != {}:
|
||||
return assistant_reply_json
|
||||
|
||||
logger.error("Error: The following AI output couldn't be converted to a JSON:\n", assistant_reply)
|
||||
logger.error(
|
||||
"Error: The following AI output couldn't be converted to a JSON:\n",
|
||||
assistant_reply,
|
||||
)
|
||||
if CFG.speak_mode:
|
||||
say_text("I have received an invalid JSON response from the OpenAI API.")
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ import re
|
||||
|
||||
from jsonschema import Draft7Validator
|
||||
|
||||
from autogpt.logs import logger
|
||||
from autogpt.config import Config
|
||||
from autogpt.logs import logger
|
||||
|
||||
CFG = Config()
|
||||
|
||||
|
||||
@@ -204,7 +204,10 @@ logger = Logger()
|
||||
|
||||
def print_assistant_thoughts(ai_name, assistant_reply):
|
||||
"""Prints the assistant's thoughts to the console"""
|
||||
from autogpt.json_utils.json_fix_llm import fix_and_parse_json, attempt_to_fix_json_by_finding_outermost_brackets
|
||||
from autogpt.json_utils.json_fix_llm import (
|
||||
attempt_to_fix_json_by_finding_outermost_brackets,
|
||||
fix_and_parse_json,
|
||||
)
|
||||
|
||||
try:
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user