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
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
4 months ago
..
cli infra: make `.gitignore` consistent with standard python gitignore (#16828) 5 months ago
community community[patch]: Added add_images method to SingleStoreDB vector store (#17871) 4 months ago
core core: fix .bind when used with RunnableLambda async methods (#17739) 4 months ago
experimental experimental[patch]: Release 0.0.52 (#17763) 5 months ago
langchain Add JSON representation of runnable graph to serialized representation (#17745) 5 months ago
partners partners/astradb: Use single file instead of module for AstraDBVectorStore (#17644) 5 months ago