feat: add dynamic model selection for LLM queries#35
Conversation
Adds a GET /query/models endpoint that fetches available Gemini models from the Google GenAI API, and threads a model parameter through all AI service functions and request schemas so the user can switch models at runtime. Two model selector dropdowns are added to the frontend UI. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@claude please review the changes in this PR |
|
Claude finished @ChingEnLin's task in 1m 40s —— View job PR Review: feat: add dynamic model selection for LLM queriesTodo List:
SummaryThe PR is well-structured overall — the core approach of threading Issues Found1. Double API call in
|
- Fix double API call in /models fallback by materializing the list once - Move genai import to module level for testability - Wire model param through audit_service and audit route - Add two new tests for /models endpoint (normal + fallback paths) - Fix test_analyze_query to assert model kwarg is passed - Add USE_MSAL_AUTH dev-mode guard to getAvailableModels - Persist selectedModel to localStorage so it survives page reloads Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
🎉 This PR is included in version 2.11.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
GET /query/modelsendpoint that fetches available Gemini models from the Google GenAI API (filtered togenerateContent-capable models)modelfield (defaultgemini-2.5-flash) through all AI request schemas (QueryPrompt,DebugQueryRequest,AnalyzeRequest,SchemaRelationshipsRequest,EvaluateWriteRequest) and all service functions"gemini-2.5-flash"strings to use the passed-in model<select>dropdowns to the frontend (full-page layout and embedded/compact layout), populated dynamically from the API on loadtest_debug_queryassertion to match new call signature withmodelkwargTest plan
pytest)GET /query/modelsreturns a list of Gemini model IDsgemini-2.5-flashif the models endpoint fails🤖 Generated with Claude Code