@@ -66,9 +66,27 @@ def SingleStoreEmbeddingsFactory(
6666 'signature_version' : UNSIGNED ,
6767 'retries' : {'max_attempts' : 1 , 'mode' : 'standard' },
6868 }
69- if http_client is not None and http_client .timeout is not None :
70- cfg_kwargs ['read_timeout' ] = http_client .timeout
71- cfg_kwargs ['connect_timeout' ] = http_client .timeout
69+ # Extract timeouts from http_client if provided
70+ t = http_client .timeout if http_client is not None else None
71+ connect_timeout = None
72+ read_timeout = None
73+ if t is not None :
74+ if isinstance (t , httpx .Timeout ):
75+ if t .connect is not None :
76+ connect_timeout = float (t .connect )
77+ if t .read is not None :
78+ read_timeout = float (t .read )
79+ if connect_timeout is None and read_timeout is not None :
80+ connect_timeout = read_timeout
81+ if read_timeout is None and connect_timeout is not None :
82+ read_timeout = connect_timeout
83+ elif isinstance (t , (int , float )):
84+ connect_timeout = float (t )
85+ read_timeout = float (t )
86+ if read_timeout is not None :
87+ cfg_kwargs ['read_timeout' ] = read_timeout
88+ if connect_timeout is not None :
89+ cfg_kwargs ['connect_timeout' ] = connect_timeout
7290
7391 cfg = Config (** cfg_kwargs )
7492 client = boto3 .client (
0 commit comments