From 59b7453afed06418d4c171b65370a6a82f5a9221 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 13 Sep 2023 23:56:24 -0700 Subject: fix: :bug: verify_ssl and ssl_context mutual exclusivity --- continuedev/src/continuedev/libs/llm/proxy_server.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'continuedev/src') diff --git a/continuedev/src/continuedev/libs/llm/proxy_server.py b/continuedev/src/continuedev/libs/llm/proxy_server.py index 032464be..3efa805f 100644 --- a/continuedev/src/continuedev/libs/llm/proxy_server.py +++ b/continuedev/src/continuedev/libs/llm/proxy_server.py @@ -35,10 +35,17 @@ class ProxyServer(LLM): **kwargs, ): await super().start(**kwargs) - self._client_session = aiohttp.ClientSession( - connector=aiohttp.TCPConnector(ssl_context=ssl_context, verify_ssl=self.verify_ssl), - timeout=aiohttp.ClientTimeout(total=self.timeout), - ) + if self.verify_ssl is False: + self._client_session = aiohttp.ClientSession( + connector=aiohttp.TCPConnector(verify_ssl=False), + timeout=aiohttp.ClientTimeout(total=self.timeout), + ) + else: + self._client_session = aiohttp.ClientSession( + connector=aiohttp.TCPConnector(ssl_context=ssl_context), + timeout=aiohttp.ClientTimeout(total=self.timeout), + ) + self.context_length = MAX_TOKENS_FOR_MODEL[self.model] async def stop(self): -- cgit v1.2.3-70-g09d2