langchain-ai / langchain

🦜🔗 Build context-aware reasoning applications
https://python.langchain.com
MIT License
93.98k stars 15.15k forks source link

zep_could memory error: TypeError: ZepCloudMemory() takes no arguments #25791

Open Tensionteng opened 1 month ago

Tensionteng commented 1 month ago

Checked other resources

Example Code

from langchain_community.memory.zep_cloud_memory import ZepCloudMemory

# Set up Zep Chat History
memory = ZepCloudMemory(
    session_id=session_id,
    api_key=zep_api_key,
    return_messages=True,
    memory_key="chat_history",
)

Error Message and Stack Trace (if applicable)

TypeError: ZepCloudMemory() takes no arguments

Description

I follow the doc and write the code

from langchain_community.memory.zep_cloud_memory import ZepCloudMemory

# Set up Zep Chat History
memory = ZepCloudMemory(
    session_id=session_id,
    api_key=zep_api_key,
    return_messages=True,
    memory_key="chat_history",
)

then it raise a error:

TypeError: ZepCloudMemory() takes no arguments

so I click into the class ZepCloudMemory, the source code as below:

try:
    from langchain.memory import ConversationBufferMemory
    from zep_cloud import MemoryGetRequestMemoryType

    class ZepCloudMemory(ConversationBufferMemory):
        # something

except ImportError:
    # Placeholder object
    class ZepCloudMemory:  # type: ignore[no-redef]
        pass

the code from zep_cloud import MemoryGetRequestMemoryType has a import error. the code will jump into except block and retuen a class with no constructor.

System Info

python==3.10 langchain-community==0.2.5 langchain-core==0.2.33 zep-cloud==1.0.9

shamssab commented 1 week ago

Hello! We're a group of students from the University of Toronto Scarborough, and we're excited to contribute to LangChain. We'd love the opportunity to investigate this bug further.