test(backend): update query tests for sub-question generation (sub-phase 2.3)
Update prompt assertion in decomposer test and field assertions in query endpoint tests to match extracted_questions rename. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
parent
f9dda7bd18
commit
51640201f3
|
|
@ -49,8 +49,8 @@ class TestQuery:
|
|||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
assert "keywords" in data
|
||||
assert data["keywords"] == ["test", "keywords"]
|
||||
assert "extracted_questions" in data
|
||||
assert data["extracted_questions"] == ["test", "keywords"]
|
||||
assert "answer" in data
|
||||
assert "- Bullet point answer" in data["answer"]
|
||||
assert "sources" in data
|
||||
|
|
@ -84,7 +84,7 @@ class TestQuery:
|
|||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
assert data["keywords"] == ["test"]
|
||||
assert data["extracted_questions"] == ["test"]
|
||||
assert "could not find" in data["answer"].lower()
|
||||
assert data["sources"] == []
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ async def test_decompose_valid_json():
|
|||
decomposer = QueryDecomposer(llm)
|
||||
result: List[str] = await decomposer.decompose("What are keywords for X?")
|
||||
assert result == ["alpha", "beta", "gamma"]
|
||||
assert llm.last_prompt == "Given question: 'What are keywords for X?', extract key search keywords as JSON array"
|
||||
assert llm.last_prompt == "Given this question: 'What are keywords for X?'\n\nBreak it down into 2-5 simplified sub-questions that would help search for relevant information. Each sub-question should be short and focused on one aspect. Return as a JSON array of strings."
|
||||
|
||||
|
||||
async def test_decompose_empty_question_returns_empty():
|
||||
|
|
|
|||
Loading…
Reference in New Issue