feat(rag): lite-model document summaries — non-markdown docs summarized at import, summary chunk retrieves and resolves to the full source doc
This commit is contained in:
@@ -72,6 +72,15 @@ class FakeRagLLM:
|
||||
self.embed_batches += 1
|
||||
return [_token_vec(t) for t in texts]
|
||||
|
||||
async def chat(
|
||||
self, messages: list[dict[str, str]], model: str | None = None
|
||||
) -> str:
|
||||
"""Deterministic ``lite`` stand-in for the import-time summaries
|
||||
(phase 30) — same convention as ``tests.fakes.FakeEmbedder.chat``."""
|
||||
user = next((m["content"] for m in messages if m.get("role") == "user"), "")
|
||||
first = user.split()
|
||||
return "Summary of " + (first[0] if first else "<empty>")
|
||||
|
||||
async def embed_one(self, text: str) -> list[float]:
|
||||
if self.embed_error is not None:
|
||||
raise self.embed_error
|
||||
|
||||
Reference in New Issue
Block a user