Fix: Memgraph Graph Generation Issue (#3109)

This commit is contained in:
Akshat Jain
2025-07-05 22:36:13 +05:30
committed by GitHub
parent c0a930a7d3
commit 4491e7f9f4
2 changed files with 5 additions and 5 deletions

View File

@@ -79,7 +79,7 @@ class OpenAILLM(LLMBase):
tool_choice: str = "auto",
):
"""
Generate a response based on the given messages using OpenAI.
Generate a JSON response based on the given messages using OpenAI.
Args:
messages (list): List of message dicts containing 'role' and 'content'.
@@ -88,7 +88,7 @@ class OpenAILLM(LLMBase):
tool_choice (str, optional): Tool choice method. Defaults to "auto".
Returns:
str: The generated response.
json: The generated response.
"""
params = {
"model": self.config.model,

View File

@@ -3,7 +3,7 @@ import logging
from mem0.memory.utils import format_entities
try:
from langchain_memgraph import Memgraph
from langchain_memgraph.graphs.memgraph import Memgraph
except ImportError:
raise ImportError("langchain_memgraph is not installed. Please install it using pip install langchain-memgraph")
@@ -76,8 +76,8 @@ class MemoryGraph:
# TODO: Batch queries with APOC plugin
# TODO: Add more filter support
deleted_entities = self._delete_entities(to_be_deleted, filters["user_id"])
added_entities = self._add_entities(to_be_added, filters["user_id"], entity_type_map)
deleted_entities = self._delete_entities(to_be_deleted, filters)
added_entities = self._add_entities(to_be_added, filters, entity_type_map)
return {"deleted_entities": deleted_entities, "added_entities": added_entities}