legco_ai_assistant/backend/app/models
Woody f2115ae563 feat: structured LLM output for decompose + citation fuzzy matching (Phase 5)
Phase 5.1 — Structured LLM output for query decomposition:
- Add SubQuestions Pydantic model with sub_question, keywords, rationale
- Add LLMClient.complete_structured() using langchain with_structured_output
- Update QueryDecomposer with structured output path + legacy json.loads fallback
- Update SQLite seed templates: add subq+citation labeling requirement
- Add tests: structured output, subquestions model validation, logging

Phase 5.2 — Citation format alignment and fallback links:
- Add document_id to SourceMetadata (backend + frontend types)
- Rewrite citationParser.ts with fuzzy matching and fallback document links
- Add RAGDatabasePage auto-expand from ?document= URL param
- Tighten generate_per_subq seed prompt: 'Copy exact bracket labels shown'
- Add citation parser tests for fuzzy match and fallback link scenarios
- Defer: DOCX/TXT PDF generation → Phase 5.3 (fallback links sufficient)
2026-04-28 15:39:17 +08:00
..
__init__.py feat: Phase 1.1 project setup with config, database, and models 2026-04-22 16:13:52 +08:00
common.py feat: structured LLM output for decompose + citation fuzzy matching (Phase 5) 2026-04-28 15:39:17 +08:00
decompose.py feat: structured LLM output for decompose + citation fuzzy matching (Phase 5) 2026-04-28 15:39:17 +08:00
documents.py feat(backend): add documents CRUD service methods and Pydantic schemas 2026-04-23 19:02:07 +08:00
history.py feat(models): add SubQuestionSources model and per-sub-q history fields 2026-04-26 23:28:19 +08:00
ingest.py refactor(backend): update Pydantic models for ingestion and query 2026-04-23 13:26:20 +08:00
prompts.py feat(prompts): add JSON export/import for profile prompt configurations 2026-04-27 19:44:35 +08:00
query.py feat(models): add SubQuestionSources model and per-sub-q history fields 2026-04-26 23:28:19 +08:00