mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-24 07:35:18 +00:00
minor bug fix: properly await AsyncRunManager's method call in MulitRouteChain (#7487)
This simply awaits `AsyncRunManager`'s method call in `MulitRouteChain`. Noticed this while playing around with Langchain's implementation of `MultiPromptChain`. @baskaryan cheers --------- Co-authored-by: Bagatur <baskaryan@gmail.com>
This commit is contained in:
parent
cc0585af42
commit
00c466627a
@ -102,11 +102,11 @@ class MultiRouteChain(Chain):
|
|||||||
inputs: Dict[str, Any],
|
inputs: Dict[str, Any],
|
||||||
run_manager: Optional[AsyncCallbackManagerForChainRun] = None,
|
run_manager: Optional[AsyncCallbackManagerForChainRun] = None,
|
||||||
) -> Dict[str, Any]:
|
) -> Dict[str, Any]:
|
||||||
_run_manager = run_manager or CallbackManagerForChainRun.get_noop_manager()
|
_run_manager = run_manager or AsyncCallbackManagerForChainRun.get_noop_manager()
|
||||||
callbacks = _run_manager.get_child()
|
callbacks = _run_manager.get_child()
|
||||||
route = await self.router_chain.aroute(inputs, callbacks=callbacks)
|
route = await self.router_chain.aroute(inputs, callbacks=callbacks)
|
||||||
|
|
||||||
_run_manager.on_text(
|
await _run_manager.on_text(
|
||||||
str(route.destination) + ": " + str(route.next_inputs), verbose=self.verbose
|
str(route.destination) + ": " + str(route.next_inputs), verbose=self.verbose
|
||||||
)
|
)
|
||||||
if not route.destination:
|
if not route.destination:
|
||||||
|
Loading…
Reference in New Issue
Block a user