Fix: Memgraph Graph Generation Issue (#3109)
This commit is contained in:
@@ -79,7 +79,7 @@ class OpenAILLM(LLMBase):
|
|||||||
tool_choice: str = "auto",
|
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:
|
Args:
|
||||||
messages (list): List of message dicts containing 'role' and 'content'.
|
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".
|
tool_choice (str, optional): Tool choice method. Defaults to "auto".
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
str: The generated response.
|
json: The generated response.
|
||||||
"""
|
"""
|
||||||
params = {
|
params = {
|
||||||
"model": self.config.model,
|
"model": self.config.model,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import logging
|
|||||||
from mem0.memory.utils import format_entities
|
from mem0.memory.utils import format_entities
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from langchain_memgraph import Memgraph
|
from langchain_memgraph.graphs.memgraph import Memgraph
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise ImportError("langchain_memgraph is not installed. Please install it using pip install langchain-memgraph")
|
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: Batch queries with APOC plugin
|
||||||
# TODO: Add more filter support
|
# TODO: Add more filter support
|
||||||
deleted_entities = self._delete_entities(to_be_deleted, filters["user_id"])
|
deleted_entities = self._delete_entities(to_be_deleted, filters)
|
||||||
added_entities = self._add_entities(to_be_added, filters["user_id"], entity_type_map)
|
added_entities = self._add_entities(to_be_added, filters, entity_type_map)
|
||||||
|
|
||||||
return {"deleted_entities": deleted_entities, "added_entities": added_entities}
|
return {"deleted_entities": deleted_entities, "added_entities": added_entities}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user