fix: return appropriate result type for chunks search in mcp (#777)

<!-- .github/pull_request_template.md -->

## Description
Add CHUNKS search handling and better unknown search type return value

## DCO Affirmation
I affirm that all code in every commit of this pull request conforms to
the terms of the Topoteretes Developer Certificate of Origin.
This commit is contained in:
Igor Ilic 2025-04-23 15:58:49 +02:00 committed by GitHub
parent 5daa99183f
commit 94c892d4b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -196,9 +196,13 @@ async def search(search_query: str, search_type: str) -> str:
return json.dumps(search_results, cls=JSONEncoder)
elif search_type.upper() == "GRAPH_COMPLETION" or search_type.upper() == "RAG_COMPLETION":
return search_results[0]
else:
elif search_type.upper() == "CHUNKS":
return str(search_results)
elif search_type.upper() == "INSIGHTS":
results = retrieved_edges_to_string(search_results)
return results
else:
return str(search_results)
async def prune():