Compare commits

...

4 Commits

Author SHA1 Message Date
Krishna Kumar
8e73f9ffdf Fix OpenRouter model identifiers for LLM Council
Updated to valid model names that exist on OpenRouter:
- google/gemini-2.5-flash (was gemini-2.5-flash-preview-05-20)
- anthropic/claude-3.5-haiku (was claude-sonnet-4 - 402 error)
- x-ai/grok-3-mini (was grok-3-fast)
2025-12-31 09:11:49 -06:00
Krishna Kumar
99d97c696b Fix OpenRouter model identifiers
- google/gemini-3-pro-preview → google/gemini-2.5-flash-preview-05-20
- anthropic/claude-sonnet-4.5 → anthropic/claude-sonnet-4
- x-ai/grok-4.1-fast → x-ai/grok-3-fast
2025-12-31 00:32:30 -06:00
Krishna Kumar
c4bd0a0509 Ignore .railway directory 2025-12-30 06:11:23 -06:00
Krishna Kumar
274e1e5273 Add iOS JSON capture utility 2025-12-30 06:05:36 -06:00
3 changed files with 78 additions and 5 deletions

3
.gitignore vendored
View File

@@ -18,4 +18,5 @@ data/
# Frontend
frontend/node_modules/
frontend/dist/
frontend/.vite/
frontend/.vite/.railway/
.railway/

72
backend/capture.py Normal file
View File

@@ -0,0 +1,72 @@
"""JSON capture utilities for iOS development."""
import json
import os
from datetime import datetime
from typing import List, Dict, Any
# Output directory for captured JSON
CAPTURE_DIR = os.path.join(os.path.dirname(__file__), "..", "ios_json_samples")
def _ensure_capture_dir():
"""Ensure the capture directory exists."""
os.makedirs(CAPTURE_DIR, exist_ok=True)
def _save_json(filename: str, data: Any):
"""Save data as JSON file."""
_ensure_capture_dir()
filepath = os.path.join(CAPTURE_DIR, filename)
with open(filepath, "w") as f:
json.dump(data, f, indent=2, default=str)
print(f"[Capture] Saved: {filepath}")
def capture_conversation_list(conversations: List[Dict[str, Any]]):
"""Capture conversation list response."""
_save_json("conversation_list.json", conversations)
def capture_conversation(conversation: Dict[str, Any]):
"""Capture single conversation response."""
_save_json(f"conversation_{conversation.get('id', 'unknown')[:8]}.json", conversation)
def capture_full_response(stage1: List[Dict], stage2: List[Dict], stage3: Dict, metadata: Dict):
"""Capture full council response."""
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
_save_json(f"full_response_{timestamp}.json", {
"stage1": stage1,
"stage2": stage2,
"stage3": stage3,
"metadata": metadata
})
def capture_sse_events(events: List[Dict[str, Any]]):
"""Capture SSE stream events."""
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
_save_json(f"sse_events_{timestamp}.json", events)
def capture_stage1(results: List[Dict[str, Any]]):
"""Capture Stage 1 results."""
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
_save_json(f"stage1_{timestamp}.json", results)
def capture_stage2(rankings: List[Dict], label_to_model: Dict, aggregate_rankings: List[Dict]):
"""Capture Stage 2 results."""
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
_save_json(f"stage2_{timestamp}.json", {
"rankings": rankings,
"label_to_model": label_to_model,
"aggregate_rankings": aggregate_rankings
})
def capture_stage3(result: Dict[str, Any]):
"""Capture Stage 3 result."""
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
_save_json(f"stage3_{timestamp}.json", result)

View File

@@ -11,13 +11,13 @@ OPENROUTER_API_KEY = os.getenv("OPENROUTER_API_KEY")
# Council members - list of OpenRouter model identifiers
COUNCIL_MODELS = [
"openai/gpt-4o",
"google/gemini-3-pro-preview",
"anthropic/claude-sonnet-4.5",
"x-ai/grok-4.1-fast",
"google/gemini-2.5-flash",
"anthropic/claude-3.5-haiku",
"x-ai/grok-3-mini",
]
# Chairman model - synthesizes final response
CHAIRMAN_MODEL = "google/gemini-3-pro-preview"
CHAIRMAN_MODEL = "google/gemini-2.5-flash"
# OpenRouter API endpoint
OPENROUTER_API_URL = "https://openrouter.ai/api/v1/chat/completions"