Skip to content

The agent engineering platform.

Add an example to make the prompt more robust (#5291)

Peng Qud481d887bcce
diff --git a/langchain/chains/llm_math/prompt.py b/langchain/chains/llm_math/prompt.py
index 0e858002fa..8659555332 100644
--- a/langchain/chains/llm_math/prompt.py
+++ b/langchain/chains/llm_math/prompt.py
@@ -25,6 +25,16 @@ Question: What is 37593 * 67?
```
Answer: 2518731
+Question: 37593^(1/5)
+```text
+37593**(1/5)
+```
+...numexpr.evaluate("37593**(1/5)")...
+```output
+8.222831614237718
+```
+Answer: 8.222831614237718
+
Question: {question}
"""