feat: 👔 allow timeout param for OpenAI LLM class
This commit is contained in:
parent
1de976a6a1
commit
404f7f8089
1 changed files with 5 additions and 0 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue