Skip to content
This repository was archived by the owner on Jun 3, 2026. It is now read-only.

Commit bd6c1c4

Browse files
Add raw answer missing-score regression
1 parent 7c6d8d9 commit bd6c1c4

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

tests/integration/test_retrieval_pipeline.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,25 @@ async def test_answer_from_sources_skips_tool_selection(vector_store, neo4j_clie
304304
assert not pipeline.model_with_tools.calls
305305

306306

307+
@pytest.mark.asyncio
308+
async def test_answer_from_sources_handles_missing_source_scores(
309+
vector_store, neo4j_client
310+
):
311+
model = FakeChatModel(responses=["Alice works at XMem."])
312+
pipeline = RetrievalPipeline(
313+
model=model, vector_store=vector_store, neo4j_client=neo4j_client
314+
)
315+
316+
answer = await pipeline.answer_from_sources(
317+
"Where does Alice work?",
318+
[SourceRecord(domain="profile", content="work / company = XMem", score=None)],
319+
)
320+
321+
assert answer == "Alice works at XMem."
322+
assert "score:" not in model.calls[0][0].content
323+
assert not pipeline.model_with_tools.calls
324+
325+
307326
@pytest.mark.asyncio
308327
async def test_retrieval_tool_dispatch_handles_unknown_and_snippet(
309328
vector_store, neo4j_client

0 commit comments

Comments
 (0)