LangChain Plugin: Session
Overview
Section titled “Overview”FlotorchLangChainSession
is a LangChain BaseMemory
that stores chat turns as FloTorch session events and exposes a single history
string for prompts.
from flotorch.langchain.session import FlotorchLangChainSession
API_KEY = "<your_api_key>"BASE_URL = "https://gateway.flotorch.cloud"
short_term_memory = FlotorchLangChainSession( api_key=API_KEY, base_url=BASE_URL,)
Usage Example
Section titled “Usage Example”from langchain.memory import CombinedMemory
memory_services = CombinedMemory(memories=[short_term_memory, external_memory])
- Memory key is
history
- Persists events with
FlotorchSession
under the hood