1212from pinecone .core .client .configuration import Configuration
1313from pinecone .core .client .model .create_request import CreateRequest
1414from pinecone .core .client .model .patch_request import PatchRequest
15- from pinecone .core .utils .constants import CLIENT_VERSION_HEADER , CLIENT_ID
1615from pinecone .core .utils .sentry import sentry_decorator as sentry
16+ from pinecone .core .utils import get_user_agent
1717
1818__all__ = [
1919 "create_index" , "delete_index" , "describe_index" , "list_indexes" , "scale_index" , "IndexDescription"
@@ -30,6 +30,7 @@ class IndexDescription(NamedTuple):
3030 index_config : None
3131 status : None
3232
33+
3334def _get_api_instance ():
3435 client_config = Config .OPENAPI_CONFIG
3536 client_config .api_key = client_config .api_key or {}
@@ -41,7 +42,7 @@ def _get_api_instance():
4142 ** client_config .server_variables
4243 }
4344 api_client = ApiClient (configuration = client_config )
44- api_client .set_default_header ( CLIENT_VERSION_HEADER , CLIENT_ID )
45+ api_client .user_agent = get_user_agent ( )
4546 api_instance = IndexOperationsApi (api_client )
4647 return api_instance
4748
@@ -158,7 +159,7 @@ def describe_index(name: str):
158159 ready = response ['status' ]['ready' ]
159160 return IndexDescription (name = db ['name' ], index_type = db ['index_type' ], metric = db ['metric' ],
160161 replicas = db ['replicas' ], dimension = db ['dimension' ], shards = db ['shards' ],
161- index_config = db ['index_config' ],status = {'ready' :ready })
162+ index_config = db ['index_config' ], status = {'ready' : ready })
162163
163164
164165@sentry
0 commit comments