mirror of
https://github.com/cpacker/MemGPT.git
synced 2025-06-03 04:30:22 +00:00
Allow conversation search to find agent's own messages (#2474)
Co-authored-by: Sarah Wooders <sarahwooders@gmail.com>
This commit is contained in:
parent
7f2dc80596
commit
6d383c363c
@ -45,7 +45,7 @@ def conversation_search(self: "Agent", query: str, page: Optional[int] = 0) -> O
|
||||
count = RETRIEVAL_QUERY_DEFAULT_PAGE_SIZE
|
||||
# TODO: add paging by page number. currently cursor only works with strings.
|
||||
# original: start=page * count
|
||||
messages = self.message_manager.list_user_messages_for_agent(
|
||||
messages = self.message_manager.list_messages_for_agent(
|
||||
agent_id=self.agent_state.id,
|
||||
actor=self.user,
|
||||
query_text=query,
|
||||
|
@ -86,13 +86,14 @@ def test_archival(agent_obj):
|
||||
pass
|
||||
|
||||
|
||||
def test_recall(client, agent_obj):
|
||||
def test_recall_self(client, agent_obj):
|
||||
# keyword
|
||||
keyword = "banana"
|
||||
keyword_backwards = "".join(reversed(keyword))
|
||||
|
||||
# Send messages to agent
|
||||
client.send_message(agent_id=agent_obj.agent_state.id, role="user", message="hello")
|
||||
client.send_message(agent_id=agent_obj.agent_state.id, role="user", message=keyword)
|
||||
client.send_message(agent_id=agent_obj.agent_state.id, role="user", message="what word is '{}' backwards?".format(keyword_backwards))
|
||||
client.send_message(agent_id=agent_obj.agent_state.id, role="user", message="tell me a fun fact")
|
||||
|
||||
# Conversation search
|
||||
|
Loading…
Reference in New Issue
Block a user