diff --git a/server/continuedev/libs/llm/openai.py b/server/continuedev/libs/llm/openai.py index ba29279bc..2276c1c99 100644 --- a/server/continuedev/libs/llm/openai.py +++ b/server/continuedev/libs/llm/openai.py @@ -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: