Auto-update: Thu Aug 8 21:25:24 PDT 2024

This commit is contained in:
sanj 2024-08-08 21:25:24 -07:00
parent f5fab9b186
commit 69a657910d
2 changed files with 22 additions and 34 deletions

View file

@ -19,10 +19,14 @@ os.makedirs(LOGS_DIR, exist_ok=True)
L = Logger("Central", LOGS_DIR) L = Logger("Central", LOGS_DIR)
# API essentials # API essentials
print("Loading API configuration...")
API = APIConfig.load('api', 'secrets') API = APIConfig.load('api', 'secrets')
Dir = DirConfig.load('dirs') Dir = DirConfig.load('dirs')
print(f"Data: {Dir.DATA}")
print(f"Config: {Dir.CONFIG}")
print(f"Logs: {Dir.LOGS}")
print(f"Podcast: {Dir.PODCAST}")
HOST = f"{API.BIND}:{API.PORT}" HOST = f"{API.BIND}:{API.PORT}"
LOCAL_HOSTS = [ipaddress.ip_address(localhost.strip()) for localhost in os.getenv('LOCAL_HOSTS', '127.0.0.1').split(',')] + ['localhost'] LOCAL_HOSTS = [ipaddress.ip_address(localhost.strip()) for localhost in os.getenv('LOCAL_HOSTS', '127.0.0.1').split(',')] + ['localhost']
SUBNET_BROADCAST = os.getenv("SUBNET_BROADCAST", '10.255.255.255') SUBNET_BROADCAST = os.getenv("SUBNET_BROADCAST", '10.255.255.255')
@ -36,38 +40,22 @@ Scrape = Configuration.load('scrape', 'secrets', Dir)
Serve = Configuration.load('serve', 'secrets', Dir) Serve = Configuration.load('serve', 'secrets', Dir)
Tts = Configuration.load('tts', 'secrets', Dir) Tts = Configuration.load('tts', 'secrets', Dir)
print(f"Tts configuration loaded: {Tts}") # print(f"Tts configuration loaded: {Tts}")
print(f"Tts.elevenlabs: {Tts.elevenlabs}") # print(f"Tts.elevenlabs: {Tts.elevenlabs}")
print(f"Tts.elevenlabs.key: {Tts.elevenlabs.key}") # print(f"Tts.elevenlabs.key: {Tts.elevenlabs.key}")
print(f"Tts.elevenlabs.voices: {Tts.elevenlabs.voices}") # print(f"Tts.elevenlabs.voices: {Tts.elevenlabs.voices}")
# print(f"Configuration.resolve_placeholders method: {Configuration.resolve_placeholders}")
# Additional debug logging for Configuration class # print(f"Configuration.resolve_string_placeholders method: {Configuration.resolve_string_placeholders}")
print(f"Configuration.resolve_placeholders method: {Configuration.resolve_placeholders}") # print(f"Secrets in Tts config: {[attr for attr in dir(Tts) if attr.isupper()]}")
print(f"Configuration.resolve_string_placeholders method: {Configuration.resolve_string_placeholders}") # print(f"Type of Tts.elevenlabs: {type(Tts.elevenlabs)}")
# print(f"Attributes of Tts.elevenlabs: {dir(Tts.elevenlabs)}")
# Check if secrets are properly loaded # print(f"ElevenLabs API key (masked): {'*' * len(Tts.elevenlabs.key) if hasattr(Tts.elevenlabs, 'key') else 'Not found'}")
print(f"Secrets in Tts config: {[attr for attr in dir(Tts) if attr.isupper()]}") # print(f"Type of Tts.elevenlabs.voices: {type(Tts.elevenlabs.voices)}")
# print(f"Attributes of Tts.elevenlabs.voices: {dir(Tts.elevenlabs.voices)}")
# Verify the structure of Tts.elevenlabs # print(f"Default voice: {Tts.elevenlabs.default if hasattr(Tts.elevenlabs, 'default') else 'Not found'}")
print(f"Type of Tts.elevenlabs: {type(Tts.elevenlabs)}") # print(f"Is 'get' method available on Tts.elevenlabs.voices? {'get' in dir(Tts.elevenlabs.voices)}")
print(f"Attributes of Tts.elevenlabs: {dir(Tts.elevenlabs)}") # print(f"Is 'values' method available on Tts.elevenlabs.voices? {'values' in dir(Tts.elevenlabs.voices)}")
# print("Initialization complete")
# Check if the ElevenLabs API key is properly resolved
print(f"ElevenLabs API key (masked): {'*' * len(Tts.elevenlabs.key) if hasattr(Tts.elevenlabs, 'key') else 'Not found'}")
# Verify the structure of Tts.elevenlabs.voices
print(f"Type of Tts.elevenlabs.voices: {type(Tts.elevenlabs.voices)}")
print(f"Attributes of Tts.elevenlabs.voices: {dir(Tts.elevenlabs.voices)}")
# Check if the default voice is set
print(f"Default voice: {Tts.elevenlabs.default if hasattr(Tts.elevenlabs, 'default') else 'Not found'}")
# Additional checks
print(f"Is 'get' method available on Tts.elevenlabs.voices? {'get' in dir(Tts.elevenlabs.voices)}")
print(f"Is 'values' method available on Tts.elevenlabs.voices? {'values' in dir(Tts.elevenlabs.voices)}")
print("Initialization complete")
# Directories & general paths # Directories & general paths
ROUTER_DIR = BASE_DIR / "routers" ROUTER_DIR = BASE_DIR / "routers"

View file

@ -244,7 +244,7 @@ async def generate_speech(
warn(f"No file exists at {audio_file_path}") warn(f"No file exists at {audio_file_path}")
if podcast: if podcast:
podcast_path = Path(Dir.PODCAST) / Path(audio_file_path).name podcast_path = Dir.PODCAST / audio_file_path
shutil.copy(audio_file_path, podcast_path) shutil.copy(audio_file_path, podcast_path)
if podcast_path.exists(): if podcast_path.exists():