first commit

This commit is contained in:
2025-12-04 11:58:36 +01:00
commit 21cdc65ade
38 changed files with 8176 additions and 0 deletions

22
utils/cache.py Normal file
View File

@ -0,0 +1,22 @@
"""
NovaAi – TTS-Engine-Hub
utils/cache.py
Version: v0.0.1
Description:
Caching utilities for TTS requests (cache key generation, etc).
Author: Abby (ChatGPT)
Date: 2025-07-23
Canvas: utils/cache.py
"""
import hashlib
# Für die API: Wichtig! req muss mindestens die Felder .text, .engine, .model, .speaker, .format, .chunking haben.
def build_cache_key(req) -> str:
"""
Build a cache key from all relevant TTS request parameters.
"""
data = f"{req.text}|{req.engine}|{req.model}|{req.speaker}|{req.format}|{getattr(req, 'chunking', False)}"
return hashlib.sha256(data.encode()).hexdigest()