Skip to content

The agent engineering platform.

Update modal.py (#11588)

Shorthills AI4b6fdd7bf0d0
diff --git a/libs/langchain/langchain/llms/modal.py b/libs/langchain/langchain/llms/modal.py
index 9f1f42269d..c18b159937 100644
--- a/libs/langchain/langchain/llms/modal.py
+++ b/libs/langchain/langchain/llms/modal.py
@@ -91,7 +91,7 @@ class Modal(LLM):
if prompt in response.json()["prompt"]:
response_json = response.json()
except KeyError:
- raise ValueError("LangChain requires 'prompt' key in response.")
+ raise KeyError("LangChain requires 'prompt' key in response.")
text = response_json["prompt"]
if stop is not None:
# I believe this is required since the stop tokens