mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-24 12:01:54 +00:00
core: Improve Runnable __or__
method typing annotations (#31273)
* It is possible to chain a `Runnable` with an `AsyncIterator` as seen in `test_runnable.py`. * Iterator and AsyncIterator Input/Output of Callables must be put before `Callable[[Other], Any]` otherwise the pattern matching picks the latter.
This commit is contained in:
committed by
GitHub
parent
e1af509966
commit
17c5a1621f
@@ -5253,7 +5253,7 @@ async def test_runnable_gen_transform() -> None:
|
||||
yield i + 1
|
||||
|
||||
chain: Runnable = RunnableGenerator(gen_indexes, agen_indexes) | plus_one
|
||||
achain = RunnableGenerator(gen_indexes, agen_indexes) | aplus_one
|
||||
achain: Runnable = RunnableGenerator(gen_indexes, agen_indexes) | aplus_one
|
||||
|
||||
assert chain.get_input_jsonschema() == {
|
||||
"title": "gen_indexes_input",
|
||||
|
Reference in New Issue
Block a user