mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-06 20:15:17 +02:00
feat(tests): Update tests for summary-free indexing
This commit is contained in:
parent
dc6a17930b
commit
ddfe60c2f0
26 changed files with 123 additions and 294 deletions
|
|
@ -7,13 +7,13 @@ The production indexing pipeline summarizes documents with:
|
|||
summary_content = summary_result.content
|
||||
|
||||
The `llm` parameter is supplied per-document by
|
||||
`app.services.llm_service.get_user_long_context_llm`. We patch THAT
|
||||
`app.services.llm_service.get_agent_llm`. We patch THAT
|
||||
function to return a langchain-native FakeListChatModel so the rest of
|
||||
the chain works unchanged. No real LLM provider package is touched.
|
||||
|
||||
Run-backend / run-celery use unittest.mock.patch.start() to install
|
||||
this at every binding site (the source module + every consumer that
|
||||
did `from app.services.llm_service import get_user_long_context_llm`
|
||||
did `from app.services.llm_service import get_agent_llm`
|
||||
at module load time).
|
||||
"""
|
||||
|
||||
|
|
@ -42,7 +42,7 @@ def _make_fake_llm() -> FakeListChatModel:
|
|||
return fake
|
||||
|
||||
|
||||
async def fake_get_user_long_context_llm(*args: Any, **kwargs: Any) -> Any:
|
||||
"""Drop-in replacement for app.services.llm_service.get_user_long_context_llm."""
|
||||
async def fake_get_agent_llm(*args: Any, **kwargs: Any) -> Any:
|
||||
"""Drop-in replacement for app.services.llm_service.get_agent_llm."""
|
||||
logger.info("[fake-llm] returning FakeListChatModel for E2E indexing")
|
||||
return _make_fake_llm()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue