summaryrefslogtreecommitdiff
path: root/backend/app/services
diff options
context:
space:
mode:
Diffstat (limited to 'backend/app/services')
-rw-r--r--backend/app/services/debate.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/backend/app/services/debate.py b/backend/app/services/debate.py
index 086dde1..fa63985 100644
--- a/backend/app/services/debate.py
+++ b/backend/app/services/debate.py
@@ -24,6 +24,12 @@ def _format_history(debate_history: List[Dict[str, Any]]) -> str:
text += f"\n--- Round {rn} ---\n"
for resp in past_round["responses"]:
text += f"\n[{resp['model']}]:\n{resp['response']}\n"
+ for elim in past_round.get("eliminated", []):
+ convinced_by = elim.get("convinced_by")
+ if convinced_by:
+ text += f"\n[{elim['model']} was convinced by {convinced_by} and left the debate]\n"
+ else:
+ text += f"\n[{elim['model']} conceded and left the debate]\n"
return text
@@ -496,9 +502,14 @@ async def debate_event_stream(
# Process eliminations
eliminated_this_round = []
+ eliminated_details = []
for cfg, result in zip(active_configs, results):
if result["convinced"]:
eliminated_this_round.append(cfg.model_name)
+ eliminated_details.append({
+ "model": cfg.model_name,
+ "convinced_by": result.get("convinced_by"),
+ })
yield _sse_event({
"type": "model_eliminated",
"data": {
@@ -509,6 +520,10 @@ async def debate_event_stream(
},
})
+ # Store elimination info in debate history so prompts include it
+ if eliminated_details:
+ debate_history[-1]["eliminated"] = eliminated_details
+
# Remove eliminated models from active list
if eliminated_this_round:
active_indices = [