Fix: Implemented SVG fallback for image generation, enforced phase consolidation in report, and updated troubleshooting guide

This commit is contained in:
2026-01-03 13:22:42 +00:00
parent 69297d990b
commit 6bde387760

View File

@@ -1,3 +1,4 @@
import argparse
import base64
import json
@@ -20,7 +21,7 @@ LOG_DIR = "Log_from_docker"
if not os.path.exists(LOG_DIR):
os.makedirs(LOG_DIR)
ORCHESTRATOR_VERSION = "1.2.0" # Bump version for language fix
ORCHESTRATOR_VERSION = "1.3.0" # Bump version for image fix & language enforcement
run_timestamp = datetime.now().strftime("%y-%m-%d_%H-%M-%S")
log_file_path = os.path.join(LOG_DIR, f"{run_timestamp}_gtm_orchestrator_run.log")
@@ -63,7 +64,7 @@ def get_system_instruction(lang):
Führe eine interne Plausibilitätsprüfung durch, bevor du eine Antwort gibst.
Verwende "Wackler Symbiosis" als internes Framework für die Analyse von Produkt-Synergien.
Nutze das "Hybrid Service Logic" Konzept, um zu bewerten, ob ein Produkt mit einer Dienstleistung kombiniert werden muss (z.B. bei hohen Wartungsanforderungen).
WICHTIG: Antworte immer in der vom User geforderten Sprache (Deutsch), auch wenn der Input Englisch ist.
WICHTIG: Antworte IMMER in der vom User geforderten Sprache (Deutsch), auch wenn der Input Englisch ist.
"""
else: # Default to English
return """
@@ -233,8 +234,9 @@ def phase5(payload):
- Strategy: {json.dumps(phase4_data)}
TASK:
1. Create a "GTM STRATEGY REPORT" in Markdown.
2. Report Structure: Executive Summary, Product Analysis, Target Audience, Target Accounts, Strategy Matrix, Assets.
3. Hybrid-Check: Ensure "Hybrid Service Logic" is visible.
2. CONSOLIDATE ALL PREVIOUS PHASES (1-4) into the report. Don't skip details.
3. Report Structure: Executive Summary, Product Analysis, Target Audience (ICPs), Target Accounts (Whales), Strategy Matrix, Next Steps.
4. Hybrid-Check: Ensure "Hybrid Service Logic" is visible.
{lang_instr}
@@ -354,8 +356,21 @@ def translate(payload):
return {"report": "Translated report will be here."}
def image(payload):
# ... (to be implemented)
return {"imageBase64": ""}
prompt = payload.get('prompt', 'No Prompt')[:50] + "..."
# Create a simple SVG placeholder to avoid frontend crash
svg = f"""
<svg width="512" height="512" xmlns="http://www.w3.org/2000/svg">
<rect width="100%" height="100%" fill="#eee"/>
<text x="50%" y="50%" font-family="Arial" font-size="20" fill="#555" text-anchor="middle" dy=".3em">
Image Generation Not Configured
</text>
<text x="50%" y="60%" font-family="Arial" font-size="12" fill="#888" text-anchor="middle" dy=".3em">
{prompt}
</text>
</svg>
"""
svg_b64 = base64.b64encode(svg.encode('utf-8')).decode('utf-8')
return {"imageBase64": f"data:image/svg+xml;base64,{svg_b64}"}
def main():
"""
@@ -412,4 +427,4 @@ def main():
sys.exit(1)
if __name__ == "__main__":
main()
main()