forked from TransformerOptimus/SuperAGI
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Tool-Memory LTM (TransformerOptimus#1007)"
This reverts commit 5a42280.
- Loading branch information
TransformerOptimus
committed
Aug 10, 2023
1 parent
909d233
commit e73bba1
Showing
13 changed files
with
21 additions
and
338 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,12 @@ | ||
from sqlalchemy.orm import Session | ||
|
||
from superagi.models.agent_execution_feed import AgentExecutionFeed | ||
from superagi.vector_store.base import VectorStore | ||
|
||
|
||
class ToolResponseQueryManager: | ||
def __init__(self, session: Session, agent_execution_id: int,memory:VectorStore): | ||
def __init__(self, session: Session, agent_execution_id: int): | ||
self.session = session | ||
self.agent_execution_id = agent_execution_id | ||
self.memory=memory | ||
|
||
|
||
|
||
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): | ||
documents = self.memory.get_matching_text(query, metadata=metadata) | ||
relevant_responses = "" | ||
for document in documents["documents"]: | ||
relevant_responses += document.text_content | ||
return relevant_responses |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.