From 2203ee29c95a73e9aa5d7189e6ef8ae6725c7b43 Mon Sep 17 00:00:00 2001 From: Wang Xiang <376752150@qq.com> Date: Thu, 14 Nov 2024 19:45:48 +0800 Subject: [PATCH] graph function call strict tool description typo fix --- mem0/graphs/tools.py | 10 +++++----- mem0/memory/graph_memory.py | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/mem0/graphs/tools.py b/mem0/graphs/tools.py index 1fdbe91faf..5fbfcfa580 100644 --- a/mem0/graphs/tools.py +++ b/mem0/graphs/tools.py @@ -144,7 +144,7 @@ }, } -UPDATE_MEMORY_STRUCT_TOOL_GRAPH = { +UPDATE_MEMORY_STRICT_TOOL_GRAPH = { "type": "function", "function": { "name": "update_graph_memory", @@ -172,7 +172,7 @@ }, } -ADD_MEMORY_STRUCT_TOOL_GRAPH = { +ADD_MEMORY_STRICT_TOOL_GRAPH = { "type": "function", "function": { "name": "add_graph_memory", @@ -215,7 +215,7 @@ } -NOOP_STRUCT_TOOL = { +NOOP_STRICT_TOOL = { "type": "function", "function": { "name": "noop", @@ -231,7 +231,7 @@ } -ADD_MESSAGE_STRUCT_TOOL = { +ADD_MESSAGE_STRICT_TOOL = { "type": "function", "function": { "name": "add_query", @@ -269,7 +269,7 @@ } -SEARCH_STRUCT_TOOL = { +SEARCH_STRICT_TOOL = { "type": "function", "function": { "name": "search", diff --git a/mem0/memory/graph_memory.py b/mem0/memory/graph_memory.py index 5fad61a48d..85733ad17a 100644 --- a/mem0/memory/graph_memory.py +++ b/mem0/memory/graph_memory.py @@ -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 @@ -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, @@ -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( @@ -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=[ {