Skip to content
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

graph function call strict tool description typo fix #2028

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions mem0/graphs/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
},
}

UPDATE_MEMORY_STRUCT_TOOL_GRAPH = {
UPDATE_MEMORY_STRICT_TOOL_GRAPH = {
"type": "function",
"function": {
"name": "update_graph_memory",
Expand Down Expand Up @@ -172,7 +172,7 @@
},
}

ADD_MEMORY_STRUCT_TOOL_GRAPH = {
ADD_MEMORY_STRICT_TOOL_GRAPH = {
"type": "function",
"function": {
"name": "add_graph_memory",
Expand Down Expand Up @@ -215,7 +215,7 @@
}


NOOP_STRUCT_TOOL = {
NOOP_STRICT_TOOL = {
"type": "function",
"function": {
"name": "noop",
Expand All @@ -231,7 +231,7 @@
}


ADD_MESSAGE_STRUCT_TOOL = {
ADD_MESSAGE_STRICT_TOOL = {
"type": "function",
"function": {
"name": "add_query",
Expand Down Expand Up @@ -269,7 +269,7 @@
}


SEARCH_STRUCT_TOOL = {
SEARCH_STRICT_TOOL = {
"type": "function",
"function": {
"name": "search",
Expand Down
20 changes: 10 additions & 10 deletions mem0/memory/graph_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
raise ImportError("rank_bm25 is not installed. Please install it using pip install rank-bm25")

from mem0.graphs.tools import (
ADD_MEMORY_STRUCT_TOOL_GRAPH,
ADD_MEMORY_STRICT_TOOL_GRAPH,
ADD_MEMORY_TOOL_GRAPH,
ADD_MESSAGE_STRUCT_TOOL,
ADD_MESSAGE_STRICT_TOOL,
ADD_MESSAGE_TOOL,
NOOP_STRUCT_TOOL,
NOOP_STRICT_TOOL,
NOOP_TOOL,
SEARCH_STRUCT_TOOL,
SEARCH_STRICT_TOOL,
SEARCH_TOOL,
UPDATE_MEMORY_STRUCT_TOOL_GRAPH,
UPDATE_MEMORY_STRICT_TOOL_GRAPH,
UPDATE_MEMORY_TOOL_GRAPH,
)
from mem0.graphs.utils import EXTRACT_ENTITIES_PROMPT, get_update_memory_messages
Expand Down Expand Up @@ -83,7 +83,7 @@ def add(self, data, filters):

_tools = [ADD_MESSAGE_TOOL]
if self.llm_provider in ["azure_openai_structured", "openai_structured"]:
_tools = [ADD_MESSAGE_STRUCT_TOOL]
_tools = [ADD_MESSAGE_STRICT_TOOL]

extracted_entities = self.llm.generate_response(
messages=messages,
Expand All @@ -102,9 +102,9 @@ def add(self, data, filters):
_tools = [UPDATE_MEMORY_TOOL_GRAPH, ADD_MEMORY_TOOL_GRAPH, NOOP_TOOL]
if self.llm_provider in ["azure_openai_structured", "openai_structured"]:
_tools = [
UPDATE_MEMORY_STRUCT_TOOL_GRAPH,
ADD_MEMORY_STRUCT_TOOL_GRAPH,
NOOP_STRUCT_TOOL,
UPDATE_MEMORY_STRICT_TOOL_GRAPH,
ADD_MEMORY_STRICT_TOOL_GRAPH,
NOOP_STRICT_TOOL,
]

memory_updates = self.llm.generate_response(
Expand Down Expand Up @@ -172,7 +172,7 @@ def add(self, data, filters):
def _search(self, query, filters, limit=100):
_tools = [SEARCH_TOOL]
if self.llm_provider in ["azure_openai_structured", "openai_structured"]:
_tools = [SEARCH_STRUCT_TOOL]
_tools = [SEARCH_STRICT_TOOL]
search_results = self.llm.generate_response(
messages=[
{
Expand Down
Loading