pinecone.core.client.model.query_response
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.scored_vector import ScoredVector 35 from pinecone.core.client.model.single_query_results import SingleQueryResults 36 37 globals()["ScoredVector"] = ScoredVector 38 globals()["SingleQueryResults"] = SingleQueryResults 39 40 41class QueryResponse(ModelNormal): 42 """NOTE: This class is auto generated by OpenAPI Generator. 43 Ref: https://openapi-generator.tech 44 45 Do not edit the class manually. 46 47 Attributes: 48 allowed_values (dict): The key is the tuple path to the attribute 49 and the for var_name this is (var_name,). The value is a dict 50 with a capitalized key describing the allowed value and an allowed 51 value. These dicts store the allowed enum values. 52 attribute_map (dict): The key is attribute name 53 and the value is json key in definition. 54 discriminator_value_class_map (dict): A dict to go from the discriminator 55 variable value to the discriminator class name. 56 validations (dict): The key is the tuple path to the attribute 57 and the for var_name this is (var_name,). The value is a dict 58 that stores validations for max_length, min_length, max_items, 59 min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, 60 inclusive_minimum, and regex. 61 additional_properties_type (tuple): A tuple of classes accepted 62 as additional properties values. 63 """ 64 65 allowed_values = {} 66 67 validations = {} 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 "results": ([SingleQueryResults],), # noqa: E501 103 "matches": ([ScoredVector],), # noqa: E501 104 "namespace": (str,), # noqa: E501 105 } 106 107 @cached_property 108 def discriminator(): 109 return None 110 111 attribute_map = { 112 "results": "results", # noqa: E501 113 "matches": "matches", # noqa: E501 114 "namespace": "namespace", # noqa: E501 115 } 116 117 read_only_vars = {} 118 119 _composed_schemas = {} 120 121 @classmethod 122 @convert_js_args_to_python_args 123 def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 124 """QueryResponse - a model defined in OpenAPI 125 126 Keyword Args: 127 _check_type (bool): if True, values for parameters in openapi_types 128 will be type checked and a TypeError will be 129 raised if the wrong type is input. 130 Defaults to True 131 _path_to_item (tuple/list): This is a list of keys or values to 132 drill down to the model in received_data 133 when deserializing a response 134 _spec_property_naming (bool): True if the variable names in the input data 135 are serialized names, as specified in the OpenAPI document. 136 False if the variable names in the input data 137 are pythonic names, e.g. snake case (default) 138 _configuration (Configuration): the instance to use when 139 deserializing a file_type parameter. 140 If passed, type conversion is attempted 141 If omitted no type conversion is done. 142 _visited_composed_classes (tuple): This stores a tuple of 143 classes that we have traveled through so that 144 if we see that class again we will not use its 145 discriminator again. 146 When traveling through a discriminator, the 147 composed schema that is 148 is traveled through is added to this set. 149 For example if Animal has a discriminator 150 petType and we pass in "Dog", and the class Dog 151 allOf includes Animal, we move through Animal 152 once using the discriminator, and pick Dog. 153 Then in Dog, we will make an instance of the 154 Animal class but this time we won't travel 155 through its discriminator because we passed in 156 _visited_composed_classes = (Animal,) 157 results ([SingleQueryResults]): DEPRECATED. The results of each query. The order is the same as `QueryRequest.queries`.. [optional] # noqa: E501 158 matches ([ScoredVector]): The matches for the vectors.. [optional] # noqa: E501 159 namespace (str): The namespace for the 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 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, *args, **kwargs): # noqa: E501 213 """QueryResponse - a model defined in OpenAPI 214 215 Keyword Args: 216 _check_type (bool): if True, values for parameters in openapi_types 217 will be type checked and a TypeError will be 218 raised if the wrong type is input. 219 Defaults to True 220 _path_to_item (tuple/list): This is a list of keys or values to 221 drill down to the model in received_data 222 when deserializing a response 223 _spec_property_naming (bool): True if the variable names in the input data 224 are serialized names, as specified in the OpenAPI document. 225 False if the variable names in the input data 226 are pythonic names, e.g. snake case (default) 227 _configuration (Configuration): the instance to use when 228 deserializing a file_type parameter. 229 If passed, type conversion is attempted 230 If omitted no type conversion is done. 231 _visited_composed_classes (tuple): This stores a tuple of 232 classes that we have traveled through so that 233 if we see that class again we will not use its 234 discriminator again. 235 When traveling through a discriminator, the 236 composed schema that is 237 is traveled through is added to this set. 238 For example if Animal has a discriminator 239 petType and we pass in "Dog", and the class Dog 240 allOf includes Animal, we move through Animal 241 once using the discriminator, and pick Dog. 242 Then in Dog, we will make an instance of the 243 Animal class but this time we won't travel 244 through its discriminator because we passed in 245 _visited_composed_classes = (Animal,) 246 results ([SingleQueryResults]): DEPRECATED. The results of each query. The order is the same as `QueryRequest.queries`.. [optional] # noqa: E501 247 matches ([ScoredVector]): The matches for the vectors.. [optional] # noqa: E501 248 namespace (str): The namespace for the vectors.. [optional] # noqa: E501 249 """ 250 251 _check_type = kwargs.pop("_check_type", True) 252 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 253 _path_to_item = kwargs.pop("_path_to_item", ()) 254 _configuration = kwargs.pop("_configuration", None) 255 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 256 257 if args: 258 raise ApiTypeError( 259 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 260 % ( 261 args, 262 self.__class__.__name__, 263 ), 264 path_to_item=_path_to_item, 265 valid_classes=(self.__class__,), 266 ) 267 268 self._data_store = {} 269 self._check_type = _check_type 270 self._spec_property_naming = _spec_property_naming 271 self._path_to_item = _path_to_item 272 self._configuration = _configuration 273 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 274 275 for var_name, var_value in kwargs.items(): 276 if ( 277 var_name not in self.attribute_map 278 and self._configuration is not None 279 and self._configuration.discard_unknown_keys 280 and self.additional_properties_type is None 281 ): 282 # discard variable. 283 continue 284 setattr(self, var_name, var_value) 285 if var_name in self.read_only_vars: 286 raise ApiAttributeError( 287 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 288 f"class with read only attributes." 289 )
42class QueryResponse(ModelNormal): 43 """NOTE: This class is auto generated by OpenAPI Generator. 44 Ref: https://openapi-generator.tech 45 46 Do not edit the class manually. 47 48 Attributes: 49 allowed_values (dict): The key is the tuple path to the attribute 50 and the for var_name this is (var_name,). The value is a dict 51 with a capitalized key describing the allowed value and an allowed 52 value. These dicts store the allowed enum values. 53 attribute_map (dict): The key is attribute name 54 and the value is json key in definition. 55 discriminator_value_class_map (dict): A dict to go from the discriminator 56 variable value to the discriminator class name. 57 validations (dict): The key is the tuple path to the attribute 58 and the for var_name this is (var_name,). The value is a dict 59 that stores validations for max_length, min_length, max_items, 60 min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, 61 inclusive_minimum, and regex. 62 additional_properties_type (tuple): A tuple of classes accepted 63 as additional properties values. 64 """ 65 66 allowed_values = {} 67 68 validations = {} 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 "results": ([SingleQueryResults],), # noqa: E501 104 "matches": ([ScoredVector],), # noqa: E501 105 "namespace": (str,), # noqa: E501 106 } 107 108 @cached_property 109 def discriminator(): 110 return None 111 112 attribute_map = { 113 "results": "results", # noqa: E501 114 "matches": "matches", # noqa: E501 115 "namespace": "namespace", # noqa: E501 116 } 117 118 read_only_vars = {} 119 120 _composed_schemas = {} 121 122 @classmethod 123 @convert_js_args_to_python_args 124 def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 125 """QueryResponse - a model defined in OpenAPI 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 results ([SingleQueryResults]): DEPRECATED. The results of each query. The order is the same as `QueryRequest.queries`.. [optional] # noqa: E501 159 matches ([ScoredVector]): The matches for the vectors.. [optional] # noqa: E501 160 namespace (str): The namespace for the vectors.. [optional] # noqa: E501 161 """ 162 163 _check_type = kwargs.pop("_check_type", True) 164 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 165 _path_to_item = kwargs.pop("_path_to_item", ()) 166 _configuration = kwargs.pop("_configuration", None) 167 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 168 169 self = super(OpenApiModel, cls).__new__(cls) 170 171 if args: 172 raise ApiTypeError( 173 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 174 % ( 175 args, 176 self.__class__.__name__, 177 ), 178 path_to_item=_path_to_item, 179 valid_classes=(self.__class__,), 180 ) 181 182 self._data_store = {} 183 self._check_type = _check_type 184 self._spec_property_naming = _spec_property_naming 185 self._path_to_item = _path_to_item 186 self._configuration = _configuration 187 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 188 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, *args, **kwargs): # noqa: E501 214 """QueryResponse - a model defined in OpenAPI 215 216 Keyword Args: 217 _check_type (bool): if True, values for parameters in openapi_types 218 will be type checked and a TypeError will be 219 raised if the wrong type is input. 220 Defaults to True 221 _path_to_item (tuple/list): This is a list of keys or values to 222 drill down to the model in received_data 223 when deserializing a response 224 _spec_property_naming (bool): True if the variable names in the input data 225 are serialized names, as specified in the OpenAPI document. 226 False if the variable names in the input data 227 are pythonic names, e.g. snake case (default) 228 _configuration (Configuration): the instance to use when 229 deserializing a file_type parameter. 230 If passed, type conversion is attempted 231 If omitted no type conversion is done. 232 _visited_composed_classes (tuple): This stores a tuple of 233 classes that we have traveled through so that 234 if we see that class again we will not use its 235 discriminator again. 236 When traveling through a discriminator, the 237 composed schema that is 238 is traveled through is added to this set. 239 For example if Animal has a discriminator 240 petType and we pass in "Dog", and the class Dog 241 allOf includes Animal, we move through Animal 242 once using the discriminator, and pick Dog. 243 Then in Dog, we will make an instance of the 244 Animal class but this time we won't travel 245 through its discriminator because we passed in 246 _visited_composed_classes = (Animal,) 247 results ([SingleQueryResults]): DEPRECATED. The results of each query. The order is the same as `QueryRequest.queries`.. [optional] # noqa: E501 248 matches ([ScoredVector]): The matches for the vectors.. [optional] # noqa: E501 249 namespace (str): The namespace for the 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 for var_name, var_value in kwargs.items(): 277 if ( 278 var_name not in self.attribute_map 279 and self._configuration is not None 280 and self._configuration.discard_unknown_keys 281 and self.additional_properties_type is None 282 ): 283 # discard variable. 284 continue 285 setattr(self, var_name, var_value) 286 if var_name in self.read_only_vars: 287 raise ApiAttributeError( 288 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 289 f"class with read only attributes." 290 )
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, *args, **kwargs): # noqa: E501 214 """QueryResponse - a model defined in OpenAPI 215 216 Keyword Args: 217 _check_type (bool): if True, values for parameters in openapi_types 218 will be type checked and a TypeError will be 219 raised if the wrong type is input. 220 Defaults to True 221 _path_to_item (tuple/list): This is a list of keys or values to 222 drill down to the model in received_data 223 when deserializing a response 224 _spec_property_naming (bool): True if the variable names in the input data 225 are serialized names, as specified in the OpenAPI document. 226 False if the variable names in the input data 227 are pythonic names, e.g. snake case (default) 228 _configuration (Configuration): the instance to use when 229 deserializing a file_type parameter. 230 If passed, type conversion is attempted 231 If omitted no type conversion is done. 232 _visited_composed_classes (tuple): This stores a tuple of 233 classes that we have traveled through so that 234 if we see that class again we will not use its 235 discriminator again. 236 When traveling through a discriminator, the 237 composed schema that is 238 is traveled through is added to this set. 239 For example if Animal has a discriminator 240 petType and we pass in "Dog", and the class Dog 241 allOf includes Animal, we move through Animal 242 once using the discriminator, and pick Dog. 243 Then in Dog, we will make an instance of the 244 Animal class but this time we won't travel 245 through its discriminator because we passed in 246 _visited_composed_classes = (Animal,) 247 results ([SingleQueryResults]): DEPRECATED. The results of each query. The order is the same as `QueryRequest.queries`.. [optional] # noqa: E501 248 matches ([ScoredVector]): The matches for the vectors.. [optional] # noqa: E501 249 namespace (str): The namespace for the 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 for var_name, var_value in kwargs.items(): 277 if ( 278 var_name not in self.attribute_map 279 and self._configuration is not None 280 and self._configuration.discard_unknown_keys 281 and self.additional_properties_type is None 282 ): 283 # discard variable. 284 continue 285 setattr(self, var_name, var_value) 286 if var_name in self.read_only_vars: 287 raise ApiAttributeError( 288 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 289 f"class with read only attributes." 290 )
QueryResponse - a model defined in OpenAPI
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,) results ([SingleQueryResults]): DEPRECATED. The results of each query. The order is the same as
QueryRequest.queries.. [optional] # noqa: E501 matches ([ScoredVector]): The matches for the vectors.. [optional] # noqa: E501 namespace (str): The namespace for the 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.