From 51e3f84453a124d73e60363adcba981f934860a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Byrne?= Date: Fri, 14 Jul 2023 12:00:16 +0100 Subject: [PATCH 1/2] Remove unused cert from async client --- clients/python/text_generation/client.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/clients/python/text_generation/client.py b/clients/python/text_generation/client.py index 947bca37..86c6af06 100644 --- a/clients/python/text_generation/client.py +++ b/clients/python/text_generation/client.py @@ -290,7 +290,6 @@ class AsyncClient: headers: Optional[Dict[str, str]] = None, cookies: Optional[Dict[str, str]] = None, timeout: int = 10, - cert: Optional[Union[str, tuple[str, str]]] = None, ): """ Args: @@ -302,15 +301,11 @@ class AsyncClient: Cookies to include in the requests timeout (`int`): Timeout in seconds - cert (`Optional[Union[str, tuple[str, str]]]`): - If String, path to ssl client cert file (.pem). - If Tuple, ('cert', 'key') pair. """ self.base_url = base_url self.headers = headers self.cookies = cookies self.timeout = ClientTimeout(timeout * 60) - self.cert = cert async def generate( self, From 5161d4148e68162584b15ef957924fe7c87fccfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Byrne?= Date: Fri, 14 Jul 2023 12:00:59 +0100 Subject: [PATCH 2/2] Change type hint for backward compatibility with python <3.9 --- clients/python/text_generation/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clients/python/text_generation/client.py b/clients/python/text_generation/client.py index 86c6af06..14cbc3c6 100644 --- a/clients/python/text_generation/client.py +++ b/clients/python/text_generation/client.py @@ -3,7 +3,7 @@ import requests from aiohttp import ClientSession, ClientTimeout from pydantic import ValidationError -from typing import Dict, Optional, List, AsyncIterator, Iterator, Union +from typing import Dict, Optional, List, AsyncIterator, Iterator, Union, Tuple from text_generation.types import ( StreamResponse, @@ -41,7 +41,7 @@ class Client: headers: Optional[Dict[str, str]] = None, cookies: Optional[Dict[str, str]] = None, timeout: int = 10, - cert: Optional[Union[str, tuple[str, str]]] = None, + cert: Optional[Union[str, Tuple[str, str]]] = None, ): """ Args: