Skip to content

Commit

Permalink
add null check
Browse files Browse the repository at this point in the history
  • Loading branch information
Fluder-Paradyne committed Aug 30, 2023
1 parent 924506c commit b9ba84b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions superagi/tools/tool_response_query_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ def get_last_response(self, tool_name: str = None):
return AgentExecutionFeed.get_last_tool_response(self.session, self.agent_execution_id, tool_name)

def get_relevant_response(self, query: str,metadata:dict, top_k: int = 5):
if self.memory is None:
return ""
documents = self.memory.get_matching_text(query, metadata=metadata)
relevant_responses = ""
for document in documents["documents"]:
Expand Down

0 comments on commit b9ba84b

Please sign in to comment.