Fixed SD Promt

This commit is contained in:
2026-06-02 15:03:39 +03:00
parent d4cd8f02f4
commit 03cbda5dce
46 changed files with 3285 additions and 429 deletions
+14 -2
View File
@@ -1,7 +1,7 @@
import json
import os
from services.llm import send_message_with_model, send_message
from services.llm import LLMError, send_message_with_model, send_message
import logging
logger = logging.getLogger(__name__)
@@ -63,7 +63,19 @@ async def generate_plot_arc(persona_name: str, persona_desc: str, persona_scenar
{"role": "system", "content": ARC_SYSTEM},
{"role": "user", "content": user},
]
raw = await (send_message_with_model(messages, PLOT_MODEL) if PLOT_MODEL else send_message(messages))
try:
raw = await (
send_message_with_model(messages, PLOT_MODEL)
if PLOT_MODEL
else send_message(messages)
)
except LLMError as e:
logger.warning("generate_plot_arc LLM failed (model=%s): %s", PLOT_MODEL or "SYSTEM", e)
return {}
except Exception as e:
logger.warning("generate_plot_arc unexpected error: %s", e)
return {}
cleaned = raw.strip()
# common OpenRouter formatting: fenced json
if cleaned.startswith("```"):