chore: Änderungen commited

This commit is contained in:
2025-05-02 19:44:34 +02:00
parent e2c8cfaacf
commit 808481ffe7
3 changed files with 184 additions and 1 deletions

5
app.py
View File

@@ -1544,8 +1544,11 @@ def chat_with_assistant():
})
try:
# OpenAI-Client mit dem API-Key initialisieren
client = OpenAI(api_key=api_key)
# Überprüfen ob OpenAI API-Key konfiguriert ist
if not client.api_key or client.api_key.startswith("sk-dummy"):
if not api_key or api_key.startswith("sk-dummy"):
print("Warnung: OpenAI API-Key ist nicht oder nur als Dummy konfiguriert!")
return jsonify({
'error': 'Der OpenAI API-Key ist nicht korrekt konfiguriert. Bitte konfigurieren Sie die Umgebungsvariable OPENAI_API_KEY.'