From a57203065a70d8a245261a2895470e55b75d35ce Mon Sep 17 00:00:00 2001 From: Yiorgis Gozadinos Date: Wed, 3 Dec 2025 16:13:13 +0200 Subject: [PATCH] Fix test --- evaluations/evaluations/evaluators/judge.py | 2 +- evaluations/evaluations/prompts.py | 1 - haiku_rag_slim/haiku/rag/graph/common/models.py | 8 ++++---- tests/test_app.py | 2 ++ tests/test_qa.py | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/evaluations/evaluations/evaluators/judge.py b/evaluations/evaluations/evaluators/judge.py index 5aa60f6b..b7e949d9 100644 --- a/evaluations/evaluations/evaluators/judge.py +++ b/evaluations/evaluations/evaluators/judge.py @@ -26,7 +26,7 @@ GUIDELINES: - Consider both answers correct if they convey the same essential information - Be tolerant of different levels of detail if the core answer is preserved - Evaluate based on what a person asking this question would need to know -/no_think""" +""" class LLMJudgeResponseSchema(BaseModel): diff --git a/evaluations/evaluations/prompts.py b/evaluations/evaluations/prompts.py index 558e8b08..e8bc81f6 100644 --- a/evaluations/evaluations/prompts.py +++ b/evaluations/evaluations/prompts.py @@ -18,5 +18,4 @@ Guidelines: - Stick to the answer, do not ellaborate or provide context unless explicitly asked for it. Be concise, and always maintain accuracy over completeness. Prefer short, direct answers that are well-supported by the documents. -/no_think """ diff --git a/haiku_rag_slim/haiku/rag/graph/common/models.py b/haiku_rag_slim/haiku/rag/graph/common/models.py index 322b7d32..ba2d1914 100644 --- a/haiku_rag_slim/haiku/rag/graph/common/models.py +++ b/haiku_rag_slim/haiku/rag/graph/common/models.py @@ -29,13 +29,13 @@ class ResearchPlan(BaseModel): class Citation(BaseModel): """Resolved citation with full metadata for display/visual grounding.""" - document_id: str - chunk_id: str - document_uri: str + document_id: str = "" + chunk_id: str = "" + document_uri: str = "" document_title: str | None = None page_numbers: list[int] = Field(default_factory=list) headings: list[str] | None = None - content: str + content: str = "" class SearchAnswer(BaseModel): diff --git a/tests/test_app.py b/tests/test_app.py index 357ba874..ec5d581c 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -315,6 +315,8 @@ async def test_ask_with_cite(app: HaikuRAGApp, monkeypatch): mock_answer = "Test answer with citations" mock_citations = [ Citation( + document_id="doc-123", + chunk_id="chunk-456", document_uri="test.md", document_title="Test Document", page_numbers=[1], diff --git a/tests/test_qa.py b/tests/test_qa.py index 9473c648..52626516 100644 --- a/tests/test_qa.py +++ b/tests/test_qa.py @@ -19,7 +19,7 @@ async def test_qa_ollama(qa_corpus: Dataset, temp_db_path): """Test Ollama QA with LLM judge.""" client = HaikuRAG(temp_db_path, create=True) qa = QuestionAnswerAgent( - client, ModelConfig(provider="ollama", name="gpt-oss", enable_thinking=False) + client, ModelConfig(provider="ollama", name="gpt-oss", enable_thinking=True) ) llm_judge = LLMJudge()