-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tool-Memory LTM #1007
Merged
Fluder-Paradyne
merged 14 commits into
TransformerOptimus:dev
from
AdityaSharma13064:dev
Aug 10, 2023
Merged
Tool-Memory LTM #1007
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
016124f
add ltm
AdityaSharma13064 c145140
removing unused files
AdityaSharma13064 46b0873
adding redis vector store
AdityaSharma13064 09c744d
adding ltm
AdityaSharma13064 77698db
adding ltm
AdityaSharma13064 e1189a4
refactor of function
AdityaSharma13064 a8d4ed0
test case
AdityaSharma13064 16aea84
test case changes
AdityaSharma13064 a4693a5
adding unit tests
AdityaSharma13064 096cdef
commenting redis host
AdityaSharma13064 51685dc
removing tools.json
AdityaSharma13064 1d51c8b
removing tools.json
AdityaSharma13064 96d349b
Merge branch 'TransformerOptimus:dev' into dev
AdityaSharma13064 ca0339b
fixing redis
AdityaSharma13064 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
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,12 +1,22 @@ | ||
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): | ||
def __init__(self, session: Session, agent_execution_id: int,memory:VectorStore): | ||
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) | ||
print("Here are the documents: ",documents,"END") | ||
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
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,4 +1,6 @@ | ||
{ | ||
"tools": { | ||
} | ||
"tools": { | ||
"DuckDuckGo": "https://github.com/TransformerOptimus/SuperAGI-Tools/tree/main/DuckDuckGo", | ||
"notion": "https://github.com/TransformerOptimus/SuperAGI-Tools/tree/main/notion" | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert