From dc7d1029afcc9bd9e2a482d39553edf27ec212d1 Mon Sep 17 00:00:00 2001 From: phact Date: Tue, 14 Oct 2025 00:24:22 -0400 Subject: [PATCH] call search in nudges test --- tests/integration/test_api_endpoints.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/integration/test_api_endpoints.py b/tests/integration/test_api_endpoints.py index 616e788a..009dcd47 100644 --- a/tests/integration/test_api_endpoints.py +++ b/tests/integration/test_api_endpoints.py @@ -412,6 +412,19 @@ async def test_langflow_chat_and_nudges_endpoints(): if task_id: await _wait_for_task_completion(client, task_id) + # Debug: Check if documents are searchable before calling nudges + search_resp = await client.post("/search", json={"query": "*", "limit": 10}) + print(f"[DEBUG] Search status: {search_resp.status_code}") + if search_resp.status_code == 200: + search_data = search_resp.json() + results = search_data.get("results", []) + print(f"[DEBUG] Search found {len(results)} documents") + if results: + for r in results[:3]: + print(f"[DEBUG] - {r.get('filename', 'unknown')}: {r.get('text', '')[:100]}") + else: + print(f"[DEBUG] Search failed: {search_resp.text}") + prompt = "Respond with a brief acknowledgement for the OpenRAG integration test." langflow_payload = {"prompt": prompt, "limit": 5, "scoreThreshold": 0} langflow_data = await _wait_for_langflow_chat(client, langflow_payload)