File size: 458 Bytes
03a551b
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
from fastapi import HTTPException, status
from workflow.memory_client import memory_client

def get_mem0_client():
    """
    A dependency that provides the Mem0 client and checks for its availability.
    """
    if not memory_client:
        raise HTTPException(
            status_code=status.HTTP_503_SERVICE_UNAVAILABLE,
            detail="Memory service client is not initialized. Please check server configuration."
        )
    yield memory_client