Refactor configuration handling and improve error management across services; normalize placeholder values for SMTP and Stripe configurations; enhance local storage fallback logic in StorageService; add tests for new behaviors and edge cases.

This commit is contained in:
Your Name
2026-03-26 14:15:10 +02:00
parent 688d411537
commit bc8a5dc290
19 changed files with 423 additions and 95 deletions

View File

@@ -3,7 +3,10 @@ import json
import logging
import requests
from app.services.openrouter_config_service import get_openrouter_settings
from app.services.openrouter_config_service import (
extract_openrouter_text,
get_openrouter_settings,
)
logger = logging.getLogger(__name__)
@@ -72,12 +75,7 @@ def chat_about_flowchart(message: str, flow_data: dict | None = None) -> dict:
response.raise_for_status()
data = response.json()
reply = (
data.get("choices", [{}])[0]
.get("message", {})
.get("content", "")
.strip()
)
reply = extract_openrouter_text(data)
if not reply:
reply = "I couldn't generate a response. Please try again."