diff --git a/libs/community/langchain_community/llms/ollama.py b/libs/community/langchain_community/llms/ollama.py index 2d12dd13224..a06ab72641b 100644 --- a/libs/community/langchain_community/llms/ollama.py +++ b/libs/community/langchain_community/llms/ollama.py @@ -284,7 +284,10 @@ class _OllamaCommon(BaseLanguageModel): async with aiohttp.ClientSession() as session: async with session.post( url=api_url, - headers={"Content-Type": "application/json"}, + headers={ + "Content-Type": "application/json", + **(self.headers if isinstance(self.headers, dict) else {}), + }, json=request_payload, timeout=self.timeout, ) as response: