feat: implement true OPRO with Gemini-style UI

- Add true OPRO system instruction optimization (vs query rewriting)
- Implement iterative optimization with performance trajectory
- Add new OPRO API endpoints (/opro/create, /opro/generate_and_evaluate, /opro/execute)
- Create modern Gemini-style chat UI (frontend/opro.html)
- Optimize performance: reduce candidates from 20 to 10 (2x faster)
- Add model selector in UI toolbar
- Add collapsible sidebar with session management
- Add copy button for instructions
- Ensure all generated prompts use simplified Chinese
- Update README with comprehensive documentation
- Add .gitignore for local_docs folder
This commit is contained in:
2025-12-06 17:24:28 +08:00
parent 8f52fad41c
commit 1376d60ed5
10 changed files with 1817 additions and 13 deletions

View File

@@ -14,6 +14,7 @@ DEFAULT_EMBED_MODEL = "qwen3-embedding:4b"
XINFERENCE_EMBED_URL = "http://127.0.0.1:9997/models/bge-base-zh/embed"
# Clustering/selection
TOP_K = 5
GENERATION_POOL_SIZE = 10 # Generate this many candidates before clustering
TOP_K = 5 # Return this many diverse candidates to user
CLUSTER_DISTANCE_THRESHOLD = 0.15