pinecone.core.client.model.upsert_request
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.vector import Vector 35 36 globals()["Vector"] = Vector 37 38 39class UpsertRequest(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 ("vectors",): {}, 67 } 68 69 @cached_property 70 def additional_properties_type(): 71 """ 72 This must be a method because a model may have properties that are 73 of type self, this must run after the class is loaded 74 """ 75 lazy_import() 76 return ( 77 bool, 78 date, 79 datetime, 80 dict, 81 float, 82 int, 83 list, 84 str, 85 none_type, 86 ) # noqa: E501 87 88 _nullable = False 89 90 @cached_property 91 def openapi_types(): 92 """ 93 This must be a method because a model may have properties that are 94 of type self, this must run after the class is loaded 95 96 Returns 97 openapi_types (dict): The key is attribute name 98 and the value is attribute type. 99 """ 100 lazy_import() 101 return { 102 "vectors": ([Vector],), # noqa: E501 103 "namespace": (str,), # noqa: E501 104 } 105 106 @cached_property 107 def discriminator(): 108 return None 109 110 attribute_map = { 111 "vectors": "vectors", # noqa: E501 112 "namespace": "namespace", # noqa: E501 113 } 114 115 read_only_vars = {} 116 117 _composed_schemas = {} 118 119 @classmethod 120 @convert_js_args_to_python_args 121 def _from_openapi_data(cls, vectors, *args, **kwargs): # noqa: E501 122 """UpsertRequest - a model defined in OpenAPI 123 124 Args: 125 vectors ([Vector]): An array containing the vectors to upsert. Recommended batch limit is 100 vectors. 126 127 Keyword Args: 128 _check_type (bool): if True, values for parameters in openapi_types 129 will be type checked and a TypeError will be 130 raised if the wrong type is input. 131 Defaults to True 132 _path_to_item (tuple/list): This is a list of keys or values to 133 drill down to the model in received_data 134 when deserializing a response 135 _spec_property_naming (bool): True if the variable names in the input data 136 are serialized names, as specified in the OpenAPI document. 137 False if the variable names in the input data 138 are pythonic names, e.g. snake case (default) 139 _configuration (Configuration): the instance to use when 140 deserializing a file_type parameter. 141 If passed, type conversion is attempted 142 If omitted no type conversion is done. 143 _visited_composed_classes (tuple): This stores a tuple of 144 classes that we have traveled through so that 145 if we see that class again we will not use its 146 discriminator again. 147 When traveling through a discriminator, the 148 composed schema that is 149 is traveled through is added to this set. 150 For example if Animal has a discriminator 151 petType and we pass in "Dog", and the class Dog 152 allOf includes Animal, we move through Animal 153 once using the discriminator, and pick Dog. 154 Then in Dog, we will make an instance of the 155 Animal class but this time we won't travel 156 through its discriminator because we passed in 157 _visited_composed_classes = (Animal,) 158 namespace (str): This is the namespace name where you upsert vectors.. [optional] # noqa: E501 159 """ 160 161 _check_type = kwargs.pop("_check_type", True) 162 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 163 _path_to_item = kwargs.pop("_path_to_item", ()) 164 _configuration = kwargs.pop("_configuration", None) 165 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 166 167 self = super(OpenApiModel, cls).__new__(cls) 168 169 if args: 170 raise ApiTypeError( 171 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 172 % ( 173 args, 174 self.__class__.__name__, 175 ), 176 path_to_item=_path_to_item, 177 valid_classes=(self.__class__,), 178 ) 179 180 self._data_store = {} 181 self._check_type = _check_type 182 self._spec_property_naming = _spec_property_naming 183 self._path_to_item = _path_to_item 184 self._configuration = _configuration 185 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 186 187 self.vectors = vectors 188 for var_name, var_value in kwargs.items(): 189 if ( 190 var_name not in self.attribute_map 191 and self._configuration is not None 192 and self._configuration.discard_unknown_keys 193 and self.additional_properties_type is None 194 ): 195 # discard variable. 196 continue 197 setattr(self, var_name, var_value) 198 return self 199 200 required_properties = set( 201 [ 202 "_data_store", 203 "_check_type", 204 "_spec_property_naming", 205 "_path_to_item", 206 "_configuration", 207 "_visited_composed_classes", 208 ] 209 ) 210 211 @convert_js_args_to_python_args 212 def __init__(self, vectors, *args, **kwargs): # noqa: E501 213 """UpsertRequest - a model defined in OpenAPI 214 215 Args: 216 vectors ([Vector]): An array containing the vectors to upsert. Recommended batch limit is 100 vectors. 217 218 Keyword Args: 219 _check_type (bool): if True, values for parameters in openapi_types 220 will be type checked and a TypeError will be 221 raised if the wrong type is input. 222 Defaults to True 223 _path_to_item (tuple/list): This is a list of keys or values to 224 drill down to the model in received_data 225 when deserializing a response 226 _spec_property_naming (bool): True if the variable names in the input data 227 are serialized names, as specified in the OpenAPI document. 228 False if the variable names in the input data 229 are pythonic names, e.g. snake case (default) 230 _configuration (Configuration): the instance to use when 231 deserializing a file_type parameter. 232 If passed, type conversion is attempted 233 If omitted no type conversion is done. 234 _visited_composed_classes (tuple): This stores a tuple of 235 classes that we have traveled through so that 236 if we see that class again we will not use its 237 discriminator again. 238 When traveling through a discriminator, the 239 composed schema that is 240 is traveled through is added to this set. 241 For example if Animal has a discriminator 242 petType and we pass in "Dog", and the class Dog 243 allOf includes Animal, we move through Animal 244 once using the discriminator, and pick Dog. 245 Then in Dog, we will make an instance of the 246 Animal class but this time we won't travel 247 through its discriminator because we passed in 248 _visited_composed_classes = (Animal,) 249 namespace (str): This is the namespace name where you upsert vectors.. [optional] # noqa: E501 250 """ 251 252 _check_type = kwargs.pop("_check_type", True) 253 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 254 _path_to_item = kwargs.pop("_path_to_item", ()) 255 _configuration = kwargs.pop("_configuration", None) 256 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 257 258 if args: 259 raise ApiTypeError( 260 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 261 % ( 262 args, 263 self.__class__.__name__, 264 ), 265 path_to_item=_path_to_item, 266 valid_classes=(self.__class__,), 267 ) 268 269 self._data_store = {} 270 self._check_type = _check_type 271 self._spec_property_naming = _spec_property_naming 272 self._path_to_item = _path_to_item 273 self._configuration = _configuration 274 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 275 276 self.vectors = vectors 277 for var_name, var_value in kwargs.items(): 278 if ( 279 var_name not in self.attribute_map 280 and self._configuration is not None 281 and self._configuration.discard_unknown_keys 282 and self.additional_properties_type is None 283 ): 284 # discard variable. 285 continue 286 setattr(self, var_name, var_value) 287 if var_name in self.read_only_vars: 288 raise ApiAttributeError( 289 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 290 f"class with read only attributes." 291 )
40class UpsertRequest(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 ("vectors",): {}, 68 } 69 70 @cached_property 71 def additional_properties_type(): 72 """ 73 This must be a method because a model may have properties that are 74 of type self, this must run after the class is loaded 75 """ 76 lazy_import() 77 return ( 78 bool, 79 date, 80 datetime, 81 dict, 82 float, 83 int, 84 list, 85 str, 86 none_type, 87 ) # noqa: E501 88 89 _nullable = False 90 91 @cached_property 92 def openapi_types(): 93 """ 94 This must be a method because a model may have properties that are 95 of type self, this must run after the class is loaded 96 97 Returns 98 openapi_types (dict): The key is attribute name 99 and the value is attribute type. 100 """ 101 lazy_import() 102 return { 103 "vectors": ([Vector],), # noqa: E501 104 "namespace": (str,), # noqa: E501 105 } 106 107 @cached_property 108 def discriminator(): 109 return None 110 111 attribute_map = { 112 "vectors": "vectors", # noqa: E501 113 "namespace": "namespace", # noqa: E501 114 } 115 116 read_only_vars = {} 117 118 _composed_schemas = {} 119 120 @classmethod 121 @convert_js_args_to_python_args 122 def _from_openapi_data(cls, vectors, *args, **kwargs): # noqa: E501 123 """UpsertRequest - a model defined in OpenAPI 124 125 Args: 126 vectors ([Vector]): An array containing the vectors to upsert. Recommended batch limit is 100 vectors. 127 128 Keyword Args: 129 _check_type (bool): if True, values for parameters in openapi_types 130 will be type checked and a TypeError will be 131 raised if the wrong type is input. 132 Defaults to True 133 _path_to_item (tuple/list): This is a list of keys or values to 134 drill down to the model in received_data 135 when deserializing a response 136 _spec_property_naming (bool): True if the variable names in the input data 137 are serialized names, as specified in the OpenAPI document. 138 False if the variable names in the input data 139 are pythonic names, e.g. snake case (default) 140 _configuration (Configuration): the instance to use when 141 deserializing a file_type parameter. 142 If passed, type conversion is attempted 143 If omitted no type conversion is done. 144 _visited_composed_classes (tuple): This stores a tuple of 145 classes that we have traveled through so that 146 if we see that class again we will not use its 147 discriminator again. 148 When traveling through a discriminator, the 149 composed schema that is 150 is traveled through is added to this set. 151 For example if Animal has a discriminator 152 petType and we pass in "Dog", and the class Dog 153 allOf includes Animal, we move through Animal 154 once using the discriminator, and pick Dog. 155 Then in Dog, we will make an instance of the 156 Animal class but this time we won't travel 157 through its discriminator because we passed in 158 _visited_composed_classes = (Animal,) 159 namespace (str): This is the namespace name where you upsert vectors.. [optional] # noqa: E501 160 """ 161 162 _check_type = kwargs.pop("_check_type", True) 163 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 164 _path_to_item = kwargs.pop("_path_to_item", ()) 165 _configuration = kwargs.pop("_configuration", None) 166 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 167 168 self = super(OpenApiModel, cls).__new__(cls) 169 170 if args: 171 raise ApiTypeError( 172 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 173 % ( 174 args, 175 self.__class__.__name__, 176 ), 177 path_to_item=_path_to_item, 178 valid_classes=(self.__class__,), 179 ) 180 181 self._data_store = {} 182 self._check_type = _check_type 183 self._spec_property_naming = _spec_property_naming 184 self._path_to_item = _path_to_item 185 self._configuration = _configuration 186 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 187 188 self.vectors = vectors 189 for var_name, var_value in kwargs.items(): 190 if ( 191 var_name not in self.attribute_map 192 and self._configuration is not None 193 and self._configuration.discard_unknown_keys 194 and self.additional_properties_type is None 195 ): 196 # discard variable. 197 continue 198 setattr(self, var_name, var_value) 199 return self 200 201 required_properties = set( 202 [ 203 "_data_store", 204 "_check_type", 205 "_spec_property_naming", 206 "_path_to_item", 207 "_configuration", 208 "_visited_composed_classes", 209 ] 210 ) 211 212 @convert_js_args_to_python_args 213 def __init__(self, vectors, *args, **kwargs): # noqa: E501 214 """UpsertRequest - a model defined in OpenAPI 215 216 Args: 217 vectors ([Vector]): An array containing the vectors to upsert. Recommended batch limit is 100 vectors. 218 219 Keyword Args: 220 _check_type (bool): if True, values for parameters in openapi_types 221 will be type checked and a TypeError will be 222 raised if the wrong type is input. 223 Defaults to True 224 _path_to_item (tuple/list): This is a list of keys or values to 225 drill down to the model in received_data 226 when deserializing a response 227 _spec_property_naming (bool): True if the variable names in the input data 228 are serialized names, as specified in the OpenAPI document. 229 False if the variable names in the input data 230 are pythonic names, e.g. snake case (default) 231 _configuration (Configuration): the instance to use when 232 deserializing a file_type parameter. 233 If passed, type conversion is attempted 234 If omitted no type conversion is done. 235 _visited_composed_classes (tuple): This stores a tuple of 236 classes that we have traveled through so that 237 if we see that class again we will not use its 238 discriminator again. 239 When traveling through a discriminator, the 240 composed schema that is 241 is traveled through is added to this set. 242 For example if Animal has a discriminator 243 petType and we pass in "Dog", and the class Dog 244 allOf includes Animal, we move through Animal 245 once using the discriminator, and pick Dog. 246 Then in Dog, we will make an instance of the 247 Animal class but this time we won't travel 248 through its discriminator because we passed in 249 _visited_composed_classes = (Animal,) 250 namespace (str): This is the namespace name where you upsert vectors.. [optional] # noqa: E501 251 """ 252 253 _check_type = kwargs.pop("_check_type", True) 254 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 255 _path_to_item = kwargs.pop("_path_to_item", ()) 256 _configuration = kwargs.pop("_configuration", None) 257 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 258 259 if args: 260 raise ApiTypeError( 261 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 262 % ( 263 args, 264 self.__class__.__name__, 265 ), 266 path_to_item=_path_to_item, 267 valid_classes=(self.__class__,), 268 ) 269 270 self._data_store = {} 271 self._check_type = _check_type 272 self._spec_property_naming = _spec_property_naming 273 self._path_to_item = _path_to_item 274 self._configuration = _configuration 275 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 276 277 self.vectors = vectors 278 for var_name, var_value in kwargs.items(): 279 if ( 280 var_name not in self.attribute_map 281 and self._configuration is not None 282 and self._configuration.discard_unknown_keys 283 and self.additional_properties_type is None 284 ): 285 # discard variable. 286 continue 287 setattr(self, var_name, var_value) 288 if var_name in self.read_only_vars: 289 raise ApiAttributeError( 290 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 291 f"class with read only attributes." 292 )
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.
212 @convert_js_args_to_python_args 213 def __init__(self, vectors, *args, **kwargs): # noqa: E501 214 """UpsertRequest - a model defined in OpenAPI 215 216 Args: 217 vectors ([Vector]): An array containing the vectors to upsert. Recommended batch limit is 100 vectors. 218 219 Keyword Args: 220 _check_type (bool): if True, values for parameters in openapi_types 221 will be type checked and a TypeError will be 222 raised if the wrong type is input. 223 Defaults to True 224 _path_to_item (tuple/list): This is a list of keys or values to 225 drill down to the model in received_data 226 when deserializing a response 227 _spec_property_naming (bool): True if the variable names in the input data 228 are serialized names, as specified in the OpenAPI document. 229 False if the variable names in the input data 230 are pythonic names, e.g. snake case (default) 231 _configuration (Configuration): the instance to use when 232 deserializing a file_type parameter. 233 If passed, type conversion is attempted 234 If omitted no type conversion is done. 235 _visited_composed_classes (tuple): This stores a tuple of 236 classes that we have traveled through so that 237 if we see that class again we will not use its 238 discriminator again. 239 When traveling through a discriminator, the 240 composed schema that is 241 is traveled through is added to this set. 242 For example if Animal has a discriminator 243 petType and we pass in "Dog", and the class Dog 244 allOf includes Animal, we move through Animal 245 once using the discriminator, and pick Dog. 246 Then in Dog, we will make an instance of the 247 Animal class but this time we won't travel 248 through its discriminator because we passed in 249 _visited_composed_classes = (Animal,) 250 namespace (str): This is the namespace name where you upsert vectors.. [optional] # noqa: E501 251 """ 252 253 _check_type = kwargs.pop("_check_type", True) 254 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 255 _path_to_item = kwargs.pop("_path_to_item", ()) 256 _configuration = kwargs.pop("_configuration", None) 257 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 258 259 if args: 260 raise ApiTypeError( 261 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 262 % ( 263 args, 264 self.__class__.__name__, 265 ), 266 path_to_item=_path_to_item, 267 valid_classes=(self.__class__,), 268 ) 269 270 self._data_store = {} 271 self._check_type = _check_type 272 self._spec_property_naming = _spec_property_naming 273 self._path_to_item = _path_to_item 274 self._configuration = _configuration 275 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 276 277 self.vectors = vectors 278 for var_name, var_value in kwargs.items(): 279 if ( 280 var_name not in self.attribute_map 281 and self._configuration is not None 282 and self._configuration.discard_unknown_keys 283 and self.additional_properties_type is None 284 ): 285 # discard variable. 286 continue 287 setattr(self, var_name, var_value) 288 if var_name in self.read_only_vars: 289 raise ApiAttributeError( 290 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 291 f"class with read only attributes." 292 )
UpsertRequest - a model defined in OpenAPI
Arguments:
- vectors ([Vector]): An array containing the vectors to upsert. Recommended batch limit is 100 vectors.
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,) namespace (str): This is the namespace name where you upsert vectors.. [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.