mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-11 13:55:03 +00:00
langchain[patch]: update llm_router.py (#18865)
Issue : _call method of LLMRouterChain uses predict_and_parse, which is slated for deprecation. Description : Instead of using predict_and_parse, this replaces it with individual predict and parse functions.
This commit is contained in:
parent
18de77cc8c
commit
acf1ecc081
@ -56,9 +56,11 @@ class LLMRouterChain(RouterChain):
|
|||||||
) -> Dict[str, Any]:
|
) -> Dict[str, Any]:
|
||||||
_run_manager = run_manager or CallbackManagerForChainRun.get_noop_manager()
|
_run_manager = run_manager or CallbackManagerForChainRun.get_noop_manager()
|
||||||
callbacks = _run_manager.get_child()
|
callbacks = _run_manager.get_child()
|
||||||
|
|
||||||
|
prediction = self.llm_chain.predict(callbacks=callbacks, **inputs)
|
||||||
output = cast(
|
output = cast(
|
||||||
Dict[str, Any],
|
Dict[str, Any],
|
||||||
self.llm_chain.predict_and_parse(callbacks=callbacks, **inputs),
|
self.llm_chain.prompt.output_parser.parse(prediction),
|
||||||
)
|
)
|
||||||
return output
|
return output
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user