@@ -19,8 +19,9 @@ def search_knowledge_base(query: str, max_results: int = 5) -> str:
|
|||||||
output_lines = [f"Found {len(results)} result(s):\n"]
|
output_lines = [f"Found {len(results)} result(s):\n"]
|
||||||
for i, r in enumerate(results, 1):
|
for i, r in enumerate(results, 1):
|
||||||
title = r["metadata"].get("title", "Unknown")
|
title = r["metadata"].get("title", "Unknown")
|
||||||
|
score = r["score"]
|
||||||
content = r["content"]
|
content = r["content"]
|
||||||
output_lines.append(f"[{i}] Title: {title}")
|
output_lines.append(f"[{i}] Title: {title} | Score: {score}")
|
||||||
output_lines.append(f" {content}\n")
|
output_lines.append(f" {content}\n")
|
||||||
return "\n".join(output_lines)
|
return "\n".join(output_lines)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user