The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
community[patch]: don't try to parse json in case of errored response (#18317)
Nikita Titov9f2ab371623a
diff --git a/libs/community/langchain_community/llms/ollama.py b/libs/community/langchain_community/llms/ollama.pyindex 963d28576f..2dc198fec1 100644--- a/libs/community/langchain_community/llms/ollama.py+++ b/libs/community/langchain_community/llms/ollama.py@@ -236,7 +236,7 @@ class _OllamaCommon(BaseLanguageModel):f"and you should pull the model with `ollama pull {self.model}`.")else:- optional_detail = response.json().get("error")+ optional_detail = response.textraise ValueError(f"Ollama call failed with status code {response.status_code}."f" Details: {optional_detail}"@@ -297,7 +297,7 @@ class _OllamaCommon(BaseLanguageModel):"Ollama call failed with status code 404.")else:- optional_detail = await response.json().get("error") # type: ignore[attr-defined]+ optional_detail = response.textraise ValueError(f"Ollama call failed with status code {response.status}."f" Details: {optional_detail}"