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.

Fixed formatting issues

meta-fx3ee62211db30
diff --git a/scripts/config.py b/scripts/config.py
index 3bf5cd9a81..f636da7dfd 100644
--- a/scripts/config.py
+++ b/scripts/config.py
@@ -72,13 +72,11 @@ class Config(metaclass=Singleton):
# User agent headers to use when browsing web
# Some websites might just completely deny request with an error code if no user agent was found.
- self.user_agent_header = {
- "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36"}
+ self.user_agent_header = {"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36"}
self.redis_host = os.getenv("REDIS_HOST", "localhost")
self.redis_port = os.getenv("REDIS_PORT", "6379")
self.redis_password = os.getenv("REDIS_PASSWORD", "")
- self.wipe_redis_on_start = os.getenv(
- "WIPE_REDIS_ON_START", "True") == 'True'
+ self.wipe_redis_on_start = os.getenv("WIPE_REDIS_ON_START", "True") == 'True'
self.memory_index = os.getenv("MEMORY_INDEX", 'auto-gpt')
# Note that indexes must be created on db 0 in redis, this is not configureable.
@@ -139,4 +137,4 @@ class Config(metaclass=Singleton):
def set_debug_mode(self, value: bool):
"""Set the debug mode value."""
- self.debug = value
+ self.debug = value
\ No newline at end of file
diff --git a/scripts/speak.py b/scripts/speak.py
index ebaae8d182..2464c62596 100644
--- a/scripts/speak.py
+++ b/scripts/speak.py
@@ -1,9 +1,9 @@
-import gtts
import os
from playsound import playsound
import requests
from config import Config
cfg = Config()
+import gtts
# TODO: Nicer names for these ids
@@ -14,7 +14,6 @@ tts_headers = {
"xi-api-key": cfg.elevenlabs_api_key
}
-
def eleven_labs_speech(text, voice_index=0):
"""Speak text using elevenlabs.io's API"""
tts_url = "https://api.elevenlabs.io/v1/text-to-speech/{voice_id}".format(
@@ -34,7 +33,6 @@ def eleven_labs_speech(text, voice_index=0):
print("Response content:", response.content)
return False
-
def brian_speech(text):
"""Speak text using Brian with the streamelements API"""
tts_url = f"https://api.streamelements.com/kappa/v2/speech?voice=Brian&text={text}"
@@ -51,18 +49,15 @@ def brian_speech(text):
print("Response content:", response.content)
return False
-
def gtts_speech(text):
tts = gtts.gTTS(text)
tts.save("speech.mp3")
playsound("speech.mp3")
os.remove("speech.mp3")
-
def macos_tts_speech(text):
os.system(f'say "{text}"')
-
def say_text(text, voice_index=0):
if not cfg.elevenlabs_api_key:
if cfg.use_mac_os_tts == 'True':
@@ -76,4 +71,4 @@ def say_text(text, voice_index=0):
else:
success = eleven_labs_speech(text, voice_index)
if not success:
- gtts_speech(text)
+ gtts_speech(text)
\ No newline at end of file