Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

Added new logging function as an error or warning message

Eesa Hamza8c51fe8373aa
diff --git a/scripts/logger.py b/scripts/logger.py
index a609e60275..efc2adba32 100644
--- a/scripts/logger.py
+++ b/scripts/logger.py
@@ -123,7 +123,12 @@ class Logger(metaclass=Singleton):
def set_level(self, level):
self.logger.setLevel(level)
self.typing_logger.setLevel(level)
+
+ def double_check(self, additionalText=None):
+ if not additionalText:
+ additionalText = "Please ensure you've setup and configured everything correctly. Read https://github.com/Torantulino/Auto-GPT#readme to double check. You can also create a github issue or join the discord and ask there!"
+ self.typewriter_log("DOUBLE CHECK CONFIGURATION", Fore.YELLOW, additionalText)
'''
Output stream to console using simulated typing
diff --git a/scripts/memory/pinecone.py b/scripts/memory/pinecone.py
index eeafd9c9b0..9d033f5ac1 100644
--- a/scripts/memory/pinecone.py
+++ b/scripts/memory/pinecone.py
@@ -23,10 +23,8 @@ class PineconeMemory(MemoryProviderSingleton):
pinecone.whoami()
except Exception as e:
logger.typewriter_log("FAILED TO CONNECT TO PINECONE", Fore.RED, Style.BRIGHT + str(e) + Style.RESET_ALL)
- logger.typewriter_log("DOUBLE CHECK CONFIGURATION",
- Fore.YELLOW,
- "Please ensure you have setup and configured Pinecone properly for use. " +
- f"You can check out {Fore.CYAN + Style.BRIGHT}https://github.com/Torantulino/Auto-GPT#-pinecone-api-key-setup{Style.RESET_ALL} to ensure you've set up everything correctly.")
+ logger.double_check("Please ensure you have setup and configured Pinecone properly for use. " +
+ f"You can check out {Fore.CYAN + Style.BRIGHT}https://github.com/Torantulino/Auto-GPT#-pinecone-api-key-setup{Style.RESET_ALL} to ensure you've set up everything correctly.")
exit(1)
if table_name not in pinecone.list_indexes():
diff --git a/scripts/memory/redismem.py b/scripts/memory/redismem.py
index b2d5326f8a..6647cbca61 100644
--- a/scripts/memory/redismem.py
+++ b/scripts/memory/redismem.py
@@ -52,10 +52,8 @@ class RedisMemory(MemoryProviderSingleton):
self.redis.ping()
except redis.ConnectionError as e:
logger.typewriter_log("FAILED TO CONNECT TO REDIS", Fore.RED, Style.BRIGHT + str(e) + Style.RESET_ALL)
- logger.typewriter_log("DOUBLE CHECK CONFIGURATION",
- Fore.YELLOW,
- "Please ensure you have setup and configured Redis properly for use. " +
- f"You can check out {Fore.CYAN + Style.BRIGHT}https://github.com/Torantulino/Auto-GPT#redis-setup{Style.RESET_ALL} to ensure you've set up everything correctly.")
+ logger.double_check("Please ensure you have setup and configured Redis properly for use. " +
+ f"You can check out {Fore.CYAN + Style.BRIGHT}https://github.com/Torantulino/Auto-GPT#redis-setup{Style.RESET_ALL} to ensure you've set up everything correctly.")
exit(1)
if cfg.wipe_redis_on_start: