Skip to content

Commit

Permalink
Patch: improve ollama 404 api error message, fix langchain-ai#15147 (l…
Browse files Browse the repository at this point in the history
…angchain-ai#15156)

Make this issue more clearly exposed to developers
  • Loading branch information
chyroc authored Dec 26, 2023
1 parent e52a734 commit 3a3f880
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libs/community/langchain_community/llms/ollama.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ def _create_stream(
if response.status_code != 200:
if response.status_code == 404:
raise OllamaEndpointNotFoundError(
"Ollama call failed with status code 404."
"Ollama call failed with status code 404. "
"Maybe your model is not found "
f"and you should pull the model with `ollama pull {self.model}`."
)
else:
optional_detail = response.json().get("error")
Expand Down

0 comments on commit 3a3f880

Please sign in to comment.