/
githubmirror
/
Multi-GPT
Обзор
Документация
Войти
/
githubmirror
/
Multi-GPT
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
autogpt/utils.py
26 строк
738 B
BillSchumacher
Fix everything (#1444)
15 апр 2023, 03:04
Не верифицирован
15 апр 2023, 03:04
4bb7a59
Код
Авторство
О чём код?
import yaml from colorama import Fore def clean_input(prompt: str = ""): try: return input(prompt) except KeyboardInterrupt: print("You interrupted Auto-GPT") print("Quitting...") exit(0) def validate_yaml_file(file: str): try: with open(file, encoding="utf-8") as fp: yaml.load(fp.read(), Loader=yaml.FullLoader) except FileNotFoundError: return (False, f"The file {Fore.CYAN}`{file}`{Fore.RESET} wasn't found") except yaml.YAMLError as e: return ( False, f"There was an issue while trying to read with your AI Settings file: {e}", ) return (True, f"Successfully validated {Fore.CYAN}`{file}`{Fore.RESET}!")