77from ..signer .vectors_v4 import VectorsSignerV4
88from .. import utils
99from .. import validation
10- from .. import endpoints
1110
1211from . import models
1312from . import operations
13+ from . import endpoints
1414from .paginator import (
1515 ListVectorBucketsPaginator ,
1616 ListVectorIndexPaginator ,
@@ -34,29 +34,29 @@ def __init__(self, config: Config, **kwargs) -> None:
3434 self ._build_vectors_user_agent (_config )
3535 self ._client = _SyncClientImpl (_config , ** kwargs )
3636 self ._client ._options .signer = VectorsSignerV4 (user_id = config .user_id )
37+ self ._client ._options .endpoint_provider = endpoints .VectorsEndpointProvider (
38+ account_id = config .user_id ,
39+ endpoint = self ._client ._options .endpoint
40+ )
3741
3842 def __repr__ (self ) -> str :
3943 return "<OssVectorsClient>"
4044
4145 def _resolve_vectors_endpoint (self , config : Config ) -> None :
4246 """vectors endpoint"""
43- disable_ssl = utils .safety_bool (config .disable_ssl )
44- endpoint = utils .safety_str (config .endpoint )
45- region = utils .safety_str (config .region )
46- if len (endpoint ) > 0 :
47- endpoint = endpoints .add_scheme (endpoint , disable_ssl )
48- elif validation .is_valid_region (region ):
49- if bool (config .use_internal_endpoint ):
50- etype = "internal"
51- else :
52- etype = "default"
53-
54- endpoint = endpoints .vectors_from_region (region , disable_ssl , etype )
55-
56- if endpoint == "" :
47+ if config .endpoint is not None :
5748 return
5849
59- config .endpoint = endpoint
50+ if not validation .is_valid_region (config .region ):
51+ return
52+
53+ if bool (config .use_internal_endpoint ):
54+ etype = "internal"
55+ else :
56+ etype = "default"
57+
58+ config .endpoint = endpoints .from_region (config .region , etype )
59+
6060
6161 def _build_vectors_user_agent (self , config : Config ) -> str :
6262 if config .user_agent :
0 commit comments