mirror of
https://github.com/hwchase17/langchain
synced 2024-11-04 06:00:26 +00:00
Start RunnableBranch callback tags with 1 instead of 0 (#10755)
Changes to match `RunnableSequences` @eyurtsev
This commit is contained in:
parent
931b292126
commit
bbc3fe259b
@ -771,7 +771,8 @@ class RunnableBranch(Serializable, Runnable[Input, Output]):
|
|||||||
expression_value = condition.invoke(
|
expression_value = condition.invoke(
|
||||||
input,
|
input,
|
||||||
config=patch_config(
|
config=patch_config(
|
||||||
config, callbacks=run_manager.get_child(tag=f"condition:{idx}")
|
config,
|
||||||
|
callbacks=run_manager.get_child(tag=f"condition:{idx + 1}"),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -779,7 +780,8 @@ class RunnableBranch(Serializable, Runnable[Input, Output]):
|
|||||||
return runnable.invoke(
|
return runnable.invoke(
|
||||||
input,
|
input,
|
||||||
config=patch_config(
|
config=patch_config(
|
||||||
config, callbacks=run_manager.get_child(tag=f"branch:{idx}")
|
config,
|
||||||
|
callbacks=run_manager.get_child(tag=f"branch:{idx + 1}"),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -813,7 +815,8 @@ class RunnableBranch(Serializable, Runnable[Input, Output]):
|
|||||||
expression_value = await condition.ainvoke(
|
expression_value = await condition.ainvoke(
|
||||||
input,
|
input,
|
||||||
config=patch_config(
|
config=patch_config(
|
||||||
config, callbacks=run_manager.get_child(tag=f"condition:{idx}")
|
config,
|
||||||
|
callbacks=run_manager.get_child(tag=f"condition:{idx + 1}"),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -821,7 +824,8 @@ class RunnableBranch(Serializable, Runnable[Input, Output]):
|
|||||||
return await runnable.ainvoke(
|
return await runnable.ainvoke(
|
||||||
input,
|
input,
|
||||||
config=patch_config(
|
config=patch_config(
|
||||||
config, callbacks=run_manager.get_child(tag=f"branch:{idx}")
|
config,
|
||||||
|
callbacks=run_manager.get_child(tag=f"branch:{idx + 1}"),
|
||||||
),
|
),
|
||||||
**kwargs,
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user