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:
parent
5daa99183f
commit
94c892d4b5
1 changed files with 5 additions and 1 deletions
|
|
@ -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():
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue