pinecone.core.client.model.vector
Pinecone API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: version not set Contact: support@pinecone.io Generated by: https://openapi-generator.tech
1""" 2 Pinecone API 3 4 No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 5 6 The version of the OpenAPI document: version not set 7 Contact: support@pinecone.io 8 Generated by: https://openapi-generator.tech 9""" 10 11 12import re # noqa: F401 13import sys # noqa: F401 14 15from pinecone.core.client.model_utils import ( # noqa: F401 16 ApiTypeError, 17 ModelComposed, 18 ModelNormal, 19 ModelSimple, 20 cached_property, 21 change_keys_js_to_python, 22 convert_js_args_to_python_args, 23 date, 24 datetime, 25 file_type, 26 none_type, 27 validate_get_composed_info, 28) 29from ..model_utils import OpenApiModel 30from pinecone.core.client.exceptions import ApiAttributeError 31 32 33def lazy_import(): 34 from pinecone.core.client.model.sparse_values import SparseValues 35 36 globals()["SparseValues"] = SparseValues 37 38 39class Vector(ModelNormal): 40 """NOTE: This class is auto generated by OpenAPI Generator. 41 Ref: https://openapi-generator.tech 42 43 Do not edit the class manually. 44 45 Attributes: 46 allowed_values (dict): The key is the tuple path to the attribute 47 and the for var_name this is (var_name,). The value is a dict 48 with a capitalized key describing the allowed value and an allowed 49 value. These dicts store the allowed enum values. 50 attribute_map (dict): The key is attribute name 51 and the value is json key in definition. 52 discriminator_value_class_map (dict): A dict to go from the discriminator 53 variable value to the discriminator class name. 54 validations (dict): The key is the tuple path to the attribute 55 and the for var_name this is (var_name,). The value is a dict 56 that stores validations for max_length, min_length, max_items, 57 min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, 58 inclusive_minimum, and regex. 59 additional_properties_type (tuple): A tuple of classes accepted 60 as additional properties values. 61 """ 62 63 allowed_values = {} 64 65 validations = { 66 ("id",): { 67 "max_length": 512, 68 "min_length": 1, 69 }, 70 ("values",): {}, 71 } 72 73 @cached_property 74 def additional_properties_type(): 75 """ 76 This must be a method because a model may have properties that are 77 of type self, this must run after the class is loaded 78 """ 79 lazy_import() 80 return ( 81 bool, 82 date, 83 datetime, 84 dict, 85 float, 86 int, 87 list, 88 str, 89 none_type, 90 ) # noqa: E501 91 92 _nullable = False 93 94 @cached_property 95 def openapi_types(): 96 """ 97 This must be a method because a model may have properties that are 98 of type self, this must run after the class is loaded 99 100 Returns 101 openapi_types (dict): The key is attribute name 102 and the value is attribute type. 103 """ 104 lazy_import() 105 return { 106 "id": (str,), # noqa: E501 107 "values": ([float],), # noqa: E501 108 "sparse_values": (SparseValues,), # noqa: E501 109 "metadata": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 110 } 111 112 @cached_property 113 def discriminator(): 114 return None 115 116 attribute_map = { 117 "id": "id", # noqa: E501 118 "values": "values", # noqa: E501 119 "sparse_values": "sparseValues", # noqa: E501 120 "metadata": "metadata", # noqa: E501 121 } 122 123 read_only_vars = {} 124 125 _composed_schemas = {} 126 127 @classmethod 128 @convert_js_args_to_python_args 129 def _from_openapi_data(cls, id, values, *args, **kwargs): # noqa: E501 130 """Vector - a model defined in OpenAPI 131 132 Args: 133 id (str): This is the vector's unique id. 134 values ([float]): This is the vector data included in the request. 135 136 Keyword Args: 137 _check_type (bool): if True, values for parameters in openapi_types 138 will be type checked and a TypeError will be 139 raised if the wrong type is input. 140 Defaults to True 141 _path_to_item (tuple/list): This is a list of keys or values to 142 drill down to the model in received_data 143 when deserializing a response 144 _spec_property_naming (bool): True if the variable names in the input data 145 are serialized names, as specified in the OpenAPI document. 146 False if the variable names in the input data 147 are pythonic names, e.g. snake case (default) 148 _configuration (Configuration): the instance to use when 149 deserializing a file_type parameter. 150 If passed, type conversion is attempted 151 If omitted no type conversion is done. 152 _visited_composed_classes (tuple): This stores a tuple of 153 classes that we have traveled through so that 154 if we see that class again we will not use its 155 discriminator again. 156 When traveling through a discriminator, the 157 composed schema that is 158 is traveled through is added to this set. 159 For example if Animal has a discriminator 160 petType and we pass in "Dog", and the class Dog 161 allOf includes Animal, we move through Animal 162 once using the discriminator, and pick Dog. 163 Then in Dog, we will make an instance of the 164 Animal class but this time we won't travel 165 through its discriminator because we passed in 166 _visited_composed_classes = (Animal,) 167 sparse_values (SparseValues): the sparse data of the returned vector [optional] # noqa: E501 168 metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): This is the metadata included in the request.. [optional] # noqa: E501 169 """ 170 171 _check_type = kwargs.pop("_check_type", True) 172 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 173 _path_to_item = kwargs.pop("_path_to_item", ()) 174 _configuration = kwargs.pop("_configuration", None) 175 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 176 177 self = super(OpenApiModel, cls).__new__(cls) 178 179 if args: 180 raise ApiTypeError( 181 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 182 % ( 183 args, 184 self.__class__.__name__, 185 ), 186 path_to_item=_path_to_item, 187 valid_classes=(self.__class__,), 188 ) 189 190 self._data_store = {} 191 self._check_type = _check_type 192 self._spec_property_naming = _spec_property_naming 193 self._path_to_item = _path_to_item 194 self._configuration = _configuration 195 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 196 197 self.id = id 198 self.values = values 199 for var_name, var_value in kwargs.items(): 200 if ( 201 var_name not in self.attribute_map 202 and self._configuration is not None 203 and self._configuration.discard_unknown_keys 204 and self.additional_properties_type is None 205 ): 206 # discard variable. 207 continue 208 setattr(self, var_name, var_value) 209 return self 210 211 required_properties = set( 212 [ 213 "_data_store", 214 "_check_type", 215 "_spec_property_naming", 216 "_path_to_item", 217 "_configuration", 218 "_visited_composed_classes", 219 ] 220 ) 221 222 @convert_js_args_to_python_args 223 def __init__(self, id, values, *args, **kwargs): # noqa: E501 224 """Vector - a model defined in OpenAPI 225 226 Args: 227 id (str): This is the vector's unique id. 228 values ([float]): This is the vector data included in the request. 229 230 Keyword Args: 231 _check_type (bool): if True, values for parameters in openapi_types 232 will be type checked and a TypeError will be 233 raised if the wrong type is input. 234 Defaults to True 235 _path_to_item (tuple/list): This is a list of keys or values to 236 drill down to the model in received_data 237 when deserializing a response 238 _spec_property_naming (bool): True if the variable names in the input data 239 are serialized names, as specified in the OpenAPI document. 240 False if the variable names in the input data 241 are pythonic names, e.g. snake case (default) 242 _configuration (Configuration): the instance to use when 243 deserializing a file_type parameter. 244 If passed, type conversion is attempted 245 If omitted no type conversion is done. 246 _visited_composed_classes (tuple): This stores a tuple of 247 classes that we have traveled through so that 248 if we see that class again we will not use its 249 discriminator again. 250 When traveling through a discriminator, the 251 composed schema that is 252 is traveled through is added to this set. 253 For example if Animal has a discriminator 254 petType and we pass in "Dog", and the class Dog 255 allOf includes Animal, we move through Animal 256 once using the discriminator, and pick Dog. 257 Then in Dog, we will make an instance of the 258 Animal class but this time we won't travel 259 through its discriminator because we passed in 260 _visited_composed_classes = (Animal,) 261 sparse_values (SparseValues): This is the sparse data of the vector to update [optional] # noqa: E501 262 metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): This is the metadata included in the request.. [optional] # noqa: E501 263 """ 264 265 _check_type = kwargs.pop("_check_type", True) 266 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 267 _path_to_item = kwargs.pop("_path_to_item", ()) 268 _configuration = kwargs.pop("_configuration", None) 269 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 270 271 if args: 272 raise ApiTypeError( 273 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 274 % ( 275 args, 276 self.__class__.__name__, 277 ), 278 path_to_item=_path_to_item, 279 valid_classes=(self.__class__,), 280 ) 281 282 self._data_store = {} 283 self._check_type = _check_type 284 self._spec_property_naming = _spec_property_naming 285 self._path_to_item = _path_to_item 286 self._configuration = _configuration 287 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 288 289 self.id = id 290 self.values = values 291 for var_name, var_value in kwargs.items(): 292 if ( 293 var_name not in self.attribute_map 294 and self._configuration is not None 295 and self._configuration.discard_unknown_keys 296 and self.additional_properties_type is None 297 ): 298 # discard variable. 299 continue 300 setattr(self, var_name, var_value) 301 if var_name in self.read_only_vars: 302 raise ApiAttributeError( 303 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 304 f"class with read only attributes." 305 )
40class Vector(ModelNormal): 41 """NOTE: This class is auto generated by OpenAPI Generator. 42 Ref: https://openapi-generator.tech 43 44 Do not edit the class manually. 45 46 Attributes: 47 allowed_values (dict): The key is the tuple path to the attribute 48 and the for var_name this is (var_name,). The value is a dict 49 with a capitalized key describing the allowed value and an allowed 50 value. These dicts store the allowed enum values. 51 attribute_map (dict): The key is attribute name 52 and the value is json key in definition. 53 discriminator_value_class_map (dict): A dict to go from the discriminator 54 variable value to the discriminator class name. 55 validations (dict): The key is the tuple path to the attribute 56 and the for var_name this is (var_name,). The value is a dict 57 that stores validations for max_length, min_length, max_items, 58 min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, 59 inclusive_minimum, and regex. 60 additional_properties_type (tuple): A tuple of classes accepted 61 as additional properties values. 62 """ 63 64 allowed_values = {} 65 66 validations = { 67 ("id",): { 68 "max_length": 512, 69 "min_length": 1, 70 }, 71 ("values",): {}, 72 } 73 74 @cached_property 75 def additional_properties_type(): 76 """ 77 This must be a method because a model may have properties that are 78 of type self, this must run after the class is loaded 79 """ 80 lazy_import() 81 return ( 82 bool, 83 date, 84 datetime, 85 dict, 86 float, 87 int, 88 list, 89 str, 90 none_type, 91 ) # noqa: E501 92 93 _nullable = False 94 95 @cached_property 96 def openapi_types(): 97 """ 98 This must be a method because a model may have properties that are 99 of type self, this must run after the class is loaded 100 101 Returns 102 openapi_types (dict): The key is attribute name 103 and the value is attribute type. 104 """ 105 lazy_import() 106 return { 107 "id": (str,), # noqa: E501 108 "values": ([float],), # noqa: E501 109 "sparse_values": (SparseValues,), # noqa: E501 110 "metadata": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 111 } 112 113 @cached_property 114 def discriminator(): 115 return None 116 117 attribute_map = { 118 "id": "id", # noqa: E501 119 "values": "values", # noqa: E501 120 "sparse_values": "sparseValues", # noqa: E501 121 "metadata": "metadata", # noqa: E501 122 } 123 124 read_only_vars = {} 125 126 _composed_schemas = {} 127 128 @classmethod 129 @convert_js_args_to_python_args 130 def _from_openapi_data(cls, id, values, *args, **kwargs): # noqa: E501 131 """Vector - a model defined in OpenAPI 132 133 Args: 134 id (str): This is the vector's unique id. 135 values ([float]): This is the vector data included in the request. 136 137 Keyword Args: 138 _check_type (bool): if True, values for parameters in openapi_types 139 will be type checked and a TypeError will be 140 raised if the wrong type is input. 141 Defaults to True 142 _path_to_item (tuple/list): This is a list of keys or values to 143 drill down to the model in received_data 144 when deserializing a response 145 _spec_property_naming (bool): True if the variable names in the input data 146 are serialized names, as specified in the OpenAPI document. 147 False if the variable names in the input data 148 are pythonic names, e.g. snake case (default) 149 _configuration (Configuration): the instance to use when 150 deserializing a file_type parameter. 151 If passed, type conversion is attempted 152 If omitted no type conversion is done. 153 _visited_composed_classes (tuple): This stores a tuple of 154 classes that we have traveled through so that 155 if we see that class again we will not use its 156 discriminator again. 157 When traveling through a discriminator, the 158 composed schema that is 159 is traveled through is added to this set. 160 For example if Animal has a discriminator 161 petType and we pass in "Dog", and the class Dog 162 allOf includes Animal, we move through Animal 163 once using the discriminator, and pick Dog. 164 Then in Dog, we will make an instance of the 165 Animal class but this time we won't travel 166 through its discriminator because we passed in 167 _visited_composed_classes = (Animal,) 168 sparse_values (SparseValues): the sparse data of the returned vector [optional] # noqa: E501 169 metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): This is the metadata included in the request.. [optional] # noqa: E501 170 """ 171 172 _check_type = kwargs.pop("_check_type", True) 173 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 174 _path_to_item = kwargs.pop("_path_to_item", ()) 175 _configuration = kwargs.pop("_configuration", None) 176 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 177 178 self = super(OpenApiModel, cls).__new__(cls) 179 180 if args: 181 raise ApiTypeError( 182 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 183 % ( 184 args, 185 self.__class__.__name__, 186 ), 187 path_to_item=_path_to_item, 188 valid_classes=(self.__class__,), 189 ) 190 191 self._data_store = {} 192 self._check_type = _check_type 193 self._spec_property_naming = _spec_property_naming 194 self._path_to_item = _path_to_item 195 self._configuration = _configuration 196 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 197 198 self.id = id 199 self.values = values 200 for var_name, var_value in kwargs.items(): 201 if ( 202 var_name not in self.attribute_map 203 and self._configuration is not None 204 and self._configuration.discard_unknown_keys 205 and self.additional_properties_type is None 206 ): 207 # discard variable. 208 continue 209 setattr(self, var_name, var_value) 210 return self 211 212 required_properties = set( 213 [ 214 "_data_store", 215 "_check_type", 216 "_spec_property_naming", 217 "_path_to_item", 218 "_configuration", 219 "_visited_composed_classes", 220 ] 221 ) 222 223 @convert_js_args_to_python_args 224 def __init__(self, id, values, *args, **kwargs): # noqa: E501 225 """Vector - a model defined in OpenAPI 226 227 Args: 228 id (str): This is the vector's unique id. 229 values ([float]): This is the vector data included in the request. 230 231 Keyword Args: 232 _check_type (bool): if True, values for parameters in openapi_types 233 will be type checked and a TypeError will be 234 raised if the wrong type is input. 235 Defaults to True 236 _path_to_item (tuple/list): This is a list of keys or values to 237 drill down to the model in received_data 238 when deserializing a response 239 _spec_property_naming (bool): True if the variable names in the input data 240 are serialized names, as specified in the OpenAPI document. 241 False if the variable names in the input data 242 are pythonic names, e.g. snake case (default) 243 _configuration (Configuration): the instance to use when 244 deserializing a file_type parameter. 245 If passed, type conversion is attempted 246 If omitted no type conversion is done. 247 _visited_composed_classes (tuple): This stores a tuple of 248 classes that we have traveled through so that 249 if we see that class again we will not use its 250 discriminator again. 251 When traveling through a discriminator, the 252 composed schema that is 253 is traveled through is added to this set. 254 For example if Animal has a discriminator 255 petType and we pass in "Dog", and the class Dog 256 allOf includes Animal, we move through Animal 257 once using the discriminator, and pick Dog. 258 Then in Dog, we will make an instance of the 259 Animal class but this time we won't travel 260 through its discriminator because we passed in 261 _visited_composed_classes = (Animal,) 262 sparse_values (SparseValues): This is the sparse data of the vector to update [optional] # noqa: E501 263 metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): This is the metadata included in the request.. [optional] # noqa: E501 264 """ 265 266 _check_type = kwargs.pop("_check_type", True) 267 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 268 _path_to_item = kwargs.pop("_path_to_item", ()) 269 _configuration = kwargs.pop("_configuration", None) 270 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 271 272 if args: 273 raise ApiTypeError( 274 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 275 % ( 276 args, 277 self.__class__.__name__, 278 ), 279 path_to_item=_path_to_item, 280 valid_classes=(self.__class__,), 281 ) 282 283 self._data_store = {} 284 self._check_type = _check_type 285 self._spec_property_naming = _spec_property_naming 286 self._path_to_item = _path_to_item 287 self._configuration = _configuration 288 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 289 290 self.id = id 291 self.values = values 292 for var_name, var_value in kwargs.items(): 293 if ( 294 var_name not in self.attribute_map 295 and self._configuration is not None 296 and self._configuration.discard_unknown_keys 297 and self.additional_properties_type is None 298 ): 299 # discard variable. 300 continue 301 setattr(self, var_name, var_value) 302 if var_name in self.read_only_vars: 303 raise ApiAttributeError( 304 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 305 f"class with read only attributes." 306 )
NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech
Do not edit the class manually.
Attributes:
- allowed_values (dict): The key is the tuple path to the attribute and the for var_name this is (var_name,). The value is a dict with a capitalized key describing the allowed value and an allowed value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute and the for var_name this is (var_name,). The value is a dict that stores validations for max_length, min_length, max_items, min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted as additional properties values.
223 @convert_js_args_to_python_args 224 def __init__(self, id, values, *args, **kwargs): # noqa: E501 225 """Vector - a model defined in OpenAPI 226 227 Args: 228 id (str): This is the vector's unique id. 229 values ([float]): This is the vector data included in the request. 230 231 Keyword Args: 232 _check_type (bool): if True, values for parameters in openapi_types 233 will be type checked and a TypeError will be 234 raised if the wrong type is input. 235 Defaults to True 236 _path_to_item (tuple/list): This is a list of keys or values to 237 drill down to the model in received_data 238 when deserializing a response 239 _spec_property_naming (bool): True if the variable names in the input data 240 are serialized names, as specified in the OpenAPI document. 241 False if the variable names in the input data 242 are pythonic names, e.g. snake case (default) 243 _configuration (Configuration): the instance to use when 244 deserializing a file_type parameter. 245 If passed, type conversion is attempted 246 If omitted no type conversion is done. 247 _visited_composed_classes (tuple): This stores a tuple of 248 classes that we have traveled through so that 249 if we see that class again we will not use its 250 discriminator again. 251 When traveling through a discriminator, the 252 composed schema that is 253 is traveled through is added to this set. 254 For example if Animal has a discriminator 255 petType and we pass in "Dog", and the class Dog 256 allOf includes Animal, we move through Animal 257 once using the discriminator, and pick Dog. 258 Then in Dog, we will make an instance of the 259 Animal class but this time we won't travel 260 through its discriminator because we passed in 261 _visited_composed_classes = (Animal,) 262 sparse_values (SparseValues): This is the sparse data of the vector to update [optional] # noqa: E501 263 metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): This is the metadata included in the request.. [optional] # noqa: E501 264 """ 265 266 _check_type = kwargs.pop("_check_type", True) 267 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 268 _path_to_item = kwargs.pop("_path_to_item", ()) 269 _configuration = kwargs.pop("_configuration", None) 270 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 271 272 if args: 273 raise ApiTypeError( 274 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 275 % ( 276 args, 277 self.__class__.__name__, 278 ), 279 path_to_item=_path_to_item, 280 valid_classes=(self.__class__,), 281 ) 282 283 self._data_store = {} 284 self._check_type = _check_type 285 self._spec_property_naming = _spec_property_naming 286 self._path_to_item = _path_to_item 287 self._configuration = _configuration 288 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 289 290 self.id = id 291 self.values = values 292 for var_name, var_value in kwargs.items(): 293 if ( 294 var_name not in self.attribute_map 295 and self._configuration is not None 296 and self._configuration.discard_unknown_keys 297 and self.additional_properties_type is None 298 ): 299 # discard variable. 300 continue 301 setattr(self, var_name, var_value) 302 if var_name in self.read_only_vars: 303 raise ApiAttributeError( 304 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 305 f"class with read only attributes." 306 )
Vector - a model defined in OpenAPI
Arguments:
- id (str): This is the vector's unique id.
- values ([float]): This is the vector data included in the request.
Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. Defaults to True _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted If omitted no type conversion is done. _visited_composed_classes (tuple): This stores a tuple of classes that we have traveled through so that if we see that class again we will not use its discriminator again. When traveling through a discriminator, the composed schema that is is traveled through is added to this set. For example if Animal has a discriminator petType and we pass in "Dog", and the class Dog allOf includes Animal, we move through Animal once using the discriminator, and pick Dog. Then in Dog, we will make an instance of the Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) sparse_values (SparseValues): This is the sparse data of the vector to update [optional] # noqa: E501 metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): This is the metadata included in the request.. [optional] # noqa: E501
This must be a method because a model may have properties that are of type self, this must run after the class is loaded
This must be a method because a model may have properties that are of type self, this must run after the class is loaded
Returns openapi_types (dict): The key is attribute name and the value is attribute type.