feat: stabilize rag chat conversations and auto title sync

This commit is contained in:
wren
2026-05-19 15:52:05 +08:00
parent 564f2bebc8
commit afaba4dd99
19 changed files with 1988 additions and 93 deletions
@@ -4,7 +4,7 @@ import json
import httpx
from fastapi_modules.fastapi_leaudit.rag_engine.config import RAG_CONFIG
from fastapi_modules.fastapi_leaudit.rag_engine.config import RAG_CONFIG, build_openai_chat_completions_url
async def generate_followups(query: str, answer: str) -> list[str]:
@@ -15,7 +15,7 @@ async def generate_followups(query: str, answer: str) -> list[str]:
)
async with httpx.AsyncClient(timeout=30.0) as client:
resp = await client.post(
f"{RAG_CONFIG['LLM_BASE_URL'].rstrip('/')}" + "/chat/completions",
build_openai_chat_completions_url(RAG_CONFIG["LLM_BASE_URL"]),
json={
"model": RAG_CONFIG["LLM_MODEL"],
"messages": [{"role": "user", "content": prompt}],