pinecone.core.client.model.query_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.query_vector import QueryVector 35 from pinecone.core.client.model.sparse_values import SparseValues 36 37 globals()["QueryVector"] = QueryVector 38 globals()["SparseValues"] = SparseValues 39 40 41class QueryRequest(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 ("top_k",): { 69 "inclusive_maximum": 10000, 70 "inclusive_minimum": 1, 71 }, 72 ("queries",): {}, 73 ("vector",): {}, 74 ("id",): { 75 "max_length": 512, 76 }, 77 } 78 79 @cached_property 80 def additional_properties_type(): 81 """ 82 This must be a method because a model may have properties that are 83 of type self, this must run after the class is loaded 84 """ 85 lazy_import() 86 return ( 87 bool, 88 date, 89 datetime, 90 dict, 91 float, 92 int, 93 list, 94 str, 95 none_type, 96 ) # noqa: E501 97 98 _nullable = False 99 100 @cached_property 101 def openapi_types(): 102 """ 103 This must be a method because a model may have properties that are 104 of type self, this must run after the class is loaded 105 106 Returns 107 openapi_types (dict): The key is attribute name 108 and the value is attribute type. 109 """ 110 lazy_import() 111 return { 112 "top_k": (int,), # noqa: E501 113 "namespace": (str,), # noqa: E501 114 "filter": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 115 "include_values": (bool,), # noqa: E501 116 "include_metadata": (bool,), # noqa: E501 117 "queries": ([QueryVector],), # noqa: E501 118 "vector": ([float],), # noqa: E501 119 "sparse_vector": (SparseValues,), # noqa: E501 120 "id": (str,), # noqa: E501 121 } 122 123 @cached_property 124 def discriminator(): 125 return None 126 127 attribute_map = { 128 "top_k": "topK", # noqa: E501 129 "namespace": "namespace", # noqa: E501 130 "filter": "filter", # noqa: E501 131 "include_values": "includeValues", # noqa: E501 132 "include_metadata": "includeMetadata", # noqa: E501 133 "queries": "queries", # noqa: E501 134 "vector": "vector", # noqa: E501 135 "sparse_vector": "sparseVector", # noqa: E501 136 "id": "id", # noqa: E501 137 } 138 139 read_only_vars = {} 140 141 _composed_schemas = {} 142 143 @classmethod 144 @convert_js_args_to_python_args 145 def _from_openapi_data(cls, top_k, *args, **kwargs): # noqa: E501 146 """QueryRequest - a model defined in OpenAPI 147 148 Args: 149 top_k (int): The number of results to return for each query. 150 151 Keyword Args: 152 _check_type (bool): if True, values for parameters in openapi_types 153 will be type checked and a TypeError will be 154 raised if the wrong type is input. 155 Defaults to True 156 _path_to_item (tuple/list): This is a list of keys or values to 157 drill down to the model in received_data 158 when deserializing a response 159 _spec_property_naming (bool): True if the variable names in the input data 160 are serialized names, as specified in the OpenAPI document. 161 False if the variable names in the input data 162 are pythonic names, e.g. snake case (default) 163 _configuration (Configuration): the instance to use when 164 deserializing a file_type parameter. 165 If passed, type conversion is attempted 166 If omitted no type conversion is done. 167 _visited_composed_classes (tuple): This stores a tuple of 168 classes that we have traveled through so that 169 if we see that class again we will not use its 170 discriminator again. 171 When traveling through a discriminator, the 172 composed schema that is 173 is traveled through is added to this set. 174 For example if Animal has a discriminator 175 petType and we pass in "Dog", and the class Dog 176 allOf includes Animal, we move through Animal 177 once using the discriminator, and pick Dog. 178 Then in Dog, we will make an instance of the 179 Animal class but this time we won't travel 180 through its discriminator because we passed in 181 _visited_composed_classes = (Animal,) 182 namespace (str): The namespace to query.. [optional] # noqa: E501 183 filter ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): The filter to apply. You can use vector metadata to limit your search. See https://www.pinecone.io/docs/metadata-filtering/.. [optional] # noqa: E501 184 include_values (bool): Indicates whether vector values are included in the response.. [optional] if omitted the server will use the default value of False # noqa: E501 185 include_metadata (bool): Indicates whether metadata is included in the response as well as the ids.. [optional] if omitted the server will use the default value of False # noqa: E501 186 queries ([QueryVector]): DEPRECATED. The query vectors. Each `query()` request can contain only one of the parameters `queries`, `vector`, or `id`.. [optional] # noqa: E501 187 vector ([float]): The query vector. This should be the same length as the dimension of the index being queried. Each `query()` request can contain only one of the parameters `id` or `vector`.. [optional] # noqa: E501 188 sparse_vector (SparseValues): [optional] # noqa: E501 189 id (str): The unique ID of the vector to be used as a query vector. Each `query()` request can contain only one of the parameters `queries`, `vector`, or `id`.. [optional] # noqa: E501 190 """ 191 192 _check_type = kwargs.pop("_check_type", True) 193 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 194 _path_to_item = kwargs.pop("_path_to_item", ()) 195 _configuration = kwargs.pop("_configuration", None) 196 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 197 198 self = super(OpenApiModel, cls).__new__(cls) 199 200 if args: 201 raise ApiTypeError( 202 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 203 % ( 204 args, 205 self.__class__.__name__, 206 ), 207 path_to_item=_path_to_item, 208 valid_classes=(self.__class__,), 209 ) 210 211 self._data_store = {} 212 self._check_type = _check_type 213 self._spec_property_naming = _spec_property_naming 214 self._path_to_item = _path_to_item 215 self._configuration = _configuration 216 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 217 218 self.top_k = top_k 219 for var_name, var_value in kwargs.items(): 220 if ( 221 var_name not in self.attribute_map 222 and self._configuration is not None 223 and self._configuration.discard_unknown_keys 224 and self.additional_properties_type is None 225 ): 226 # discard variable. 227 continue 228 setattr(self, var_name, var_value) 229 return self 230 231 required_properties = set( 232 [ 233 "_data_store", 234 "_check_type", 235 "_spec_property_naming", 236 "_path_to_item", 237 "_configuration", 238 "_visited_composed_classes", 239 ] 240 ) 241 242 @convert_js_args_to_python_args 243 def __init__(self, top_k, *args, **kwargs): # noqa: E501 244 """QueryRequest - a model defined in OpenAPI 245 246 Args: 247 top_k (int): The number of results to return for each query. 248 249 Keyword Args: 250 _check_type (bool): if True, values for parameters in openapi_types 251 will be type checked and a TypeError will be 252 raised if the wrong type is input. 253 Defaults to True 254 _path_to_item (tuple/list): This is a list of keys or values to 255 drill down to the model in received_data 256 when deserializing a response 257 _spec_property_naming (bool): True if the variable names in the input data 258 are serialized names, as specified in the OpenAPI document. 259 False if the variable names in the input data 260 are pythonic names, e.g. snake case (default) 261 _configuration (Configuration): the instance to use when 262 deserializing a file_type parameter. 263 If passed, type conversion is attempted 264 If omitted no type conversion is done. 265 _visited_composed_classes (tuple): This stores a tuple of 266 classes that we have traveled through so that 267 if we see that class again we will not use its 268 discriminator again. 269 When traveling through a discriminator, the 270 composed schema that is 271 is traveled through is added to this set. 272 For example if Animal has a discriminator 273 petType and we pass in "Dog", and the class Dog 274 allOf includes Animal, we move through Animal 275 once using the discriminator, and pick Dog. 276 Then in Dog, we will make an instance of the 277 Animal class but this time we won't travel 278 through its discriminator because we passed in 279 _visited_composed_classes = (Animal,) 280 namespace (str): The namespace to query.. [optional] # noqa: E501 281 filter ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): The filter to apply. You can use vector metadata to limit your search. See https://www.pinecone.io/docs/metadata-filtering/.. [optional] # noqa: E501 282 include_values (bool): Indicates whether vector values are included in the response.. [optional] if omitted the server will use the default value of False # noqa: E501 283 include_metadata (bool): Indicates whether metadata is included in the response as well as the ids.. [optional] if omitted the server will use the default value of False # noqa: E501 284 queries ([QueryVector]): DEPRECATED. The query vectors. Each `query()` request can contain only one of the parameters `queries`, `vector`, or `id`.. [optional] # noqa: E501 285 vector ([float]): The query vector. This should be the same length as the dimension of the index being queried. Each `query()` request can contain only one of the parameters `id` or `vector`.. [optional] # noqa: E501 286 sparse_vector (SparseValues): The sparse values of the query vector [optional] # noqa: E501 287 id (str): The unique ID of the vector to be used as a query vector. Each `query()` request can contain only one of the parameters `queries`, `vector`, or `id`.. [optional] # noqa: E501 288 """ 289 290 _check_type = kwargs.pop("_check_type", True) 291 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 292 _path_to_item = kwargs.pop("_path_to_item", ()) 293 _configuration = kwargs.pop("_configuration", None) 294 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 295 296 if args: 297 raise ApiTypeError( 298 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 299 % ( 300 args, 301 self.__class__.__name__, 302 ), 303 path_to_item=_path_to_item, 304 valid_classes=(self.__class__,), 305 ) 306 307 self._data_store = {} 308 self._check_type = _check_type 309 self._spec_property_naming = _spec_property_naming 310 self._path_to_item = _path_to_item 311 self._configuration = _configuration 312 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 313 314 self.top_k = top_k 315 for var_name, var_value in kwargs.items(): 316 if ( 317 var_name not in self.attribute_map 318 and self._configuration is not None 319 and self._configuration.discard_unknown_keys 320 and self.additional_properties_type is None 321 ): 322 # discard variable. 323 continue 324 setattr(self, var_name, var_value) 325 if var_name in self.read_only_vars: 326 raise ApiAttributeError( 327 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 328 f"class with read only attributes." 329 )
42class QueryRequest(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 ("top_k",): { 70 "inclusive_maximum": 10000, 71 "inclusive_minimum": 1, 72 }, 73 ("queries",): {}, 74 ("vector",): {}, 75 ("id",): { 76 "max_length": 512, 77 }, 78 } 79 80 @cached_property 81 def additional_properties_type(): 82 """ 83 This must be a method because a model may have properties that are 84 of type self, this must run after the class is loaded 85 """ 86 lazy_import() 87 return ( 88 bool, 89 date, 90 datetime, 91 dict, 92 float, 93 int, 94 list, 95 str, 96 none_type, 97 ) # noqa: E501 98 99 _nullable = False 100 101 @cached_property 102 def openapi_types(): 103 """ 104 This must be a method because a model may have properties that are 105 of type self, this must run after the class is loaded 106 107 Returns 108 openapi_types (dict): The key is attribute name 109 and the value is attribute type. 110 """ 111 lazy_import() 112 return { 113 "top_k": (int,), # noqa: E501 114 "namespace": (str,), # noqa: E501 115 "filter": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 116 "include_values": (bool,), # noqa: E501 117 "include_metadata": (bool,), # noqa: E501 118 "queries": ([QueryVector],), # noqa: E501 119 "vector": ([float],), # noqa: E501 120 "sparse_vector": (SparseValues,), # noqa: E501 121 "id": (str,), # noqa: E501 122 } 123 124 @cached_property 125 def discriminator(): 126 return None 127 128 attribute_map = { 129 "top_k": "topK", # noqa: E501 130 "namespace": "namespace", # noqa: E501 131 "filter": "filter", # noqa: E501 132 "include_values": "includeValues", # noqa: E501 133 "include_metadata": "includeMetadata", # noqa: E501 134 "queries": "queries", # noqa: E501 135 "vector": "vector", # noqa: E501 136 "sparse_vector": "sparseVector", # noqa: E501 137 "id": "id", # noqa: E501 138 } 139 140 read_only_vars = {} 141 142 _composed_schemas = {} 143 144 @classmethod 145 @convert_js_args_to_python_args 146 def _from_openapi_data(cls, top_k, *args, **kwargs): # noqa: E501 147 """QueryRequest - a model defined in OpenAPI 148 149 Args: 150 top_k (int): The number of results to return for each query. 151 152 Keyword Args: 153 _check_type (bool): if True, values for parameters in openapi_types 154 will be type checked and a TypeError will be 155 raised if the wrong type is input. 156 Defaults to True 157 _path_to_item (tuple/list): This is a list of keys or values to 158 drill down to the model in received_data 159 when deserializing a response 160 _spec_property_naming (bool): True if the variable names in the input data 161 are serialized names, as specified in the OpenAPI document. 162 False if the variable names in the input data 163 are pythonic names, e.g. snake case (default) 164 _configuration (Configuration): the instance to use when 165 deserializing a file_type parameter. 166 If passed, type conversion is attempted 167 If omitted no type conversion is done. 168 _visited_composed_classes (tuple): This stores a tuple of 169 classes that we have traveled through so that 170 if we see that class again we will not use its 171 discriminator again. 172 When traveling through a discriminator, the 173 composed schema that is 174 is traveled through is added to this set. 175 For example if Animal has a discriminator 176 petType and we pass in "Dog", and the class Dog 177 allOf includes Animal, we move through Animal 178 once using the discriminator, and pick Dog. 179 Then in Dog, we will make an instance of the 180 Animal class but this time we won't travel 181 through its discriminator because we passed in 182 _visited_composed_classes = (Animal,) 183 namespace (str): The namespace to query.. [optional] # noqa: E501 184 filter ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): The filter to apply. You can use vector metadata to limit your search. See https://www.pinecone.io/docs/metadata-filtering/.. [optional] # noqa: E501 185 include_values (bool): Indicates whether vector values are included in the response.. [optional] if omitted the server will use the default value of False # noqa: E501 186 include_metadata (bool): Indicates whether metadata is included in the response as well as the ids.. [optional] if omitted the server will use the default value of False # noqa: E501 187 queries ([QueryVector]): DEPRECATED. The query vectors. Each `query()` request can contain only one of the parameters `queries`, `vector`, or `id`.. [optional] # noqa: E501 188 vector ([float]): The query vector. This should be the same length as the dimension of the index being queried. Each `query()` request can contain only one of the parameters `id` or `vector`.. [optional] # noqa: E501 189 sparse_vector (SparseValues): [optional] # noqa: E501 190 id (str): The unique ID of the vector to be used as a query vector. Each `query()` request can contain only one of the parameters `queries`, `vector`, or `id`.. [optional] # noqa: E501 191 """ 192 193 _check_type = kwargs.pop("_check_type", True) 194 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 195 _path_to_item = kwargs.pop("_path_to_item", ()) 196 _configuration = kwargs.pop("_configuration", None) 197 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 198 199 self = super(OpenApiModel, cls).__new__(cls) 200 201 if args: 202 raise ApiTypeError( 203 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 204 % ( 205 args, 206 self.__class__.__name__, 207 ), 208 path_to_item=_path_to_item, 209 valid_classes=(self.__class__,), 210 ) 211 212 self._data_store = {} 213 self._check_type = _check_type 214 self._spec_property_naming = _spec_property_naming 215 self._path_to_item = _path_to_item 216 self._configuration = _configuration 217 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 218 219 self.top_k = top_k 220 for var_name, var_value in kwargs.items(): 221 if ( 222 var_name not in self.attribute_map 223 and self._configuration is not None 224 and self._configuration.discard_unknown_keys 225 and self.additional_properties_type is None 226 ): 227 # discard variable. 228 continue 229 setattr(self, var_name, var_value) 230 return self 231 232 required_properties = set( 233 [ 234 "_data_store", 235 "_check_type", 236 "_spec_property_naming", 237 "_path_to_item", 238 "_configuration", 239 "_visited_composed_classes", 240 ] 241 ) 242 243 @convert_js_args_to_python_args 244 def __init__(self, top_k, *args, **kwargs): # noqa: E501 245 """QueryRequest - a model defined in OpenAPI 246 247 Args: 248 top_k (int): The number of results to return for each query. 249 250 Keyword Args: 251 _check_type (bool): if True, values for parameters in openapi_types 252 will be type checked and a TypeError will be 253 raised if the wrong type is input. 254 Defaults to True 255 _path_to_item (tuple/list): This is a list of keys or values to 256 drill down to the model in received_data 257 when deserializing a response 258 _spec_property_naming (bool): True if the variable names in the input data 259 are serialized names, as specified in the OpenAPI document. 260 False if the variable names in the input data 261 are pythonic names, e.g. snake case (default) 262 _configuration (Configuration): the instance to use when 263 deserializing a file_type parameter. 264 If passed, type conversion is attempted 265 If omitted no type conversion is done. 266 _visited_composed_classes (tuple): This stores a tuple of 267 classes that we have traveled through so that 268 if we see that class again we will not use its 269 discriminator again. 270 When traveling through a discriminator, the 271 composed schema that is 272 is traveled through is added to this set. 273 For example if Animal has a discriminator 274 petType and we pass in "Dog", and the class Dog 275 allOf includes Animal, we move through Animal 276 once using the discriminator, and pick Dog. 277 Then in Dog, we will make an instance of the 278 Animal class but this time we won't travel 279 through its discriminator because we passed in 280 _visited_composed_classes = (Animal,) 281 namespace (str): The namespace to query.. [optional] # noqa: E501 282 filter ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): The filter to apply. You can use vector metadata to limit your search. See https://www.pinecone.io/docs/metadata-filtering/.. [optional] # noqa: E501 283 include_values (bool): Indicates whether vector values are included in the response.. [optional] if omitted the server will use the default value of False # noqa: E501 284 include_metadata (bool): Indicates whether metadata is included in the response as well as the ids.. [optional] if omitted the server will use the default value of False # noqa: E501 285 queries ([QueryVector]): DEPRECATED. The query vectors. Each `query()` request can contain only one of the parameters `queries`, `vector`, or `id`.. [optional] # noqa: E501 286 vector ([float]): The query vector. This should be the same length as the dimension of the index being queried. Each `query()` request can contain only one of the parameters `id` or `vector`.. [optional] # noqa: E501 287 sparse_vector (SparseValues): The sparse values of the query vector [optional] # noqa: E501 288 id (str): The unique ID of the vector to be used as a query vector. Each `query()` request can contain only one of the parameters `queries`, `vector`, or `id`.. [optional] # noqa: E501 289 """ 290 291 _check_type = kwargs.pop("_check_type", True) 292 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 293 _path_to_item = kwargs.pop("_path_to_item", ()) 294 _configuration = kwargs.pop("_configuration", None) 295 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 296 297 if args: 298 raise ApiTypeError( 299 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 300 % ( 301 args, 302 self.__class__.__name__, 303 ), 304 path_to_item=_path_to_item, 305 valid_classes=(self.__class__,), 306 ) 307 308 self._data_store = {} 309 self._check_type = _check_type 310 self._spec_property_naming = _spec_property_naming 311 self._path_to_item = _path_to_item 312 self._configuration = _configuration 313 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 314 315 self.top_k = top_k 316 for var_name, var_value in kwargs.items(): 317 if ( 318 var_name not in self.attribute_map 319 and self._configuration is not None 320 and self._configuration.discard_unknown_keys 321 and self.additional_properties_type is None 322 ): 323 # discard variable. 324 continue 325 setattr(self, var_name, var_value) 326 if var_name in self.read_only_vars: 327 raise ApiAttributeError( 328 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 329 f"class with read only attributes." 330 )
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.
243 @convert_js_args_to_python_args 244 def __init__(self, top_k, *args, **kwargs): # noqa: E501 245 """QueryRequest - a model defined in OpenAPI 246 247 Args: 248 top_k (int): The number of results to return for each query. 249 250 Keyword Args: 251 _check_type (bool): if True, values for parameters in openapi_types 252 will be type checked and a TypeError will be 253 raised if the wrong type is input. 254 Defaults to True 255 _path_to_item (tuple/list): This is a list of keys or values to 256 drill down to the model in received_data 257 when deserializing a response 258 _spec_property_naming (bool): True if the variable names in the input data 259 are serialized names, as specified in the OpenAPI document. 260 False if the variable names in the input data 261 are pythonic names, e.g. snake case (default) 262 _configuration (Configuration): the instance to use when 263 deserializing a file_type parameter. 264 If passed, type conversion is attempted 265 If omitted no type conversion is done. 266 _visited_composed_classes (tuple): This stores a tuple of 267 classes that we have traveled through so that 268 if we see that class again we will not use its 269 discriminator again. 270 When traveling through a discriminator, the 271 composed schema that is 272 is traveled through is added to this set. 273 For example if Animal has a discriminator 274 petType and we pass in "Dog", and the class Dog 275 allOf includes Animal, we move through Animal 276 once using the discriminator, and pick Dog. 277 Then in Dog, we will make an instance of the 278 Animal class but this time we won't travel 279 through its discriminator because we passed in 280 _visited_composed_classes = (Animal,) 281 namespace (str): The namespace to query.. [optional] # noqa: E501 282 filter ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): The filter to apply. You can use vector metadata to limit your search. See https://www.pinecone.io/docs/metadata-filtering/.. [optional] # noqa: E501 283 include_values (bool): Indicates whether vector values are included in the response.. [optional] if omitted the server will use the default value of False # noqa: E501 284 include_metadata (bool): Indicates whether metadata is included in the response as well as the ids.. [optional] if omitted the server will use the default value of False # noqa: E501 285 queries ([QueryVector]): DEPRECATED. The query vectors. Each `query()` request can contain only one of the parameters `queries`, `vector`, or `id`.. [optional] # noqa: E501 286 vector ([float]): The query vector. This should be the same length as the dimension of the index being queried. Each `query()` request can contain only one of the parameters `id` or `vector`.. [optional] # noqa: E501 287 sparse_vector (SparseValues): The sparse values of the query vector [optional] # noqa: E501 288 id (str): The unique ID of the vector to be used as a query vector. Each `query()` request can contain only one of the parameters `queries`, `vector`, or `id`.. [optional] # noqa: E501 289 """ 290 291 _check_type = kwargs.pop("_check_type", True) 292 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 293 _path_to_item = kwargs.pop("_path_to_item", ()) 294 _configuration = kwargs.pop("_configuration", None) 295 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 296 297 if args: 298 raise ApiTypeError( 299 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 300 % ( 301 args, 302 self.__class__.__name__, 303 ), 304 path_to_item=_path_to_item, 305 valid_classes=(self.__class__,), 306 ) 307 308 self._data_store = {} 309 self._check_type = _check_type 310 self._spec_property_naming = _spec_property_naming 311 self._path_to_item = _path_to_item 312 self._configuration = _configuration 313 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 314 315 self.top_k = top_k 316 for var_name, var_value in kwargs.items(): 317 if ( 318 var_name not in self.attribute_map 319 and self._configuration is not None 320 and self._configuration.discard_unknown_keys 321 and self.additional_properties_type is None 322 ): 323 # discard variable. 324 continue 325 setattr(self, var_name, var_value) 326 if var_name in self.read_only_vars: 327 raise ApiAttributeError( 328 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 329 f"class with read only attributes." 330 )
QueryRequest - a model defined in OpenAPI
Arguments:
- top_k (int): The number of results to return for each query.
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): The namespace to query.. [optional] # noqa: E501 filter ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): The filter to apply. You can use vector metadata to limit your search. See https://www.pinecone.io/docs/metadata-filtering/.. [optional] # noqa: E501 include_values (bool): Indicates whether vector values are included in the response.. [optional] if omitted the server will use the default value of False # noqa: E501 include_metadata (bool): Indicates whether metadata is included in the response as well as the ids.. [optional] if omitted the server will use the default value of False # noqa: E501 queries ([QueryVector]): DEPRECATED. The query vectors. Each
query()request can contain only one of the parametersqueries,vector, orid.. [optional] # noqa: E501 vector ([float]): The query vector. This should be the same length as the dimension of the index being queried. Eachquery()request can contain only one of the parametersidorvector.. [optional] # noqa: E501 sparse_vector (SparseValues): The sparse values of the query vector [optional] # noqa: E501 id (str): The unique ID of the vector to be used as a query vector. Eachquery()request can contain only one of the parametersqueries,vector, orid.. [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.