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.
```
2 months ago
..
_api infra: update mypy 1.10, ruff 0.5 (#23721) 3 months ago
beta core: Updated docstring for Context class (#19079) 6 months ago
callbacks Docs: Add how to dispatch custom callback events (#24278) 2 months ago
document_loaders infra: update mypy 1.10, ruff 0.5 (#23721) 3 months ago
documents core: docstrings `documents` (#23506) 2 months ago
embeddings core: docstrings `documents` (#23506) 2 months ago
example_selectors core: docstrings `example_selectors` (#23542) 3 months ago
graph_vectorstores core[patch]: Mark GraphVectorStore as beta (#24195) 2 months ago
indexing core[patch]: Clarify upsert response semantics (#23921) 3 months ago
language_models core: Move json parsing in base chat model / output parser to bg thread (#24031) 3 months ago
load core: docstrings `load` (#23787) 3 months ago
messages core[patch]: allow message utils to work with lcel (#23743) 2 months ago
output_parsers core[minor]: Relax constraints on type checking for tools and parsers (#24459) 2 months ago
outputs core: Move json parsing in base chat model / output parser to bg thread (#24031) 3 months ago
prompts core[patch]: Fix regression requiring input_variables in few chat prompt templates (#24360) 2 months ago
pydantic_v1 multiple: get rid of pyproject extras (#22581) 4 months ago
runnables core[patch]: enable RunnableWithMessageHistory without config (#23775) 2 months ago
tracers core[patch]: core lint fix (#24447) 2 months ago
utils core[minor]: Relax constraints on type checking for tools and parsers (#24459) 2 months ago
vectorstores core: docstrings `vectorstores` update (#24281) 2 months ago
__init__.py
agents.py core[patch]: docstrings `langchain_core/` files update (#24285) 2 months ago
caches.py core[patch]: docstrings `langchain_core/` files update (#24285) 2 months ago
chat_history.py core[patch]: docstrings `langchain_core/` files update (#24285) 2 months ago
chat_loaders.py core: `chat_*` docstrings (#23412) 3 months ago
chat_sessions.py core: `chat_*` docstrings (#23412) 3 months ago
env.py core[patch]: docstrings `langchain_core/` files update (#24285) 2 months ago
exceptions.py core[patch]: docstrings `langchain_core/` files update (#24285) 2 months ago
globals.py core[patch]: docstrings `langchain_core/` files update (#24285) 2 months ago
memory.py core[patch]: docstrings `langchain_core/` files update (#24285) 2 months ago
prompt_values.py core[patch]: docstrings `langchain_core/` files update (#24285) 2 months ago
py.typed
retrievers.py core[patch]: docstrings `langchain_core/` files update (#24285) 2 months ago
stores.py core[patch]: docstrings `langchain_core/` files update (#24285) 2 months ago
structured_query.py core[patch]: docstrings `langchain_core/` files update (#24285) 2 months ago
sys_info.py core[patch]: docstrings `langchain_core/` files update (#24285) 2 months ago
tools.py core[minor]: Relax constraints on type checking for tools and parsers (#24459) 2 months ago