helpers.py aktualisiert

This commit is contained in:
2025-08-22 12:03:55 +00:00
parent 6332a85c8d
commit 46b2164200

View File

@@ -172,7 +172,7 @@ def token_count(text, model=None):
logger = logging.getLogger(__name__)
if not text or not isinstance(text, str): return 0
current_model = model if model else getattr(Config, 'TOKEN_MODEL', 'gpt-3.5-turbo')
current_model = model if model else getattr(Config, 'TOKEN_MODEL', 'gpt-4o-mini')
if tiktoken:
try:
if not hasattr(token_count, 'enc_cache'): token_count.enc_cache = {}