Refactor MemoryComponent class and add ZepMessageReaderComponent (#1771)

* Add BaseMemoryComponent class to langflow.base.memory.memory.py (#1750)

* Add BaseMemoryComponent class to langflow.base.memory.memory.py

* Update MemoryComponent class in langflow.components.helpers.MemoryComponent.py to inherit from BaseMemoryComponent

* ✨ (ZepMessageReader.py): Add ZepMessageReaderComponent to retrieve chat messages from Zep
📝 (ZepMessageWriter.py): Add ZepMessageWriterComponent to add messages to ZepChatMessageHistory

📝 (Langflow Memory Conversation.json): Refactor MemoryComponent class to inherit from BaseMemoryComponent for better code organization and reusability. Move get_messages method to the class level and validate kwargs for correct keys before processing.

* Update WeaviateSearch.py to include index_name parameter in build method

Update ZepMessageWriter.py to include metadata parameter in __init__ method

Update ZepMessageReader.py to include cast function for memory parameter

Update schema.py to include cast function for metadata parameter

Update process.py to include tweaks_dict variable and use it in apply_tweaks method

Update Weaviate.py to include index_name parameter in build method and raise ValueError if index_name is not provided

* Update process.py to include tweaks_dict variable and use it in apply_tweaks method

* ✨ (ZepMessageReader.py): Update ZepMessageReaderComponent build method to handle optional url and api_key parameters and improve error handling for zep-python package import
📝 (ZepMessageWriter.py): Refactor ZepMessageWriterComponent to use 'text' instead of 'message' for consistency and update add_message method to reflect this change. Add 'input_value' configuration option for specifying the record to write to Zep. Update build_config method to reflect changes in input parameters. Update add_message method to use 'text' parameter instead of 'message'. Update build method to handle optional url and api_key parameters and improve error handling for zep-python package import.

* Update zep-python package to version 2.0.0rc5

* 📝 (memory.py): update parameter name from 'message' to 'text' for better clarity and consistency
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-04-23 23:06:54 -03:00 • committed by GitHub
commit 19e46de04c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 345 additions and 47 deletions

View file

@ -81,6 +81,7 @@ chromadb = "^0.4.24"
langchain-anthropic = "^0.1.6"
langchain-astradb = "^0.1.0"
langchain-openai = "^0.1.1"
zep-python = {version = "^2.0.0rc5", allow-prereleases = true}
[tool.poetry.group.dev.dependencies]
types-redis = "^4.6.0.5"