Revert "Remove council_query tool to force stage-by-stage usage"
This reverts commit 93a70bb195.
This commit is contained in:
@@ -59,7 +59,55 @@ async def api_request(
|
|||||||
|
|
||||||
|
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
# INDIVIDUAL STAGE TOOLS (council_query removed to force stage-by-stage usage)
|
# HIGH-LEVEL COUNCIL TOOL
|
||||||
|
# ============================================================================
|
||||||
|
|
||||||
|
@mcp.tool()
|
||||||
|
async def council_query(
|
||||||
|
query: str,
|
||||||
|
conversation_id: str | None = None
|
||||||
|
) -> dict[str, Any]:
|
||||||
|
"""
|
||||||
|
Run the complete LLM Council 3-stage deliberation process.
|
||||||
|
|
||||||
|
Stage 1: Query all council models in parallel for individual responses.
|
||||||
|
Stage 2: Each model anonymously ranks the other responses.
|
||||||
|
Stage 3: Chairman model synthesizes a final answer based on all inputs.
|
||||||
|
|
||||||
|
This process typically takes 1-3 minutes depending on model response times.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
query: The user's question to deliberate on
|
||||||
|
conversation_id: Optional existing conversation ID for multi-turn context
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Complete council response with all 3 stages and metadata including:
|
||||||
|
- conversation_id: The conversation ID used
|
||||||
|
- stage1: Individual model responses
|
||||||
|
- stage2: Peer rankings with aggregate scores
|
||||||
|
- stage3: Chairman's synthesized final answer
|
||||||
|
- metadata: Label mappings and aggregate rankings
|
||||||
|
"""
|
||||||
|
# Create conversation if not provided
|
||||||
|
if not conversation_id:
|
||||||
|
conv = await api_request("POST", "/api/conversations", {})
|
||||||
|
conversation_id = conv["id"]
|
||||||
|
|
||||||
|
# Send message and get full council response
|
||||||
|
result = await api_request(
|
||||||
|
"POST",
|
||||||
|
f"/api/conversations/{conversation_id}/message",
|
||||||
|
{"content": query}
|
||||||
|
)
|
||||||
|
|
||||||
|
return {
|
||||||
|
"conversation_id": conversation_id,
|
||||||
|
**result
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# ============================================================================
|
||||||
|
# INDIVIDUAL STAGE TOOLS
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
|
|
||||||
@mcp.tool()
|
@mcp.tool()
|
||||||
|
|||||||
Reference in New Issue
Block a user