Merge pull request #2199 from Dev-Khant/add-host-support-in-Mem0
Add `host` support in Mem0 Memory
This commit is contained in:
@@ -69,6 +69,7 @@ class Mem0MemoryService(FrameProcessor):
|
|||||||
agent_id: Optional[str] = None,
|
agent_id: Optional[str] = None,
|
||||||
run_id: Optional[str] = None,
|
run_id: Optional[str] = None,
|
||||||
params: Optional[InputParams] = None,
|
params: Optional[InputParams] = None,
|
||||||
|
host: Optional[str] = None,
|
||||||
):
|
):
|
||||||
"""Initialize the Mem0 memory service.
|
"""Initialize the Mem0 memory service.
|
||||||
|
|
||||||
@@ -79,6 +80,7 @@ class Mem0MemoryService(FrameProcessor):
|
|||||||
agent_id: The agent ID to associate with memories in Mem0.
|
agent_id: The agent ID to associate with memories in Mem0.
|
||||||
run_id: The run ID to associate with memories in Mem0.
|
run_id: The run ID to associate with memories in Mem0.
|
||||||
params: Configuration parameters for memory retrieval and storage.
|
params: Configuration parameters for memory retrieval and storage.
|
||||||
|
host: The host of the Mem0 server.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
ValueError: If none of user_id, agent_id, or run_id are provided.
|
ValueError: If none of user_id, agent_id, or run_id are provided.
|
||||||
@@ -92,7 +94,7 @@ class Mem0MemoryService(FrameProcessor):
|
|||||||
if local_config:
|
if local_config:
|
||||||
self.memory_client = Memory.from_config(local_config)
|
self.memory_client = Memory.from_config(local_config)
|
||||||
else:
|
else:
|
||||||
self.memory_client = MemoryClient(api_key=api_key)
|
self.memory_client = MemoryClient(api_key=api_key, host=host)
|
||||||
# At least one of user_id, agent_id, or run_id must be provided
|
# At least one of user_id, agent_id, or run_id must be provided
|
||||||
if not any([user_id, agent_id, run_id]):
|
if not any([user_id, agent_id, run_id]):
|
||||||
raise ValueError("At least one of user_id, agent_id, or run_id must be provided")
|
raise ValueError("At least one of user_id, agent_id, or run_id must be provided")
|
||||||
|
|||||||
Reference in New Issue
Block a user