Woody
787c6b1692
fix: vLLM highlight batch failure — replace guided_json with response_format + add debug logging
...
Root cause: guided_json removed in vLLM v0.12.0, and the two-attempt
loop (structured_outputs → guided_json) merged chat_template_kwargs
into the extra_body, potentially causing param conflicts.
Changes:
- llm_client.py: Replace _complete_structured_vllm() with two-tier
approach — response_format (Tier 1, v0.6.4+) then structured_outputs
(Tier 2, v0.8+). Remove dead guided_json path. Add _strip_markdown_fence().
- chunk_highlight_service.py: Add complete() fallback as defense-in-depth
when structured output fails. Strip markdown fences before parsing.
- chunks.py: Add request/response logging at router level.
- chunk_highlight_service.py: Add full logging chain — entry, ChromaDB
fetch, LLM call, fallback, cache results, exit.
- ResponsePanel.tsx: Add console logging for request payload, response
status/errors/timing. Handle status=failed explicitly (was silently
ignored). Track round-trip timing via performance.now().
2026-05-15 11:08:36 +08:00
Woody
41f59b396f
feat: track highlight generation prompt, response, and timing in history (Phase 5.5)
...
- Add 3 columns to query_history: highlight_prompt, highlight_response, highlight_time_ms
- HistoryService.update_highlights() updates existing row after batch LLM call
- ChunkHighlightService measures timing, captures prompt and structured JSON response
- SSE completed event includes history_id for frontend to pass back
- Frontend captures historyId, passes as ?history_id= query param in batch POST
- Highlight time tracked separately (excluded from total_time_ms)
- All 153 tests pass (108 backend + 45 frontend)
2026-04-29 11:18:21 +08:00
Woody
a56f8f69e2
feat: add highlight batch and GET endpoints (Phase 5.4.5)
...
- POST /api/v1/v2/highlights/batch: compute and cache highlights for cited chunks
- GET /api/v1/v2/highlights: serve cached highlighted HTML pages
- chunks.py router registered in main.py
- Dynamic DB path computation (prompts.db -> highlights.db), no Settings changes
- 7 endpoint tests: POST 200/422, GET 200/404, mock service verification
2026-04-29 09:26:50 +08:00