mirror of
https://github.com/hwchase17/langchain
synced 2024-11-18 09:25:54 +00:00
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.
This commit is contained in:
parent
5e73603e8a
commit
508bde7f40
@ -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…
Reference in New Issue
Block a user