community[patch]: Ollama - Pass headers to post request in async method (#16660)

# Description
A previous PR (https://github.com/langchain-ai/langchain/pull/15881)
added option to pass headers to ollama endpoint, but headers are not
pass to the async method.
pull/14263/head
Zhuoyun(John) Xu 8 months ago committed by GitHub
parent 5e73603e8a
commit 508bde7f40
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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:

Loading…
Cancel
Save