aidn commited on
Commit
6d8772b
·
verified ·
1 Parent(s): c380c0d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -7
app.py CHANGED
@@ -42,11 +42,13 @@ def run_council(user_prompt, rounds):
42
  history = [{"role": "user", "content": user_prompt}]
43
  yield history
44
 
 
45
  discussion_history = ""
46
 
47
  # --- PHASE 1: DAS PLENUM DISKUTIERT ---
48
  for r in range(int(rounds)):
49
- round_header = f"### ZYKLUS {r+1} - EXPERTENDEBATTE"
 
50
  history.append({"role": "assistant", "content": round_header})
51
  yield history
52
 
@@ -68,15 +70,17 @@ def run_council(user_prompt, rounds):
68
  )
69
 
70
  answer = ask_model(model_id, system_msg, current_prompt)
71
- formatted_answer = f"**{name}**: {answer}"
72
 
73
- discussion_history += f"{formatted_answer}\n\n"
 
74
 
75
- history.append({"role": "assistant", "content": formatted_answer})
 
 
76
  yield history
77
 
78
  # --- PHASE 2: VORARBEIT DES MODERATORS (KONSENS FINDEN) ---
79
- history.append({"role": "assistant", "content": "### MODERATOR: ANALYSE DER DISKUSSION"})
80
  yield history
81
 
82
  prep_prompt = (
@@ -84,11 +88,13 @@ def run_council(user_prompt, rounds):
84
  "Fasse die wichtigsten Argumente und den finalen Konsens neutral und prägnant in 3-4 Sätzen zusammen."
85
  )
86
  consensus_res = ask_model(MODERATOR_MODEL, "Du bist der Chef-Analyst des Rates.", prep_prompt)
87
- history.append({"role": "assistant", "content": consensus_res})
 
 
88
  yield history
89
 
90
  # --- PHASE 3: FINALE UMSETZUNG (BENUTZERAUFTRAG ERFÜLLEN) ---
91
- history.append({"role": "assistant", "content": "### FINALE AUSGABE (AUFTRAG ERFÜLLT)"})
92
  yield history
93
 
94
  final_prompt = (
 
42
  history = [{"role": "user", "content": user_prompt}]
43
  yield history
44
 
45
+ # Hier speichern wir den reinen Text OHNE HTML für die Modelle
46
  discussion_history = ""
47
 
48
  # --- PHASE 1: DAS PLENUM DISKUTIERT ---
49
  for r in range(int(rounds)):
50
+ # Visuelle Trennlinie und Überschrift für die UI
51
+ round_header = f"<h2 style='color: #FF5A4D; border-bottom: 2px solid #FFEBE8; padding-bottom: 5px; margin-top: 20px;'>🔄 ZYKLUS {r+1} - EXPERTENDEBATTE</h2>"
52
  history.append({"role": "assistant", "content": round_header})
53
  yield history
54
 
 
70
  )
71
 
72
  answer = ask_model(model_id, system_msg, current_prompt)
 
73
 
74
+ # 1. Reiner Text für das interne Kontext-Fenster der KIs
75
+ discussion_history += f"{name}: {answer}\n\n"
76
 
77
+ # 2. Schick formatiertes HTML/Markdown für die UI
78
+ display_answer = f"**<span style='color: #4241A6; font-size: 1.1em;'>👤 {name}</span>**\n\n> {answer}"
79
+ history.append({"role": "assistant", "content": display_answer})
80
  yield history
81
 
82
  # --- PHASE 2: VORARBEIT DES MODERATORS (KONSENS FINDEN) ---
83
+ history.append({"role": "assistant", "content": "<h2 style='color: #FF5A4D; border-bottom: 2px solid #FFEBE8; padding-bottom: 5px; margin-top: 20px;'>🧠 MODERATOR: ANALYSE DER DISKUSSION</h2>"})
84
  yield history
85
 
86
  prep_prompt = (
 
88
  "Fasse die wichtigsten Argumente und den finalen Konsens neutral und prägnant in 3-4 Sätzen zusammen."
89
  )
90
  consensus_res = ask_model(MODERATOR_MODEL, "Du bist der Chef-Analyst des Rates.", prep_prompt)
91
+
92
+ # Auch hier nutzen wir Blockquotes für bessere Lesbarkeit
93
+ history.append({"role": "assistant", "content": f"> {consensus_res}"})
94
  yield history
95
 
96
  # --- PHASE 3: FINALE UMSETZUNG (BENUTZERAUFTRAG ERFÜLLEN) ---
97
+ history.append({"role": "assistant", "content": "<h2 style='color: #FF5A4D; border-bottom: 2px solid #FFEBE8; padding-bottom: 5px; margin-top: 20px;'>🏆 FINALE AUSGABE (AUFTRAG ERFÜLLT)</h2>"})
98
  yield history
99
 
100
  final_prompt = (