Improve math chain error msg (#4415)

parallel_dir_loader
Zander Chase 1 year ago committed by GitHub
parent f6c97e6af4
commit 65f85af242
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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 output
return re.sub(r"^\[|\]$", "", output)

Loading…
Cancel
Save