The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
Improve math chain error msg (#4415)
Zander Chase65f85af242c5
diff --git a/langchain/chains/llm_math/base.py b/langchain/chains/llm_math/base.pyindex 1037658d60..b737b57f3f 100644--- a/langchain/chains/llm_math/base.py+++ b/langchain/chains/llm_math/base.py@@ -84,7 +84,10 @@ class LLMMathChain(Chain):))except Exception as e:- raise ValueError(f"{e}. Please try again with a valid numerical expression")+ raise ValueError(+ f'LLMMathChain._evaluate("{expression}") raised error: {e}.'+ " Please try again with a valid numerical expression"+ )# Remove any leading and trailing brackets from the outputreturn re.sub(r"^\[|\]$", "", output)