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 1b0802babe
core: fix .bind when used with RunnableLambda async methods (#17739)
**Description:** Here is a minimal example to illustrate behavior:
```python
from langchain_core.runnables import RunnableLambda

def my_function(*args, **kwargs):
    return 3 + kwargs.get("n", 0)

runnable = RunnableLambda(my_function).bind(n=1)


assert 4 == runnable.invoke({})
assert [4] == list(runnable.stream({}))

assert 4 == await runnable.ainvoke({})
assert [4] == [item async for item in runnable.astream({})]
```
Here, `runnable.invoke({})` and `runnable.stream({})` work fine, but
`runnable.ainvoke({})` raises
```
TypeError: RunnableLambda._ainvoke.<locals>.func() got an unexpected keyword argument 'n'
```
and similarly for `runnable.astream({})`:
```
TypeError: RunnableLambda._atransform.<locals>.func() got an unexpected keyword argument 'n'
```
Here we assume that this behavior is undesired and attempt to fix it.

**Issue:** https://github.com/langchain-ai/langchain/issues/17241,
https://github.com/langchain-ai/langchain/discussions/16446
7 months ago
..
_api docs: Fix bug that caused the word "Beta" to appear twice in doc-strings (#17704) 7 months ago
beta core[patch], community[patch]: mark runnable context, lc load as beta (#15603) 8 months ago
callbacks infra: add print rule to ruff (#16221) 7 months ago
documents core[patch]: doc init positional args (#16854) 7 months ago
example_selectors core[patch], community[patch], langchain[patch], docs: Update SQL chains/agents/docs (#16168) 8 months ago
globals IMPROVEMENT: filter global warnings properly (#13754) 10 months ago
language_models Docs: Add custom chat model documenation (#17595) 7 months ago
load Add JSON representation of runnable graph to serialized representation (#17745) 7 months ago
messages core[minor]: add name to basemessage (#17539) 7 months ago
output_parsers langchain.core : Use shallow copy for schema manipulation in JsonOutputParser.get_format_instructions (#17162) 7 months ago
outputs core[patch]: docstring update (#16813) 7 months ago
prompts Cache calls to create_model for get_input_schema and get_output_schema (#17755) 7 months ago
pydantic_v1 Separate out langchain_core package (#13577) 10 months ago
runnables core: fix .bind when used with RunnableLambda async methods (#17739) 7 months ago
tracers core[patch]: Replace memory stream implementation used by LogStreamCallbackHandler (#17185) 7 months ago
utils core: improve None value processing in merge_dicts() (#17462) 7 months ago
__init__.py core[patch], community[patch]: mark runnable context, lc load as beta (#15603) 8 months ago
agents.py manual mapping (#14422) 9 months ago
caches.py langchain[minor], community[minor], core[minor]: Async Cache support and AsyncRedisCache (#15817) 7 months ago
chat_history.py Add async methods to BaseChatMessageHistory and BaseMemory (#16728) 7 months ago
chat_sessions.py REFACTOR: Refactor langchain_core (#13627) 10 months ago
embeddings.py Propagate context vars in all classes/methods 9 months ago
env.py core[patch]: update langchain-core runtime library name (#14884) 9 months ago
exceptions.py REFACTOR: Refactor langchain_core (#13627) 10 months ago
memory.py Add async methods to BaseChatMessageHistory and BaseMemory (#16728) 7 months ago
prompt_values.py core[patch]: Message content as positional arg (#16921) 7 months ago
py.typed core[minor], langchain[patch], experimental[patch]: Added missing `py.typed` to `langchain_core` (#14143) 10 months ago
retrievers.py core[patch]: passthrough BaseRetriever.invoke(**kwargs) (#16551) 8 months ago
stores.py Add async methods to BaseStore (#16669) 8 months ago
sys_info.py infra: add print rule to ruff (#16221) 7 months ago
tools.py core[patch]: docstring update (#16813) 7 months ago
vectorstores.py Propagate context vars in all classes/methods 9 months ago