feat: 👔 allow timeout param for OpenAI LLM class

This commit is contained in:
Nate Sesti 2023-10-10 09:35:11 -07:00
parent 1de976a6a1
commit 404f7f8089

View file

@ -1,4 +1,5 @@
from typing import Callable, List, Literal, Optional
import aiohttp
import certifi
import openai
@ -100,6 +101,10 @@ class OpenAI(LLM):
openai.ca_bundle_path = self.ca_bundle_path or certifi.where()
if self.headers is not None or self.ca_bundle_path is not None or self.timeout != 300:
session = self.create_client_session()
openai.aiosession.set(session)
def collect_args(self, options):
args = super().collect_args(options)
if self.engine is not None: