Fix Stage 1 field name consistency - use 'response' instead of 'content'

The MCP server was reading 'content' but the deployed API returns 'response'
for Stage 1 results. This caused empty responses in the iOS app.
This commit is contained in:
Krishna Kumar
2025-12-30 04:28:24 -06:00
parent 3f2915629e
commit 2119b7bf23
2 changed files with 4 additions and 4 deletions

View File

@@ -26,7 +26,7 @@ async def stage1_collect_responses(user_query: str) -> List[Dict[str, Any]]:
if response is not None: # Only include successful responses
stage1_results.append({
"model": model,
"content": response.get('content', '')
"response": response.get('content', '')
})
return stage1_results
@@ -57,7 +57,7 @@ async def stage2_collect_rankings(
# Build the ranking prompt
responses_text = "\n\n".join([
f"Response {label}:\n{result['content']}"
f"Response {label}:\n{result['response']}"
for label, result in zip(labels, stage1_results)
])
@@ -130,7 +130,7 @@ async def stage3_synthesize_final(
"""
# Build comprehensive context for chairman
stage1_text = "\n\n".join([
f"Model: {result['model']}\nResponse: {result['content']}"
f"Model: {result['model']}\nResponse: {result['response']}"
for result in stage1_results
])

View File

@@ -145,7 +145,7 @@ async def council_query(
"type": "council_response",
"model": model_id,
"model_display_name": get_display_name(model_id),
"response": resp.get("content", ""),
"response": resp.get("response", "") or resp.get("content", ""),
"stage": 1
})