Skip to content

Commit 69bbff5

Browse files
committed
feat: added query examples to use API as per employee's request; fix changes to a2a handler
1 parent af0d284 commit 69bbff5

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

agentic_rag/test_a2a.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,13 @@ def test_agent_discovery(self):
108108
print(f"Discovery response: {json.dumps(response, indent=2)}")
109109

110110
if "error" in response:
111-
print(f"❌ Agent Discovery: FAILED - {response['error']}")
112-
self.test_results.append(("Agent Discovery", False, str(response['error'])))
111+
print(f"❌ Agent Discovery: FAILED - Full response: {json.dumps(response, indent=2)}")
112+
self.test_results.append(("Agent Discovery", False, str(response)))
113113
return False
114114
else:
115115
result = response.get("result", {})
116116
agents = result.get("agents", [])
117+
print(f"Full discovery result: {json.dumps(result, indent=2)}")
117118
if agents:
118119
print(f"✅ Agent Discovery: PASSED - Found {len(agents)} agents")
119120
for i, agent in enumerate(agents, 1):
@@ -124,7 +125,7 @@ def test_agent_discovery(self):
124125
return True
125126
else:
126127
print("❌ Agent Discovery: FAILED - No agents found")
127-
print(f" Result: {result}")
128+
print(f" Full result: {json.dumps(result, indent=2)}")
128129
self.test_results.append(("Agent Discovery", False, "No agents found"))
129130
return False
130131
except Exception as e:
@@ -148,11 +149,12 @@ def test_document_query(self):
148149
)
149150

150151
if "error" in response:
151-
print(f"❌ Document Query: FAILED - {response['error']}")
152-
self.test_results.append(("Document Query", False, str(response['error'])))
152+
print(f"❌ Document Query: FAILED - Full response: {json.dumps(response, indent=2)}")
153+
self.test_results.append(("Document Query", False, str(response)))
153154
return False
154155
else:
155156
result = response.get("result", {})
157+
print(f"Full document query result: {json.dumps(result, indent=2)}")
156158
answer = result.get("answer", "")
157159
if answer and answer != "No answer provided" and answer.strip():
158160
print(f"✅ Document Query: PASSED")
@@ -161,7 +163,7 @@ def test_document_query(self):
161163
return True
162164
else:
163165
print(f"❌ Document Query: FAILED - No valid answer")
164-
print(f" Result: {result}")
166+
print(f" Full result: {json.dumps(result, indent=2)}")
165167
self.test_results.append(("Document Query", False, "No valid answer returned"))
166168
return False
167169
except Exception as e:
@@ -188,15 +190,17 @@ def test_task_operations(self):
188190
)
189191

190192
if "error" in create_response:
191-
print(f"❌ Task Creation: FAILED - {create_response['error']}")
192-
self.test_results.append(("Task Creation", False, str(create_response['error'])))
193+
print(f"❌ Task Creation: FAILED - Full response: {json.dumps(create_response, indent=2)}")
194+
self.test_results.append(("Task Creation", False, str(create_response)))
193195
return False
194196

195197
result = create_response.get("result", {})
198+
print(f"Full task creation result: {json.dumps(result, indent=2)}")
196199
task_id = result.get("task_id")
197200

198201
if not task_id:
199202
print("❌ Task Creation: FAILED - No task ID returned")
203+
print(f" Full result: {json.dumps(result, indent=2)}")
200204
self.test_results.append(("Task Creation", False, "No task ID returned"))
201205
return False
202206

@@ -211,11 +215,12 @@ def test_task_operations(self):
211215
)
212216

213217
if "error" in status_response:
214-
print(f"❌ Task Status: FAILED - {status_response['error']}")
215-
self.test_results.append(("Task Status", False, str(status_response['error'])))
218+
print(f"❌ Task Status: FAILED - Full response: {json.dumps(status_response, indent=2)}")
219+
self.test_results.append(("Task Status", False, str(status_response)))
216220
return False
217221

218222
status_result = status_response.get("result", {})
223+
print(f"Full task status result: {json.dumps(status_result, indent=2)}")
219224
task_status = status_result.get("status", "unknown")
220225
print(f"✅ Task Status: PASSED - Status: {task_status}")
221226
self.test_results.append(("Task Status", True, f"Status: {task_status}"))

0 commit comments

Comments
 (0)