(fix) ssl changes

This commit is contained in:
ishaan-jaff 2023-11-10 15:57:59 -08:00
parent de456408aa
commit 2bc516ae2d
2 changed files with 3 additions and 3 deletions

View file

@ -160,7 +160,7 @@ class AzureChatCompletion(BaseLLM):
async def acompletion(self, api_base: str, data: dict, headers: dict, model_response: ModelResponse): async def acompletion(self, api_base: str, data: dict, headers: dict, model_response: ModelResponse):
async with aiohttp.ClientSession() as session: async with aiohttp.ClientSession() as session:
async with session.post(api_base, json=data, headers=headers) as response: async with session.post(api_base, json=data, headers=headers, ssl=False) as response:
response_json = await response.json() response_json = await response.json()
if response.status != 200: if response.status != 200:
raise AzureOpenAIError(status_code=response.status, message=response.text) raise AzureOpenAIError(status_code=response.status, message=response.text)
@ -176,7 +176,7 @@ class AzureChatCompletion(BaseLLM):
model_response: ModelResponse, model_response: ModelResponse,
model: str): model: str):
async with aiohttp.ClientSession() as session: async with aiohttp.ClientSession() as session:
async with session.post(api_base, json=data, headers=headers) as response: async with session.post(api_base, json=data, headers=headers, ssl=False) as response:
# Check if the request was successful (status code 200) # Check if the request was successful (status code 200)
if response.status != 200: if response.status != 200:
raise AzureOpenAIError(status_code=response.status, message=await response.text()) raise AzureOpenAIError(status_code=response.status, message=await response.text())

View file

@ -273,7 +273,7 @@ class OpenAIChatCompletion(BaseLLM):
model_response: ModelResponse, model_response: ModelResponse,
model: str): model: str):
async with aiohttp.ClientSession() as session: async with aiohttp.ClientSession() as session:
async with session.post(api_base, json=data, headers=headers) as response: async with session.post(api_base, json=data, headers=headers, ssl=False) as response:
# Check if the request was successful (status code 200) # Check if the request was successful (status code 200)
if response.status != 200: if response.status != 200:
raise OpenAIError(status_code=response.status, message=await response.text()) raise OpenAIError(status_code=response.status, message=await response.text())