You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
langchain/libs/core/langchain_core
ccurme 0f7569ddbc
core[patch]: enable RunnableWithMessageHistory without config (#23775)
Feedback that `RunnableWithMessageHistory` is unwieldy compared to
ConversationChain and similar legacy abstractions is common.

Legacy chains using memory typically had no explicit notion of threads
or separate sessions. To use `RunnableWithMessageHistory`, users are
forced to introduce this concept into their code. This possibly felt
like unnecessary boilerplate.

Here we enable `RunnableWithMessageHistory` to run without a config if
the `get_session_history` callable has no arguments. This enables
minimal implementations like the following:
```python
from langchain_core.chat_history import InMemoryChatMessageHistory
from langchain_core.runnables.history import RunnableWithMessageHistory
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(model="gpt-3.5-turbo-0125")
memory = InMemoryChatMessageHistory()
chain = RunnableWithMessageHistory(llm, lambda: memory)

chain.invoke("Hi I'm Bob")  # Hello Bob!
chain.invoke("What is my name?")  # Your name is Bob.
```
3 months ago
..
_api
beta
callbacks Docs: Add how to dispatch custom callback events (#24278) 3 months ago
document_loaders
documents core: docstrings `documents` (#23506) 3 months ago
embeddings core: docstrings `documents` (#23506) 3 months ago
example_selectors
graph_vectorstores
indexing
language_models
load
messages
output_parsers core[minor]: Relax constraints on type checking for tools and parsers (#24459) 3 months ago
outputs
prompts core[patch]: Fix regression requiring input_variables in few chat prompt templates (#24360) 3 months ago
pydantic_v1
runnables core[patch]: enable RunnableWithMessageHistory without config (#23775) 3 months ago
tracers core[patch]: core lint fix (#24447) 3 months ago
utils core[minor]: Relax constraints on type checking for tools and parsers (#24459) 3 months ago
vectorstores core: docstrings `vectorstores` update (#24281) 3 months ago
__init__.py
agents.py core[patch]: docstrings `langchain_core/` files update (#24285) 3 months ago
caches.py core[patch]: docstrings `langchain_core/` files update (#24285) 3 months ago
chat_history.py core[patch]: docstrings `langchain_core/` files update (#24285) 3 months ago
chat_loaders.py
chat_sessions.py
env.py core[patch]: docstrings `langchain_core/` files update (#24285) 3 months ago
exceptions.py core[patch]: docstrings `langchain_core/` files update (#24285) 3 months ago
globals.py core[patch]: docstrings `langchain_core/` files update (#24285) 3 months ago
memory.py core[patch]: docstrings `langchain_core/` files update (#24285) 3 months ago
prompt_values.py core[patch]: docstrings `langchain_core/` files update (#24285) 3 months ago
py.typed
retrievers.py core[patch]: docstrings `langchain_core/` files update (#24285) 3 months ago
stores.py core[patch]: docstrings `langchain_core/` files update (#24285) 3 months ago
structured_query.py core[patch]: docstrings `langchain_core/` files update (#24285) 3 months ago
sys_info.py core[patch]: docstrings `langchain_core/` files update (#24285) 3 months ago
tools.py core[minor]: Relax constraints on type checking for tools and parsers (#24459) 3 months ago