pinecone.index
1from tqdm.autonotebook import tqdm 2from importlib.util import find_spec 3import numbers 4import numpy as np 5 6from collections.abc import Iterable, Mapping 7from typing import Union, List, Tuple, Optional, Dict, Any 8 9from .core.client.model.sparse_values import SparseValues 10from pinecone import Config 11from pinecone.core.client import ApiClient 12from .core.client.models import ( 13 FetchResponse, 14 ProtobufAny, 15 QueryRequest, 16 QueryResponse, 17 QueryVector, 18 RpcStatus, 19 ScoredVector, 20 SingleQueryResults, 21 DescribeIndexStatsResponse, 22 UpsertRequest, 23 UpsertResponse, 24 UpdateRequest, 25 Vector, 26 DeleteRequest, 27 UpdateRequest, 28 DescribeIndexStatsRequest, 29) 30from pinecone.core.client.api.vector_operations_api import VectorOperationsApi 31from pinecone.core.utils import fix_tuple_length, get_user_agent, warn_deprecated 32import copy 33 34__all__ = [ 35 "Index", 36 "FetchResponse", 37 "ProtobufAny", 38 "QueryRequest", 39 "QueryResponse", 40 "QueryVector", 41 "RpcStatus", 42 "ScoredVector", 43 "SingleQueryResults", 44 "DescribeIndexStatsResponse", 45 "UpsertRequest", 46 "UpsertResponse", 47 "UpdateRequest", 48 "Vector", 49 "DeleteRequest", 50 "UpdateRequest", 51 "DescribeIndexStatsRequest", 52 "SparseValues", 53] 54 55from .core.utils.constants import REQUIRED_VECTOR_FIELDS, OPTIONAL_VECTOR_FIELDS 56from .core.utils.error_handling import validate_and_convert_errors 57 58_OPENAPI_ENDPOINT_PARAMS = ( 59 "_return_http_data_only", 60 "_preload_content", 61 "_request_timeout", 62 "_check_input_type", 63 "_check_return_type", 64 "_host_index", 65 "async_req", 66) 67 68 69def parse_query_response(response: QueryResponse, unary_query: bool): 70 if unary_query: 71 response._data_store.pop("results", None) 72 else: 73 response._data_store.pop("matches", None) 74 response._data_store.pop("namespace", None) 75 return response 76 77 78def upsert_numpy_deprecation_notice(context): 79 numpy_deprecataion_notice = "The ability to pass a numpy ndarray as part of a dictionary argument to upsert() will be removed in a future version of the pinecone client. To remove this warning, use the numpy.ndarray.tolist method to convert your ndarray into a python list before calling upsert()." 80 message = " ".join([context, numpy_deprecataion_notice]) 81 warn_deprecated(message, deprecated_in="2.2.1", removal_in="3.0.0") 82 83 84class Index(ApiClient): 85 86 """ 87 A client for interacting with a Pinecone index via REST API. 88 For improved performance, use the Pinecone GRPC index client. 89 """ 90 91 def __init__(self, index_name: str, pool_threads=1): 92 openapi_client_config = copy.deepcopy(Config.OPENAPI_CONFIG) 93 openapi_client_config.api_key = openapi_client_config.api_key or {} 94 openapi_client_config.api_key["ApiKeyAuth"] = openapi_client_config.api_key.get("ApiKeyAuth", Config.API_KEY) 95 openapi_client_config.server_variables = openapi_client_config.server_variables or {} 96 openapi_client_config.server_variables = { 97 **{"environment": Config.ENVIRONMENT, "index_name": index_name, "project_name": Config.PROJECT_NAME}, 98 **openapi_client_config.server_variables, 99 } 100 super().__init__(configuration=openapi_client_config, pool_threads=pool_threads) 101 self.user_agent = get_user_agent() 102 self._vector_api = VectorOperationsApi(self) 103 104 @validate_and_convert_errors 105 def upsert( 106 self, 107 vectors: Union[List[Vector], List[tuple], List[dict]], 108 namespace: Optional[str] = None, 109 batch_size: Optional[int] = None, 110 show_progress: bool = True, 111 **kwargs, 112 ) -> UpsertResponse: 113 """ 114 The upsert operation writes vectors into a namespace. 115 If a new value is upserted for an existing vector id, it will overwrite the previous value. 116 117 To upsert in parallel follow: https://docs.pinecone.io/docs/insert-data#sending-upserts-in-parallel 118 119 A vector can be represented by a 1) Vector object, a 2) tuple or 3) a dictionary 120 121 If a tuple is used, it must be of the form `(id, values, metadata)` or `(id, values)`. 122 where id is a string, vector is a list of floats, metadata is a dict, 123 and sparse_values is a dict of the form `{'indices': List[int], 'values': List[float]}`. 124 125 Examples: 126 >>> ('id1', [1.0, 2.0, 3.0], {'key': 'value'}, {'indices': [1, 2], 'values': [0.2, 0.4]}) 127 >>> ('id1', [1.0, 2.0, 3.0], None, {'indices': [1, 2], 'values': [0.2, 0.4]}) 128 >>> ('id1', [1.0, 2.0, 3.0], {'key': 'value'}), ('id2', [1.0, 2.0, 3.0]) 129 130 If a Vector object is used, a Vector object must be of the form 131 `Vector(id, values, metadata, sparse_values)`, where metadata and sparse_values are optional 132 arguments. 133 134 Examples: 135 >>> Vector(id='id1', values=[1.0, 2.0, 3.0], metadata={'key': 'value'}) 136 >>> Vector(id='id2', values=[1.0, 2.0, 3.0]) 137 >>> Vector(id='id3', values=[1.0, 2.0, 3.0], sparse_values=SparseValues(indices=[1, 2], values=[0.2, 0.4])) 138 139 **Note:** the dimension of each vector must match the dimension of the index. 140 141 If a dictionary is used, it must be in the form `{'id': str, 'values': List[float], 'sparse_values': {'indices': List[int], 'values': List[float]}, 'metadata': dict}` 142 143 Examples: 144 >>> index.upsert([('id1', [1.0, 2.0, 3.0], {'key': 'value'}), ('id2', [1.0, 2.0, 3.0])]) 145 >>> 146 >>> index.upsert([{'id': 'id1', 'values': [1.0, 2.0, 3.0], 'metadata': {'key': 'value'}}, 147 >>> {'id': 'id2', 'values': [1.0, 2.0, 3.0], 'sparse_values': {'indices': [1, 8], 'values': [0.2, 0.4]}]) 148 >>> index.upsert([Vector(id='id1', values=[1.0, 2.0, 3.0], metadata={'key': 'value'}), 149 >>> Vector(id='id2', values=[1.0, 2.0, 3.0], sparse_values=SparseValues(indices=[1, 2], values=[0.2, 0.4]))]) 150 151 API reference: https://docs.pinecone.io/reference/upsert 152 153 Args: 154 vectors (Union[List[Vector], List[Tuple]]): A list of vectors to upsert. 155 namespace (str): The namespace to write to. If not specified, the default namespace is used. [optional] 156 batch_size (int): The number of vectors to upsert in each batch. 157 If not specified, all vectors will be upserted in a single batch. [optional] 158 show_progress (bool): Whether to show a progress bar using tqdm. 159 Applied only if batch_size is provided. Default is True. 160 Keyword Args: 161 Supports OpenAPI client keyword arguments. See pinecone.core.client.models.UpsertRequest for more details. 162 163 Returns: UpsertResponse, includes the number of vectors upserted. 164 """ 165 _check_type = kwargs.pop("_check_type", False) 166 167 if kwargs.get("async_req", False) and batch_size is not None: 168 raise ValueError( 169 "async_req is not supported when batch_size is provided." 170 "To upsert in parallel, please follow: " 171 "https://docs.pinecone.io/docs/insert-data#sending-upserts-in-parallel" 172 ) 173 174 if batch_size is None: 175 return self._upsert_batch(vectors, namespace, _check_type, **kwargs) 176 177 if not isinstance(batch_size, int) or batch_size <= 0: 178 raise ValueError("batch_size must be a positive integer") 179 180 pbar = tqdm(total=len(vectors), disable=not show_progress, desc="Upserted vectors") 181 total_upserted = 0 182 for i in range(0, len(vectors), batch_size): 183 batch_result = self._upsert_batch(vectors[i : i + batch_size], namespace, _check_type, **kwargs) 184 pbar.update(batch_result.upserted_count) 185 # we can't use here pbar.n for the case show_progress=False 186 total_upserted += batch_result.upserted_count 187 188 return UpsertResponse(upserted_count=total_upserted) 189 190 def _upsert_batch( 191 self, vectors: List[Vector], namespace: Optional[str], _check_type: bool, **kwargs 192 ) -> UpsertResponse: 193 args_dict = self._parse_non_empty_args([("namespace", namespace)]) 194 195 def _dict_to_vector(item): 196 item_keys = set(item.keys()) 197 if not item_keys.issuperset(REQUIRED_VECTOR_FIELDS): 198 raise ValueError( 199 f"Vector dictionary is missing required fields: {list(REQUIRED_VECTOR_FIELDS - item_keys)}" 200 ) 201 202 excessive_keys = item_keys - (REQUIRED_VECTOR_FIELDS | OPTIONAL_VECTOR_FIELDS) 203 if len(excessive_keys) > 0: 204 raise ValueError( 205 f"Found excess keys in the vector dictionary: {list(excessive_keys)}. " 206 f"The allowed keys are: {list(REQUIRED_VECTOR_FIELDS | OPTIONAL_VECTOR_FIELDS)}" 207 ) 208 209 if "sparse_values" in item: 210 if not isinstance(item["sparse_values"], Mapping): 211 raise ValueError( 212 f"Column `sparse_values` is expected to be a dictionary, found {type(item['sparse_values'])}" 213 ) 214 215 indices = item["sparse_values"].get("indices", None) 216 values = item["sparse_values"].get("values", None) 217 218 if isinstance(values, np.ndarray): 219 upsert_numpy_deprecation_notice("Deprecated type passed in sparse_values['values'].") 220 values = values.tolist() 221 if isinstance(indices, np.ndarray): 222 upsert_numpy_deprecation_notice("Deprecated type passed in sparse_values['indices'].") 223 indices = indices.tolist() 224 try: 225 item["sparse_values"] = SparseValues(indices=indices, values=values) 226 except TypeError as e: 227 raise ValueError( 228 "Found unexpected data in column `sparse_values`. " 229 "Expected format is `'sparse_values': {'indices': List[int], 'values': List[float]}`." 230 ) from e 231 232 if "metadata" in item: 233 metadata = item.get("metadata") 234 if not isinstance(metadata, Mapping): 235 raise TypeError(f"Column `metadata` is expected to be a dictionary, found {type(metadata)}") 236 237 if isinstance(item["values"], np.ndarray): 238 upsert_numpy_deprecation_notice("Deprecated type passed in 'values'.") 239 item["values"] = item["values"].tolist() 240 241 try: 242 return Vector(**item) 243 except TypeError as e: 244 # if not isinstance(item['values'], Iterable) or not isinstance(item['values'][0], numbers.Real): 245 # raise TypeError(f"Column `values` is expected to be a list of floats") 246 if not isinstance(item["values"], Iterable) or not isinstance(item["values"][0], numbers.Real): 247 raise TypeError(f"Column `values` is expected to be a list of floats") 248 raise 249 250 def _vector_transform(item: Union[Vector, Tuple]): 251 if isinstance(item, Vector): 252 return item 253 elif isinstance(item, tuple): 254 if len(item) > 3: 255 raise ValueError( 256 f"Found a tuple of length {len(item)} which is not supported. " 257 f"Vectors can be represented as tuples either the form (id, values, metadata) or (id, values). " 258 f"To pass sparse values please use either dicts or a Vector objects as inputs." 259 ) 260 id, values, metadata = fix_tuple_length(item, 3) 261 return Vector(id=id, values=values, metadata=metadata or {}, _check_type=_check_type) 262 elif isinstance(item, Mapping): 263 return _dict_to_vector(item) 264 raise ValueError(f"Invalid vector value passed: cannot interpret type {type(item)}") 265 266 return self._vector_api.upsert( 267 UpsertRequest( 268 vectors=list(map(_vector_transform, vectors)), 269 **args_dict, 270 _check_type=_check_type, 271 **{k: v for k, v in kwargs.items() if k not in _OPENAPI_ENDPOINT_PARAMS}, 272 ), 273 **{k: v for k, v in kwargs.items() if k in _OPENAPI_ENDPOINT_PARAMS}, 274 ) 275 276 @staticmethod 277 def _iter_dataframe(df, batch_size): 278 for i in range(0, len(df), batch_size): 279 batch = df.iloc[i : i + batch_size].to_dict(orient="records") 280 yield batch 281 282 def upsert_from_dataframe( 283 self, df, namespace: str = None, batch_size: int = 500, show_progress: bool = True 284 ) -> UpsertResponse: 285 """Upserts a dataframe into the index. 286 287 Args: 288 df: A pandas dataframe with the following columns: id, vector, sparse_values, and metadata. 289 namespace: The namespace to upsert into. 290 batch_size: The number of rows to upsert in a single batch. 291 show_progress: Whether to show a progress bar. 292 """ 293 try: 294 import pandas as pd 295 except ImportError: 296 raise RuntimeError( 297 "The `pandas` package is not installed. Please install pandas to use `upsert_from_dataframe()`" 298 ) 299 300 if not isinstance(df, pd.DataFrame): 301 raise ValueError(f"Only pandas dataframes are supported. Found: {type(df)}") 302 303 pbar = tqdm(total=len(df), disable=not show_progress, desc="sending upsert requests") 304 results = [] 305 for chunk in self._iter_dataframe(df, batch_size=batch_size): 306 res = self.upsert(vectors=chunk, namespace=namespace) 307 pbar.update(len(chunk)) 308 results.append(res) 309 310 upserted_count = 0 311 for res in results: 312 upserted_count += res.upserted_count 313 314 return UpsertResponse(upserted_count=upserted_count) 315 316 @validate_and_convert_errors 317 def delete( 318 self, 319 ids: Optional[List[str]] = None, 320 delete_all: Optional[bool] = None, 321 namespace: Optional[str] = None, 322 filter: Optional[Dict[str, Union[str, float, int, bool, List, dict]]] = None, 323 **kwargs, 324 ) -> Dict[str, Any]: 325 """ 326 The Delete operation deletes vectors from the index, from a single namespace. 327 No error raised if the vector id does not exist. 328 Note: for any delete call, if namespace is not specified, the default namespace is used. 329 330 Delete can occur in the following mutual exclusive ways: 331 1. Delete by ids from a single namespace 332 2. Delete all vectors from a single namespace by setting delete_all to True 333 3. Delete all vectors from a single namespace by specifying a metadata filter 334 (note that for this option delete all must be set to False) 335 336 API reference: https://docs.pinecone.io/reference/delete_post 337 338 Examples: 339 >>> index.delete(ids=['id1', 'id2'], namespace='my_namespace') 340 >>> index.delete(delete_all=True, namespace='my_namespace') 341 >>> index.delete(filter={'key': 'value'}, namespace='my_namespace') 342 343 Args: 344 ids (List[str]): Vector ids to delete [optional] 345 delete_all (bool): This indicates that all vectors in the index namespace should be deleted.. [optional] 346 Default is False. 347 namespace (str): The namespace to delete vectors from [optional] 348 If not specified, the default namespace is used. 349 filter (Dict[str, Union[str, float, int, bool, List, dict]]): 350 If specified, the metadata filter here will be used to select the vectors to delete. 351 This is mutually exclusive with specifying ids to delete in the ids param or using delete_all=True. 352 See https://www.pinecone.io/docs/metadata-filtering/.. [optional] 353 354 Keyword Args: 355 Supports OpenAPI client keyword arguments. See pinecone.core.client.models.DeleteRequest for more details. 356 357 358 Returns: An empty dictionary if the delete operation was successful. 359 """ 360 _check_type = kwargs.pop("_check_type", False) 361 args_dict = self._parse_non_empty_args( 362 [("ids", ids), ("delete_all", delete_all), ("namespace", namespace), ("filter", filter)] 363 ) 364 365 return self._vector_api.delete( 366 DeleteRequest( 367 **args_dict, 368 **{k: v for k, v in kwargs.items() if k not in _OPENAPI_ENDPOINT_PARAMS and v is not None}, 369 _check_type=_check_type, 370 ), 371 **{k: v for k, v in kwargs.items() if k in _OPENAPI_ENDPOINT_PARAMS}, 372 ) 373 374 @validate_and_convert_errors 375 def fetch(self, ids: List[str], namespace: Optional[str] = None, **kwargs) -> FetchResponse: 376 """ 377 The fetch operation looks up and returns vectors, by ID, from a single namespace. 378 The returned vectors include the vector data and/or metadata. 379 380 API reference: https://docs.pinecone.io/reference/fetch 381 382 Examples: 383 >>> index.fetch(ids=['id1', 'id2'], namespace='my_namespace') 384 >>> index.fetch(ids=['id1', 'id2']) 385 386 Args: 387 ids (List[str]): The vector IDs to fetch. 388 namespace (str): The namespace to fetch vectors from. 389 If not specified, the default namespace is used. [optional] 390 Keyword Args: 391 Supports OpenAPI client keyword arguments. See pinecone.core.client.models.FetchResponse for more details. 392 393 394 Returns: FetchResponse object which contains the list of Vector objects, and namespace name. 395 """ 396 args_dict = self._parse_non_empty_args([("namespace", namespace)]) 397 return self._vector_api.fetch(ids=ids, **args_dict, **kwargs) 398 399 @validate_and_convert_errors 400 def query( 401 self, 402 vector: Optional[List[float]] = None, 403 id: Optional[str] = None, 404 queries: Optional[Union[List[QueryVector], List[Tuple]]] = None, 405 top_k: Optional[int] = None, 406 namespace: Optional[str] = None, 407 filter: Optional[Dict[str, Union[str, float, int, bool, List, dict]]] = None, 408 include_values: Optional[bool] = None, 409 include_metadata: Optional[bool] = None, 410 sparse_vector: Optional[Union[SparseValues, Dict[str, Union[List[float], List[int]]]]] = None, 411 **kwargs, 412 ) -> QueryResponse: 413 """ 414 The Query operation searches a namespace, using a query vector. 415 It retrieves the ids of the most similar items in a namespace, along with their similarity scores. 416 417 API reference: https://docs.pinecone.io/reference/query 418 419 Examples: 420 >>> index.query(vector=[1, 2, 3], top_k=10, namespace='my_namespace') 421 >>> index.query(id='id1', top_k=10, namespace='my_namespace') 422 >>> index.query(vector=[1, 2, 3], top_k=10, namespace='my_namespace', filter={'key': 'value'}) 423 >>> index.query(id='id1', top_k=10, namespace='my_namespace', include_metadata=True, include_values=True) 424 >>> index.query(vector=[1, 2, 3], sparse_vector={'indices': [1, 2], 'values': [0.2, 0.4]}, 425 >>> top_k=10, namespace='my_namespace') 426 >>> index.query(vector=[1, 2, 3], sparse_vector=SparseValues([1, 2], [0.2, 0.4]), 427 >>> top_k=10, namespace='my_namespace') 428 429 Args: 430 vector (List[float]): The query vector. This should be the same length as the dimension of the index 431 being queried. Each `query()` request can contain only one of the parameters 432 `queries`, `id` or `vector`.. [optional] 433 id (str): The unique ID of the vector to be used as a query vector. 434 Each `query()` request can contain only one of the parameters 435 `queries`, `vector`, or `id`.. [optional] 436 queries ([QueryVector]): DEPRECATED. The query vectors. 437 Each `query()` request can contain only one of the parameters 438 `queries`, `vector`, or `id`.. [optional] 439 top_k (int): The number of results to return for each query. Must be an integer greater than 1. 440 namespace (str): The namespace to fetch vectors from. 441 If not specified, the default namespace is used. [optional] 442 filter (Dict[str, Union[str, float, int, bool, List, dict]): 443 The filter to apply. You can use vector metadata to limit your search. 444 See https://www.pinecone.io/docs/metadata-filtering/.. [optional] 445 include_values (bool): Indicates whether vector values are included in the response. 446 If omitted the server will use the default value of False [optional] 447 include_metadata (bool): Indicates whether metadata is included in the response as well as the ids. 448 If omitted the server will use the default value of False [optional] 449 sparse_vector: (Union[SparseValues, Dict[str, Union[List[float], List[int]]]]): sparse values of the query vector. 450 Expected to be either a SparseValues object or a dict of the form: 451 {'indices': List[int], 'values': List[float]}, where the lists each have the same length. 452 Keyword Args: 453 Supports OpenAPI client keyword arguments. See pinecone.core.client.models.QueryRequest for more details. 454 455 Returns: QueryResponse object which contains the list of the closest vectors as ScoredVector objects, 456 and namespace name. 457 """ 458 459 def _query_transform(item): 460 if isinstance(item, QueryVector): 461 return item 462 if isinstance(item, tuple): 463 values, filter = fix_tuple_length(item, 2) 464 if filter is None: 465 return QueryVector(values=values, _check_type=_check_type) 466 else: 467 return QueryVector(values=values, filter=filter, _check_type=_check_type) 468 if isinstance(item, Iterable): 469 return QueryVector(values=item, _check_type=_check_type) 470 raise ValueError(f"Invalid query vector value passed: cannot interpret type {type(item)}") 471 472 _check_type = kwargs.pop("_check_type", False) 473 queries = list(map(_query_transform, queries)) if queries is not None else None 474 475 sparse_vector = self._parse_sparse_values_arg(sparse_vector) 476 args_dict = self._parse_non_empty_args( 477 [ 478 ("vector", vector), 479 ("id", id), 480 ("queries", queries), 481 ("top_k", top_k), 482 ("namespace", namespace), 483 ("filter", filter), 484 ("include_values", include_values), 485 ("include_metadata", include_metadata), 486 ("sparse_vector", sparse_vector), 487 ] 488 ) 489 response = self._vector_api.query( 490 QueryRequest( 491 **args_dict, 492 _check_type=_check_type, 493 **{k: v for k, v in kwargs.items() if k not in _OPENAPI_ENDPOINT_PARAMS}, 494 ), 495 **{k: v for k, v in kwargs.items() if k in _OPENAPI_ENDPOINT_PARAMS}, 496 ) 497 return parse_query_response(response, vector is not None or id) 498 499 @validate_and_convert_errors 500 def update( 501 self, 502 id: str, 503 values: Optional[List[float]] = None, 504 set_metadata: Optional[Dict[str, Union[str, float, int, bool, List[int], List[float], List[str]]]] = None, 505 namespace: Optional[str] = None, 506 sparse_values: Optional[Union[SparseValues, Dict[str, Union[List[float], List[int]]]]] = None, 507 **kwargs, 508 ) -> Dict[str, Any]: 509 """ 510 The Update operation updates vector in a namespace. 511 If a value is included, it will overwrite the previous value. 512 If a set_metadata is included, 513 the values of the fields specified in it will be added or overwrite the previous value. 514 515 API reference: https://docs.pinecone.io/reference/update 516 517 Examples: 518 >>> index.update(id='id1', values=[1, 2, 3], namespace='my_namespace') 519 >>> index.update(id='id1', set_metadata={'key': 'value'}, namespace='my_namespace') 520 >>> index.update(id='id1', values=[1, 2, 3], sparse_values={'indices': [1, 2], 'values': [0.2, 0.4]}, 521 >>> namespace='my_namespace') 522 >>> index.update(id='id1', values=[1, 2, 3], sparse_values=SparseValues(indices=[1, 2], values=[0.2, 0.4]), 523 >>> namespace='my_namespace') 524 525 Args: 526 id (str): Vector's unique id. 527 values (List[float]): vector values to set. [optional] 528 set_metadata (Dict[str, Union[str, float, int, bool, List[int], List[float], List[str]]]]): 529 metadata to set for vector. [optional] 530 namespace (str): Namespace name where to update the vector.. [optional] 531 sparse_values: (Dict[str, Union[List[float], List[int]]]): sparse values to update for the vector. 532 Expected to be either a SparseValues object or a dict of the form: 533 {'indices': List[int], 'values': List[float]} where the lists each have the same length. 534 535 Keyword Args: 536 Supports OpenAPI client keyword arguments. See pinecone.core.client.models.UpdateRequest for more details. 537 538 Returns: An empty dictionary if the update was successful. 539 """ 540 _check_type = kwargs.pop("_check_type", False) 541 sparse_values = self._parse_sparse_values_arg(sparse_values) 542 args_dict = self._parse_non_empty_args( 543 [ 544 ("values", values), 545 ("set_metadata", set_metadata), 546 ("namespace", namespace), 547 ("sparse_values", sparse_values), 548 ] 549 ) 550 return self._vector_api.update( 551 UpdateRequest( 552 id=id, 553 **args_dict, 554 _check_type=_check_type, 555 **{k: v for k, v in kwargs.items() if k not in _OPENAPI_ENDPOINT_PARAMS}, 556 ), 557 **{k: v for k, v in kwargs.items() if k in _OPENAPI_ENDPOINT_PARAMS}, 558 ) 559 560 @validate_and_convert_errors 561 def describe_index_stats( 562 self, filter: Optional[Dict[str, Union[str, float, int, bool, List, dict]]] = None, **kwargs 563 ) -> DescribeIndexStatsResponse: 564 """ 565 The DescribeIndexStats operation returns statistics about the index's contents. 566 For example: The vector count per namespace and the number of dimensions. 567 568 API reference: https://docs.pinecone.io/reference/describe_index_stats_post 569 570 Examples: 571 >>> index.describe_index_stats() 572 >>> index.describe_index_stats(filter={'key': 'value'}) 573 574 Args: 575 filter (Dict[str, Union[str, float, int, bool, List, dict]]): 576 If this parameter is present, the operation only returns statistics for vectors that satisfy the filter. 577 See https://www.pinecone.io/docs/metadata-filtering/.. [optional] 578 579 Returns: DescribeIndexStatsResponse object which contains stats about the index. 580 """ 581 _check_type = kwargs.pop("_check_type", False) 582 args_dict = self._parse_non_empty_args([("filter", filter)]) 583 584 return self._vector_api.describe_index_stats( 585 DescribeIndexStatsRequest( 586 **args_dict, 587 **{k: v for k, v in kwargs.items() if k not in _OPENAPI_ENDPOINT_PARAMS}, 588 _check_type=_check_type, 589 ), 590 **{k: v for k, v in kwargs.items() if k in _OPENAPI_ENDPOINT_PARAMS}, 591 ) 592 593 @staticmethod 594 def _parse_non_empty_args(args: List[Tuple[str, Any]]) -> Dict[str, Any]: 595 return {arg_name: val for arg_name, val in args if val is not None} 596 597 @staticmethod 598 def _parse_sparse_values_arg( 599 sparse_values: Optional[Union[SparseValues, Dict[str, Union[List[float], List[int]]]]] 600 ) -> Optional[SparseValues]: 601 if sparse_values is None: 602 return None 603 604 if isinstance(sparse_values, SparseValues): 605 return sparse_values 606 607 if not isinstance(sparse_values, dict) or "indices" not in sparse_values or "values" not in sparse_values: 608 raise ValueError( 609 "Invalid sparse values argument. Expected a dict of: {'indices': List[int], 'values': List[float]}." 610 f"Received: {sparse_values}" 611 ) 612 613 return SparseValues(indices=sparse_values["indices"], values=sparse_values["values"])
85class Index(ApiClient): 86 87 """ 88 A client for interacting with a Pinecone index via REST API. 89 For improved performance, use the Pinecone GRPC index client. 90 """ 91 92 def __init__(self, index_name: str, pool_threads=1): 93 openapi_client_config = copy.deepcopy(Config.OPENAPI_CONFIG) 94 openapi_client_config.api_key = openapi_client_config.api_key or {} 95 openapi_client_config.api_key["ApiKeyAuth"] = openapi_client_config.api_key.get("ApiKeyAuth", Config.API_KEY) 96 openapi_client_config.server_variables = openapi_client_config.server_variables or {} 97 openapi_client_config.server_variables = { 98 **{"environment": Config.ENVIRONMENT, "index_name": index_name, "project_name": Config.PROJECT_NAME}, 99 **openapi_client_config.server_variables, 100 } 101 super().__init__(configuration=openapi_client_config, pool_threads=pool_threads) 102 self.user_agent = get_user_agent() 103 self._vector_api = VectorOperationsApi(self) 104 105 @validate_and_convert_errors 106 def upsert( 107 self, 108 vectors: Union[List[Vector], List[tuple], List[dict]], 109 namespace: Optional[str] = None, 110 batch_size: Optional[int] = None, 111 show_progress: bool = True, 112 **kwargs, 113 ) -> UpsertResponse: 114 """ 115 The upsert operation writes vectors into a namespace. 116 If a new value is upserted for an existing vector id, it will overwrite the previous value. 117 118 To upsert in parallel follow: https://docs.pinecone.io/docs/insert-data#sending-upserts-in-parallel 119 120 A vector can be represented by a 1) Vector object, a 2) tuple or 3) a dictionary 121 122 If a tuple is used, it must be of the form `(id, values, metadata)` or `(id, values)`. 123 where id is a string, vector is a list of floats, metadata is a dict, 124 and sparse_values is a dict of the form `{'indices': List[int], 'values': List[float]}`. 125 126 Examples: 127 >>> ('id1', [1.0, 2.0, 3.0], {'key': 'value'}, {'indices': [1, 2], 'values': [0.2, 0.4]}) 128 >>> ('id1', [1.0, 2.0, 3.0], None, {'indices': [1, 2], 'values': [0.2, 0.4]}) 129 >>> ('id1', [1.0, 2.0, 3.0], {'key': 'value'}), ('id2', [1.0, 2.0, 3.0]) 130 131 If a Vector object is used, a Vector object must be of the form 132 `Vector(id, values, metadata, sparse_values)`, where metadata and sparse_values are optional 133 arguments. 134 135 Examples: 136 >>> Vector(id='id1', values=[1.0, 2.0, 3.0], metadata={'key': 'value'}) 137 >>> Vector(id='id2', values=[1.0, 2.0, 3.0]) 138 >>> Vector(id='id3', values=[1.0, 2.0, 3.0], sparse_values=SparseValues(indices=[1, 2], values=[0.2, 0.4])) 139 140 **Note:** the dimension of each vector must match the dimension of the index. 141 142 If a dictionary is used, it must be in the form `{'id': str, 'values': List[float], 'sparse_values': {'indices': List[int], 'values': List[float]}, 'metadata': dict}` 143 144 Examples: 145 >>> index.upsert([('id1', [1.0, 2.0, 3.0], {'key': 'value'}), ('id2', [1.0, 2.0, 3.0])]) 146 >>> 147 >>> index.upsert([{'id': 'id1', 'values': [1.0, 2.0, 3.0], 'metadata': {'key': 'value'}}, 148 >>> {'id': 'id2', 'values': [1.0, 2.0, 3.0], 'sparse_values': {'indices': [1, 8], 'values': [0.2, 0.4]}]) 149 >>> index.upsert([Vector(id='id1', values=[1.0, 2.0, 3.0], metadata={'key': 'value'}), 150 >>> Vector(id='id2', values=[1.0, 2.0, 3.0], sparse_values=SparseValues(indices=[1, 2], values=[0.2, 0.4]))]) 151 152 API reference: https://docs.pinecone.io/reference/upsert 153 154 Args: 155 vectors (Union[List[Vector], List[Tuple]]): A list of vectors to upsert. 156 namespace (str): The namespace to write to. If not specified, the default namespace is used. [optional] 157 batch_size (int): The number of vectors to upsert in each batch. 158 If not specified, all vectors will be upserted in a single batch. [optional] 159 show_progress (bool): Whether to show a progress bar using tqdm. 160 Applied only if batch_size is provided. Default is True. 161 Keyword Args: 162 Supports OpenAPI client keyword arguments. See pinecone.core.client.models.UpsertRequest for more details. 163 164 Returns: UpsertResponse, includes the number of vectors upserted. 165 """ 166 _check_type = kwargs.pop("_check_type", False) 167 168 if kwargs.get("async_req", False) and batch_size is not None: 169 raise ValueError( 170 "async_req is not supported when batch_size is provided." 171 "To upsert in parallel, please follow: " 172 "https://docs.pinecone.io/docs/insert-data#sending-upserts-in-parallel" 173 ) 174 175 if batch_size is None: 176 return self._upsert_batch(vectors, namespace, _check_type, **kwargs) 177 178 if not isinstance(batch_size, int) or batch_size <= 0: 179 raise ValueError("batch_size must be a positive integer") 180 181 pbar = tqdm(total=len(vectors), disable=not show_progress, desc="Upserted vectors") 182 total_upserted = 0 183 for i in range(0, len(vectors), batch_size): 184 batch_result = self._upsert_batch(vectors[i : i + batch_size], namespace, _check_type, **kwargs) 185 pbar.update(batch_result.upserted_count) 186 # we can't use here pbar.n for the case show_progress=False 187 total_upserted += batch_result.upserted_count 188 189 return UpsertResponse(upserted_count=total_upserted) 190 191 def _upsert_batch( 192 self, vectors: List[Vector], namespace: Optional[str], _check_type: bool, **kwargs 193 ) -> UpsertResponse: 194 args_dict = self._parse_non_empty_args([("namespace", namespace)]) 195 196 def _dict_to_vector(item): 197 item_keys = set(item.keys()) 198 if not item_keys.issuperset(REQUIRED_VECTOR_FIELDS): 199 raise ValueError( 200 f"Vector dictionary is missing required fields: {list(REQUIRED_VECTOR_FIELDS - item_keys)}" 201 ) 202 203 excessive_keys = item_keys - (REQUIRED_VECTOR_FIELDS | OPTIONAL_VECTOR_FIELDS) 204 if len(excessive_keys) > 0: 205 raise ValueError( 206 f"Found excess keys in the vector dictionary: {list(excessive_keys)}. " 207 f"The allowed keys are: {list(REQUIRED_VECTOR_FIELDS | OPTIONAL_VECTOR_FIELDS)}" 208 ) 209 210 if "sparse_values" in item: 211 if not isinstance(item["sparse_values"], Mapping): 212 raise ValueError( 213 f"Column `sparse_values` is expected to be a dictionary, found {type(item['sparse_values'])}" 214 ) 215 216 indices = item["sparse_values"].get("indices", None) 217 values = item["sparse_values"].get("values", None) 218 219 if isinstance(values, np.ndarray): 220 upsert_numpy_deprecation_notice("Deprecated type passed in sparse_values['values'].") 221 values = values.tolist() 222 if isinstance(indices, np.ndarray): 223 upsert_numpy_deprecation_notice("Deprecated type passed in sparse_values['indices'].") 224 indices = indices.tolist() 225 try: 226 item["sparse_values"] = SparseValues(indices=indices, values=values) 227 except TypeError as e: 228 raise ValueError( 229 "Found unexpected data in column `sparse_values`. " 230 "Expected format is `'sparse_values': {'indices': List[int], 'values': List[float]}`." 231 ) from e 232 233 if "metadata" in item: 234 metadata = item.get("metadata") 235 if not isinstance(metadata, Mapping): 236 raise TypeError(f"Column `metadata` is expected to be a dictionary, found {type(metadata)}") 237 238 if isinstance(item["values"], np.ndarray): 239 upsert_numpy_deprecation_notice("Deprecated type passed in 'values'.") 240 item["values"] = item["values"].tolist() 241 242 try: 243 return Vector(**item) 244 except TypeError as e: 245 # if not isinstance(item['values'], Iterable) or not isinstance(item['values'][0], numbers.Real): 246 # raise TypeError(f"Column `values` is expected to be a list of floats") 247 if not isinstance(item["values"], Iterable) or not isinstance(item["values"][0], numbers.Real): 248 raise TypeError(f"Column `values` is expected to be a list of floats") 249 raise 250 251 def _vector_transform(item: Union[Vector, Tuple]): 252 if isinstance(item, Vector): 253 return item 254 elif isinstance(item, tuple): 255 if len(item) > 3: 256 raise ValueError( 257 f"Found a tuple of length {len(item)} which is not supported. " 258 f"Vectors can be represented as tuples either the form (id, values, metadata) or (id, values). " 259 f"To pass sparse values please use either dicts or a Vector objects as inputs." 260 ) 261 id, values, metadata = fix_tuple_length(item, 3) 262 return Vector(id=id, values=values, metadata=metadata or {}, _check_type=_check_type) 263 elif isinstance(item, Mapping): 264 return _dict_to_vector(item) 265 raise ValueError(f"Invalid vector value passed: cannot interpret type {type(item)}") 266 267 return self._vector_api.upsert( 268 UpsertRequest( 269 vectors=list(map(_vector_transform, vectors)), 270 **args_dict, 271 _check_type=_check_type, 272 **{k: v for k, v in kwargs.items() if k not in _OPENAPI_ENDPOINT_PARAMS}, 273 ), 274 **{k: v for k, v in kwargs.items() if k in _OPENAPI_ENDPOINT_PARAMS}, 275 ) 276 277 @staticmethod 278 def _iter_dataframe(df, batch_size): 279 for i in range(0, len(df), batch_size): 280 batch = df.iloc[i : i + batch_size].to_dict(orient="records") 281 yield batch 282 283 def upsert_from_dataframe( 284 self, df, namespace: str = None, batch_size: int = 500, show_progress: bool = True 285 ) -> UpsertResponse: 286 """Upserts a dataframe into the index. 287 288 Args: 289 df: A pandas dataframe with the following columns: id, vector, sparse_values, and metadata. 290 namespace: The namespace to upsert into. 291 batch_size: The number of rows to upsert in a single batch. 292 show_progress: Whether to show a progress bar. 293 """ 294 try: 295 import pandas as pd 296 except ImportError: 297 raise RuntimeError( 298 "The `pandas` package is not installed. Please install pandas to use `upsert_from_dataframe()`" 299 ) 300 301 if not isinstance(df, pd.DataFrame): 302 raise ValueError(f"Only pandas dataframes are supported. Found: {type(df)}") 303 304 pbar = tqdm(total=len(df), disable=not show_progress, desc="sending upsert requests") 305 results = [] 306 for chunk in self._iter_dataframe(df, batch_size=batch_size): 307 res = self.upsert(vectors=chunk, namespace=namespace) 308 pbar.update(len(chunk)) 309 results.append(res) 310 311 upserted_count = 0 312 for res in results: 313 upserted_count += res.upserted_count 314 315 return UpsertResponse(upserted_count=upserted_count) 316 317 @validate_and_convert_errors 318 def delete( 319 self, 320 ids: Optional[List[str]] = None, 321 delete_all: Optional[bool] = None, 322 namespace: Optional[str] = None, 323 filter: Optional[Dict[str, Union[str, float, int, bool, List, dict]]] = None, 324 **kwargs, 325 ) -> Dict[str, Any]: 326 """ 327 The Delete operation deletes vectors from the index, from a single namespace. 328 No error raised if the vector id does not exist. 329 Note: for any delete call, if namespace is not specified, the default namespace is used. 330 331 Delete can occur in the following mutual exclusive ways: 332 1. Delete by ids from a single namespace 333 2. Delete all vectors from a single namespace by setting delete_all to True 334 3. Delete all vectors from a single namespace by specifying a metadata filter 335 (note that for this option delete all must be set to False) 336 337 API reference: https://docs.pinecone.io/reference/delete_post 338 339 Examples: 340 >>> index.delete(ids=['id1', 'id2'], namespace='my_namespace') 341 >>> index.delete(delete_all=True, namespace='my_namespace') 342 >>> index.delete(filter={'key': 'value'}, namespace='my_namespace') 343 344 Args: 345 ids (List[str]): Vector ids to delete [optional] 346 delete_all (bool): This indicates that all vectors in the index namespace should be deleted.. [optional] 347 Default is False. 348 namespace (str): The namespace to delete vectors from [optional] 349 If not specified, the default namespace is used. 350 filter (Dict[str, Union[str, float, int, bool, List, dict]]): 351 If specified, the metadata filter here will be used to select the vectors to delete. 352 This is mutually exclusive with specifying ids to delete in the ids param or using delete_all=True. 353 See https://www.pinecone.io/docs/metadata-filtering/.. [optional] 354 355 Keyword Args: 356 Supports OpenAPI client keyword arguments. See pinecone.core.client.models.DeleteRequest for more details. 357 358 359 Returns: An empty dictionary if the delete operation was successful. 360 """ 361 _check_type = kwargs.pop("_check_type", False) 362 args_dict = self._parse_non_empty_args( 363 [("ids", ids), ("delete_all", delete_all), ("namespace", namespace), ("filter", filter)] 364 ) 365 366 return self._vector_api.delete( 367 DeleteRequest( 368 **args_dict, 369 **{k: v for k, v in kwargs.items() if k not in _OPENAPI_ENDPOINT_PARAMS and v is not None}, 370 _check_type=_check_type, 371 ), 372 **{k: v for k, v in kwargs.items() if k in _OPENAPI_ENDPOINT_PARAMS}, 373 ) 374 375 @validate_and_convert_errors 376 def fetch(self, ids: List[str], namespace: Optional[str] = None, **kwargs) -> FetchResponse: 377 """ 378 The fetch operation looks up and returns vectors, by ID, from a single namespace. 379 The returned vectors include the vector data and/or metadata. 380 381 API reference: https://docs.pinecone.io/reference/fetch 382 383 Examples: 384 >>> index.fetch(ids=['id1', 'id2'], namespace='my_namespace') 385 >>> index.fetch(ids=['id1', 'id2']) 386 387 Args: 388 ids (List[str]): The vector IDs to fetch. 389 namespace (str): The namespace to fetch vectors from. 390 If not specified, the default namespace is used. [optional] 391 Keyword Args: 392 Supports OpenAPI client keyword arguments. See pinecone.core.client.models.FetchResponse for more details. 393 394 395 Returns: FetchResponse object which contains the list of Vector objects, and namespace name. 396 """ 397 args_dict = self._parse_non_empty_args([("namespace", namespace)]) 398 return self._vector_api.fetch(ids=ids, **args_dict, **kwargs) 399 400 @validate_and_convert_errors 401 def query( 402 self, 403 vector: Optional[List[float]] = None, 404 id: Optional[str] = None, 405 queries: Optional[Union[List[QueryVector], List[Tuple]]] = None, 406 top_k: Optional[int] = None, 407 namespace: Optional[str] = None, 408 filter: Optional[Dict[str, Union[str, float, int, bool, List, dict]]] = None, 409 include_values: Optional[bool] = None, 410 include_metadata: Optional[bool] = None, 411 sparse_vector: Optional[Union[SparseValues, Dict[str, Union[List[float], List[int]]]]] = None, 412 **kwargs, 413 ) -> QueryResponse: 414 """ 415 The Query operation searches a namespace, using a query vector. 416 It retrieves the ids of the most similar items in a namespace, along with their similarity scores. 417 418 API reference: https://docs.pinecone.io/reference/query 419 420 Examples: 421 >>> index.query(vector=[1, 2, 3], top_k=10, namespace='my_namespace') 422 >>> index.query(id='id1', top_k=10, namespace='my_namespace') 423 >>> index.query(vector=[1, 2, 3], top_k=10, namespace='my_namespace', filter={'key': 'value'}) 424 >>> index.query(id='id1', top_k=10, namespace='my_namespace', include_metadata=True, include_values=True) 425 >>> index.query(vector=[1, 2, 3], sparse_vector={'indices': [1, 2], 'values': [0.2, 0.4]}, 426 >>> top_k=10, namespace='my_namespace') 427 >>> index.query(vector=[1, 2, 3], sparse_vector=SparseValues([1, 2], [0.2, 0.4]), 428 >>> top_k=10, namespace='my_namespace') 429 430 Args: 431 vector (List[float]): The query vector. This should be the same length as the dimension of the index 432 being queried. Each `query()` request can contain only one of the parameters 433 `queries`, `id` or `vector`.. [optional] 434 id (str): The unique ID of the vector to be used as a query vector. 435 Each `query()` request can contain only one of the parameters 436 `queries`, `vector`, or `id`.. [optional] 437 queries ([QueryVector]): DEPRECATED. The query vectors. 438 Each `query()` request can contain only one of the parameters 439 `queries`, `vector`, or `id`.. [optional] 440 top_k (int): The number of results to return for each query. Must be an integer greater than 1. 441 namespace (str): The namespace to fetch vectors from. 442 If not specified, the default namespace is used. [optional] 443 filter (Dict[str, Union[str, float, int, bool, List, dict]): 444 The filter to apply. You can use vector metadata to limit your search. 445 See https://www.pinecone.io/docs/metadata-filtering/.. [optional] 446 include_values (bool): Indicates whether vector values are included in the response. 447 If omitted the server will use the default value of False [optional] 448 include_metadata (bool): Indicates whether metadata is included in the response as well as the ids. 449 If omitted the server will use the default value of False [optional] 450 sparse_vector: (Union[SparseValues, Dict[str, Union[List[float], List[int]]]]): sparse values of the query vector. 451 Expected to be either a SparseValues object or a dict of the form: 452 {'indices': List[int], 'values': List[float]}, where the lists each have the same length. 453 Keyword Args: 454 Supports OpenAPI client keyword arguments. See pinecone.core.client.models.QueryRequest for more details. 455 456 Returns: QueryResponse object which contains the list of the closest vectors as ScoredVector objects, 457 and namespace name. 458 """ 459 460 def _query_transform(item): 461 if isinstance(item, QueryVector): 462 return item 463 if isinstance(item, tuple): 464 values, filter = fix_tuple_length(item, 2) 465 if filter is None: 466 return QueryVector(values=values, _check_type=_check_type) 467 else: 468 return QueryVector(values=values, filter=filter, _check_type=_check_type) 469 if isinstance(item, Iterable): 470 return QueryVector(values=item, _check_type=_check_type) 471 raise ValueError(f"Invalid query vector value passed: cannot interpret type {type(item)}") 472 473 _check_type = kwargs.pop("_check_type", False) 474 queries = list(map(_query_transform, queries)) if queries is not None else None 475 476 sparse_vector = self._parse_sparse_values_arg(sparse_vector) 477 args_dict = self._parse_non_empty_args( 478 [ 479 ("vector", vector), 480 ("id", id), 481 ("queries", queries), 482 ("top_k", top_k), 483 ("namespace", namespace), 484 ("filter", filter), 485 ("include_values", include_values), 486 ("include_metadata", include_metadata), 487 ("sparse_vector", sparse_vector), 488 ] 489 ) 490 response = self._vector_api.query( 491 QueryRequest( 492 **args_dict, 493 _check_type=_check_type, 494 **{k: v for k, v in kwargs.items() if k not in _OPENAPI_ENDPOINT_PARAMS}, 495 ), 496 **{k: v for k, v in kwargs.items() if k in _OPENAPI_ENDPOINT_PARAMS}, 497 ) 498 return parse_query_response(response, vector is not None or id) 499 500 @validate_and_convert_errors 501 def update( 502 self, 503 id: str, 504 values: Optional[List[float]] = None, 505 set_metadata: Optional[Dict[str, Union[str, float, int, bool, List[int], List[float], List[str]]]] = None, 506 namespace: Optional[str] = None, 507 sparse_values: Optional[Union[SparseValues, Dict[str, Union[List[float], List[int]]]]] = None, 508 **kwargs, 509 ) -> Dict[str, Any]: 510 """ 511 The Update operation updates vector in a namespace. 512 If a value is included, it will overwrite the previous value. 513 If a set_metadata is included, 514 the values of the fields specified in it will be added or overwrite the previous value. 515 516 API reference: https://docs.pinecone.io/reference/update 517 518 Examples: 519 >>> index.update(id='id1', values=[1, 2, 3], namespace='my_namespace') 520 >>> index.update(id='id1', set_metadata={'key': 'value'}, namespace='my_namespace') 521 >>> index.update(id='id1', values=[1, 2, 3], sparse_values={'indices': [1, 2], 'values': [0.2, 0.4]}, 522 >>> namespace='my_namespace') 523 >>> index.update(id='id1', values=[1, 2, 3], sparse_values=SparseValues(indices=[1, 2], values=[0.2, 0.4]), 524 >>> namespace='my_namespace') 525 526 Args: 527 id (str): Vector's unique id. 528 values (List[float]): vector values to set. [optional] 529 set_metadata (Dict[str, Union[str, float, int, bool, List[int], List[float], List[str]]]]): 530 metadata to set for vector. [optional] 531 namespace (str): Namespace name where to update the vector.. [optional] 532 sparse_values: (Dict[str, Union[List[float], List[int]]]): sparse values to update for the vector. 533 Expected to be either a SparseValues object or a dict of the form: 534 {'indices': List[int], 'values': List[float]} where the lists each have the same length. 535 536 Keyword Args: 537 Supports OpenAPI client keyword arguments. See pinecone.core.client.models.UpdateRequest for more details. 538 539 Returns: An empty dictionary if the update was successful. 540 """ 541 _check_type = kwargs.pop("_check_type", False) 542 sparse_values = self._parse_sparse_values_arg(sparse_values) 543 args_dict = self._parse_non_empty_args( 544 [ 545 ("values", values), 546 ("set_metadata", set_metadata), 547 ("namespace", namespace), 548 ("sparse_values", sparse_values), 549 ] 550 ) 551 return self._vector_api.update( 552 UpdateRequest( 553 id=id, 554 **args_dict, 555 _check_type=_check_type, 556 **{k: v for k, v in kwargs.items() if k not in _OPENAPI_ENDPOINT_PARAMS}, 557 ), 558 **{k: v for k, v in kwargs.items() if k in _OPENAPI_ENDPOINT_PARAMS}, 559 ) 560 561 @validate_and_convert_errors 562 def describe_index_stats( 563 self, filter: Optional[Dict[str, Union[str, float, int, bool, List, dict]]] = None, **kwargs 564 ) -> DescribeIndexStatsResponse: 565 """ 566 The DescribeIndexStats operation returns statistics about the index's contents. 567 For example: The vector count per namespace and the number of dimensions. 568 569 API reference: https://docs.pinecone.io/reference/describe_index_stats_post 570 571 Examples: 572 >>> index.describe_index_stats() 573 >>> index.describe_index_stats(filter={'key': 'value'}) 574 575 Args: 576 filter (Dict[str, Union[str, float, int, bool, List, dict]]): 577 If this parameter is present, the operation only returns statistics for vectors that satisfy the filter. 578 See https://www.pinecone.io/docs/metadata-filtering/.. [optional] 579 580 Returns: DescribeIndexStatsResponse object which contains stats about the index. 581 """ 582 _check_type = kwargs.pop("_check_type", False) 583 args_dict = self._parse_non_empty_args([("filter", filter)]) 584 585 return self._vector_api.describe_index_stats( 586 DescribeIndexStatsRequest( 587 **args_dict, 588 **{k: v for k, v in kwargs.items() if k not in _OPENAPI_ENDPOINT_PARAMS}, 589 _check_type=_check_type, 590 ), 591 **{k: v for k, v in kwargs.items() if k in _OPENAPI_ENDPOINT_PARAMS}, 592 ) 593 594 @staticmethod 595 def _parse_non_empty_args(args: List[Tuple[str, Any]]) -> Dict[str, Any]: 596 return {arg_name: val for arg_name, val in args if val is not None} 597 598 @staticmethod 599 def _parse_sparse_values_arg( 600 sparse_values: Optional[Union[SparseValues, Dict[str, Union[List[float], List[int]]]]] 601 ) -> Optional[SparseValues]: 602 if sparse_values is None: 603 return None 604 605 if isinstance(sparse_values, SparseValues): 606 return sparse_values 607 608 if not isinstance(sparse_values, dict) or "indices" not in sparse_values or "values" not in sparse_values: 609 raise ValueError( 610 "Invalid sparse values argument. Expected a dict of: {'indices': List[int], 'values': List[float]}." 611 f"Received: {sparse_values}" 612 ) 613 614 return SparseValues(indices=sparse_values["indices"], values=sparse_values["values"])
A client for interacting with a Pinecone index via REST API. For improved performance, use the Pinecone GRPC index client.
92 def __init__(self, index_name: str, pool_threads=1): 93 openapi_client_config = copy.deepcopy(Config.OPENAPI_CONFIG) 94 openapi_client_config.api_key = openapi_client_config.api_key or {} 95 openapi_client_config.api_key["ApiKeyAuth"] = openapi_client_config.api_key.get("ApiKeyAuth", Config.API_KEY) 96 openapi_client_config.server_variables = openapi_client_config.server_variables or {} 97 openapi_client_config.server_variables = { 98 **{"environment": Config.ENVIRONMENT, "index_name": index_name, "project_name": Config.PROJECT_NAME}, 99 **openapi_client_config.server_variables, 100 } 101 super().__init__(configuration=openapi_client_config, pool_threads=pool_threads) 102 self.user_agent = get_user_agent() 103 self._vector_api = VectorOperationsApi(self)
105 @validate_and_convert_errors 106 def upsert( 107 self, 108 vectors: Union[List[Vector], List[tuple], List[dict]], 109 namespace: Optional[str] = None, 110 batch_size: Optional[int] = None, 111 show_progress: bool = True, 112 **kwargs, 113 ) -> UpsertResponse: 114 """ 115 The upsert operation writes vectors into a namespace. 116 If a new value is upserted for an existing vector id, it will overwrite the previous value. 117 118 To upsert in parallel follow: https://docs.pinecone.io/docs/insert-data#sending-upserts-in-parallel 119 120 A vector can be represented by a 1) Vector object, a 2) tuple or 3) a dictionary 121 122 If a tuple is used, it must be of the form `(id, values, metadata)` or `(id, values)`. 123 where id is a string, vector is a list of floats, metadata is a dict, 124 and sparse_values is a dict of the form `{'indices': List[int], 'values': List[float]}`. 125 126 Examples: 127 >>> ('id1', [1.0, 2.0, 3.0], {'key': 'value'}, {'indices': [1, 2], 'values': [0.2, 0.4]}) 128 >>> ('id1', [1.0, 2.0, 3.0], None, {'indices': [1, 2], 'values': [0.2, 0.4]}) 129 >>> ('id1', [1.0, 2.0, 3.0], {'key': 'value'}), ('id2', [1.0, 2.0, 3.0]) 130 131 If a Vector object is used, a Vector object must be of the form 132 `Vector(id, values, metadata, sparse_values)`, where metadata and sparse_values are optional 133 arguments. 134 135 Examples: 136 >>> Vector(id='id1', values=[1.0, 2.0, 3.0], metadata={'key': 'value'}) 137 >>> Vector(id='id2', values=[1.0, 2.0, 3.0]) 138 >>> Vector(id='id3', values=[1.0, 2.0, 3.0], sparse_values=SparseValues(indices=[1, 2], values=[0.2, 0.4])) 139 140 **Note:** the dimension of each vector must match the dimension of the index. 141 142 If a dictionary is used, it must be in the form `{'id': str, 'values': List[float], 'sparse_values': {'indices': List[int], 'values': List[float]}, 'metadata': dict}` 143 144 Examples: 145 >>> index.upsert([('id1', [1.0, 2.0, 3.0], {'key': 'value'}), ('id2', [1.0, 2.0, 3.0])]) 146 >>> 147 >>> index.upsert([{'id': 'id1', 'values': [1.0, 2.0, 3.0], 'metadata': {'key': 'value'}}, 148 >>> {'id': 'id2', 'values': [1.0, 2.0, 3.0], 'sparse_values': {'indices': [1, 8], 'values': [0.2, 0.4]}]) 149 >>> index.upsert([Vector(id='id1', values=[1.0, 2.0, 3.0], metadata={'key': 'value'}), 150 >>> Vector(id='id2', values=[1.0, 2.0, 3.0], sparse_values=SparseValues(indices=[1, 2], values=[0.2, 0.4]))]) 151 152 API reference: https://docs.pinecone.io/reference/upsert 153 154 Args: 155 vectors (Union[List[Vector], List[Tuple]]): A list of vectors to upsert. 156 namespace (str): The namespace to write to. If not specified, the default namespace is used. [optional] 157 batch_size (int): The number of vectors to upsert in each batch. 158 If not specified, all vectors will be upserted in a single batch. [optional] 159 show_progress (bool): Whether to show a progress bar using tqdm. 160 Applied only if batch_size is provided. Default is True. 161 Keyword Args: 162 Supports OpenAPI client keyword arguments. See pinecone.core.client.models.UpsertRequest for more details. 163 164 Returns: UpsertResponse, includes the number of vectors upserted. 165 """ 166 _check_type = kwargs.pop("_check_type", False) 167 168 if kwargs.get("async_req", False) and batch_size is not None: 169 raise ValueError( 170 "async_req is not supported when batch_size is provided." 171 "To upsert in parallel, please follow: " 172 "https://docs.pinecone.io/docs/insert-data#sending-upserts-in-parallel" 173 ) 174 175 if batch_size is None: 176 return self._upsert_batch(vectors, namespace, _check_type, **kwargs) 177 178 if not isinstance(batch_size, int) or batch_size <= 0: 179 raise ValueError("batch_size must be a positive integer") 180 181 pbar = tqdm(total=len(vectors), disable=not show_progress, desc="Upserted vectors") 182 total_upserted = 0 183 for i in range(0, len(vectors), batch_size): 184 batch_result = self._upsert_batch(vectors[i : i + batch_size], namespace, _check_type, **kwargs) 185 pbar.update(batch_result.upserted_count) 186 # we can't use here pbar.n for the case show_progress=False 187 total_upserted += batch_result.upserted_count 188 189 return UpsertResponse(upserted_count=total_upserted)
The upsert operation writes vectors into a namespace. If a new value is upserted for an existing vector id, it will overwrite the previous value.
To upsert in parallel follow: https://docs.pinecone.io/docs/insert-data#sending-upserts-in-parallel
A vector can be represented by a 1) Vector object, a 2) tuple or 3) a dictionary
If a tuple is used, it must be of the form (id, values, metadata) or (id, values).
where id is a string, vector is a list of floats, metadata is a dict,
and sparse_values is a dict of the form {'indices': List[int], 'values': List[float]}.
Examples:
>>> ('id1', [1.0, 2.0, 3.0], {'key': 'value'}, {'indices': [1, 2], 'values': [0.2, 0.4]}) >>> ('id1', [1.0, 2.0, 3.0], None, {'indices': [1, 2], 'values': [0.2, 0.4]}) >>> ('id1', [1.0, 2.0, 3.0], {'key': 'value'}), ('id2', [1.0, 2.0, 3.0])
If a Vector object is used, a Vector object must be of the form
Vector(id, values, metadata, sparse_values), where metadata and sparse_values are optional
arguments.
Examples:
>>> Vector(id='id1', values=[1.0, 2.0, 3.0], metadata={'key': 'value'}) >>> Vector(id='id2', values=[1.0, 2.0, 3.0]) >>> Vector(id='id3', values=[1.0, 2.0, 3.0], sparse_values=SparseValues(indices=[1, 2], values=[0.2, 0.4]))
Note: the dimension of each vector must match the dimension of the index.
If a dictionary is used, it must be in the form {'id': str, 'values': List[float], 'sparse_values': {'indices': List[int], 'values': List[float]}, 'metadata': dict}
Examples:
>>> index.upsert([('id1', [1.0, 2.0, 3.0], {'key': 'value'}), ('id2', [1.0, 2.0, 3.0])]) >>> >>> index.upsert([{'id': 'id1', 'values': [1.0, 2.0, 3.0], 'metadata': {'key': 'value'}}, >>> {'id': 'id2', 'values': [1.0, 2.0, 3.0], 'sparse_values': {'indices': [1, 8], 'values': [0.2, 0.4]}]) >>> index.upsert([Vector(id='id1', values=[1.0, 2.0, 3.0], metadata={'key': 'value'}), >>> Vector(id='id2', values=[1.0, 2.0, 3.0], sparse_values=SparseValues(indices=[1, 2], values=[0.2, 0.4]))])
API reference: https://docs.pinecone.io/reference/upsert
Arguments:
- vectors (Union[List[Vector], List[Tuple]]): A list of vectors to upsert.
- namespace (str): The namespace to write to. If not specified, the default namespace is used. [optional]
- batch_size (int): The number of vectors to upsert in each batch. If not specified, all vectors will be upserted in a single batch. [optional]
- show_progress (bool): Whether to show a progress bar using tqdm. Applied only if batch_size is provided. Default is True.
Keyword Args:
Supports OpenAPI client keyword arguments. See pinecone.core.client.models.UpsertRequest for more details.
Returns: UpsertResponse, includes the number of vectors upserted.
283 def upsert_from_dataframe( 284 self, df, namespace: str = None, batch_size: int = 500, show_progress: bool = True 285 ) -> UpsertResponse: 286 """Upserts a dataframe into the index. 287 288 Args: 289 df: A pandas dataframe with the following columns: id, vector, sparse_values, and metadata. 290 namespace: The namespace to upsert into. 291 batch_size: The number of rows to upsert in a single batch. 292 show_progress: Whether to show a progress bar. 293 """ 294 try: 295 import pandas as pd 296 except ImportError: 297 raise RuntimeError( 298 "The `pandas` package is not installed. Please install pandas to use `upsert_from_dataframe()`" 299 ) 300 301 if not isinstance(df, pd.DataFrame): 302 raise ValueError(f"Only pandas dataframes are supported. Found: {type(df)}") 303 304 pbar = tqdm(total=len(df), disable=not show_progress, desc="sending upsert requests") 305 results = [] 306 for chunk in self._iter_dataframe(df, batch_size=batch_size): 307 res = self.upsert(vectors=chunk, namespace=namespace) 308 pbar.update(len(chunk)) 309 results.append(res) 310 311 upserted_count = 0 312 for res in results: 313 upserted_count += res.upserted_count 314 315 return UpsertResponse(upserted_count=upserted_count)
Upserts a dataframe into the index.
Arguments:
- df: A pandas dataframe with the following columns: id, vector, sparse_values, and metadata.
- namespace: The namespace to upsert into.
- batch_size: The number of rows to upsert in a single batch.
- show_progress: Whether to show a progress bar.
317 @validate_and_convert_errors 318 def delete( 319 self, 320 ids: Optional[List[str]] = None, 321 delete_all: Optional[bool] = None, 322 namespace: Optional[str] = None, 323 filter: Optional[Dict[str, Union[str, float, int, bool, List, dict]]] = None, 324 **kwargs, 325 ) -> Dict[str, Any]: 326 """ 327 The Delete operation deletes vectors from the index, from a single namespace. 328 No error raised if the vector id does not exist. 329 Note: for any delete call, if namespace is not specified, the default namespace is used. 330 331 Delete can occur in the following mutual exclusive ways: 332 1. Delete by ids from a single namespace 333 2. Delete all vectors from a single namespace by setting delete_all to True 334 3. Delete all vectors from a single namespace by specifying a metadata filter 335 (note that for this option delete all must be set to False) 336 337 API reference: https://docs.pinecone.io/reference/delete_post 338 339 Examples: 340 >>> index.delete(ids=['id1', 'id2'], namespace='my_namespace') 341 >>> index.delete(delete_all=True, namespace='my_namespace') 342 >>> index.delete(filter={'key': 'value'}, namespace='my_namespace') 343 344 Args: 345 ids (List[str]): Vector ids to delete [optional] 346 delete_all (bool): This indicates that all vectors in the index namespace should be deleted.. [optional] 347 Default is False. 348 namespace (str): The namespace to delete vectors from [optional] 349 If not specified, the default namespace is used. 350 filter (Dict[str, Union[str, float, int, bool, List, dict]]): 351 If specified, the metadata filter here will be used to select the vectors to delete. 352 This is mutually exclusive with specifying ids to delete in the ids param or using delete_all=True. 353 See https://www.pinecone.io/docs/metadata-filtering/.. [optional] 354 355 Keyword Args: 356 Supports OpenAPI client keyword arguments. See pinecone.core.client.models.DeleteRequest for more details. 357 358 359 Returns: An empty dictionary if the delete operation was successful. 360 """ 361 _check_type = kwargs.pop("_check_type", False) 362 args_dict = self._parse_non_empty_args( 363 [("ids", ids), ("delete_all", delete_all), ("namespace", namespace), ("filter", filter)] 364 ) 365 366 return self._vector_api.delete( 367 DeleteRequest( 368 **args_dict, 369 **{k: v for k, v in kwargs.items() if k not in _OPENAPI_ENDPOINT_PARAMS and v is not None}, 370 _check_type=_check_type, 371 ), 372 **{k: v for k, v in kwargs.items() if k in _OPENAPI_ENDPOINT_PARAMS}, 373 )
The Delete operation deletes vectors from the index, from a single namespace. No error raised if the vector id does not exist. Note: for any delete call, if namespace is not specified, the default namespace is used.
Delete can occur in the following mutual exclusive ways:
- Delete by ids from a single namespace
- Delete all vectors from a single namespace by setting delete_all to True
- Delete all vectors from a single namespace by specifying a metadata filter (note that for this option delete all must be set to False)
API reference: https://docs.pinecone.io/reference/delete_post
Examples:
>>> index.delete(ids=['id1', 'id2'], namespace='my_namespace') >>> index.delete(delete_all=True, namespace='my_namespace') >>> index.delete(filter={'key': 'value'}, namespace='my_namespace')
Arguments:
- ids (List[str]): Vector ids to delete [optional]
- delete_all (bool): This indicates that all vectors in the index namespace should be deleted.. [optional] Default is False.
- namespace (str): The namespace to delete vectors from [optional] If not specified, the default namespace is used.
- filter (Dict[str, Union[str, float, int, bool, List, dict]]): If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive with specifying ids to delete in the ids param or using delete_all=True. See https://www.pinecone.io/docs/metadata-filtering/.. [optional]
Keyword Args:
Supports OpenAPI client keyword arguments. See pinecone.core.client.models.DeleteRequest for more details.
Returns: An empty dictionary if the delete operation was successful.
375 @validate_and_convert_errors 376 def fetch(self, ids: List[str], namespace: Optional[str] = None, **kwargs) -> FetchResponse: 377 """ 378 The fetch operation looks up and returns vectors, by ID, from a single namespace. 379 The returned vectors include the vector data and/or metadata. 380 381 API reference: https://docs.pinecone.io/reference/fetch 382 383 Examples: 384 >>> index.fetch(ids=['id1', 'id2'], namespace='my_namespace') 385 >>> index.fetch(ids=['id1', 'id2']) 386 387 Args: 388 ids (List[str]): The vector IDs to fetch. 389 namespace (str): The namespace to fetch vectors from. 390 If not specified, the default namespace is used. [optional] 391 Keyword Args: 392 Supports OpenAPI client keyword arguments. See pinecone.core.client.models.FetchResponse for more details. 393 394 395 Returns: FetchResponse object which contains the list of Vector objects, and namespace name. 396 """ 397 args_dict = self._parse_non_empty_args([("namespace", namespace)]) 398 return self._vector_api.fetch(ids=ids, **args_dict, **kwargs)
The fetch operation looks up and returns vectors, by ID, from a single namespace. The returned vectors include the vector data and/or metadata.
API reference: https://docs.pinecone.io/reference/fetch
Examples:
>>> index.fetch(ids=['id1', 'id2'], namespace='my_namespace') >>> index.fetch(ids=['id1', 'id2'])
Arguments:
- ids (List[str]): The vector IDs to fetch.
- namespace (str): The namespace to fetch vectors from. If not specified, the default namespace is used. [optional]
Keyword Args:
Supports OpenAPI client keyword arguments. See pinecone.core.client.models.FetchResponse for more details.
Returns: FetchResponse object which contains the list of Vector objects, and namespace name.
400 @validate_and_convert_errors 401 def query( 402 self, 403 vector: Optional[List[float]] = None, 404 id: Optional[str] = None, 405 queries: Optional[Union[List[QueryVector], List[Tuple]]] = None, 406 top_k: Optional[int] = None, 407 namespace: Optional[str] = None, 408 filter: Optional[Dict[str, Union[str, float, int, bool, List, dict]]] = None, 409 include_values: Optional[bool] = None, 410 include_metadata: Optional[bool] = None, 411 sparse_vector: Optional[Union[SparseValues, Dict[str, Union[List[float], List[int]]]]] = None, 412 **kwargs, 413 ) -> QueryResponse: 414 """ 415 The Query operation searches a namespace, using a query vector. 416 It retrieves the ids of the most similar items in a namespace, along with their similarity scores. 417 418 API reference: https://docs.pinecone.io/reference/query 419 420 Examples: 421 >>> index.query(vector=[1, 2, 3], top_k=10, namespace='my_namespace') 422 >>> index.query(id='id1', top_k=10, namespace='my_namespace') 423 >>> index.query(vector=[1, 2, 3], top_k=10, namespace='my_namespace', filter={'key': 'value'}) 424 >>> index.query(id='id1', top_k=10, namespace='my_namespace', include_metadata=True, include_values=True) 425 >>> index.query(vector=[1, 2, 3], sparse_vector={'indices': [1, 2], 'values': [0.2, 0.4]}, 426 >>> top_k=10, namespace='my_namespace') 427 >>> index.query(vector=[1, 2, 3], sparse_vector=SparseValues([1, 2], [0.2, 0.4]), 428 >>> top_k=10, namespace='my_namespace') 429 430 Args: 431 vector (List[float]): The query vector. This should be the same length as the dimension of the index 432 being queried. Each `query()` request can contain only one of the parameters 433 `queries`, `id` or `vector`.. [optional] 434 id (str): The unique ID of the vector to be used as a query vector. 435 Each `query()` request can contain only one of the parameters 436 `queries`, `vector`, or `id`.. [optional] 437 queries ([QueryVector]): DEPRECATED. The query vectors. 438 Each `query()` request can contain only one of the parameters 439 `queries`, `vector`, or `id`.. [optional] 440 top_k (int): The number of results to return for each query. Must be an integer greater than 1. 441 namespace (str): The namespace to fetch vectors from. 442 If not specified, the default namespace is used. [optional] 443 filter (Dict[str, Union[str, float, int, bool, List, dict]): 444 The filter to apply. You can use vector metadata to limit your search. 445 See https://www.pinecone.io/docs/metadata-filtering/.. [optional] 446 include_values (bool): Indicates whether vector values are included in the response. 447 If omitted the server will use the default value of False [optional] 448 include_metadata (bool): Indicates whether metadata is included in the response as well as the ids. 449 If omitted the server will use the default value of False [optional] 450 sparse_vector: (Union[SparseValues, Dict[str, Union[List[float], List[int]]]]): sparse values of the query vector. 451 Expected to be either a SparseValues object or a dict of the form: 452 {'indices': List[int], 'values': List[float]}, where the lists each have the same length. 453 Keyword Args: 454 Supports OpenAPI client keyword arguments. See pinecone.core.client.models.QueryRequest for more details. 455 456 Returns: QueryResponse object which contains the list of the closest vectors as ScoredVector objects, 457 and namespace name. 458 """ 459 460 def _query_transform(item): 461 if isinstance(item, QueryVector): 462 return item 463 if isinstance(item, tuple): 464 values, filter = fix_tuple_length(item, 2) 465 if filter is None: 466 return QueryVector(values=values, _check_type=_check_type) 467 else: 468 return QueryVector(values=values, filter=filter, _check_type=_check_type) 469 if isinstance(item, Iterable): 470 return QueryVector(values=item, _check_type=_check_type) 471 raise ValueError(f"Invalid query vector value passed: cannot interpret type {type(item)}") 472 473 _check_type = kwargs.pop("_check_type", False) 474 queries = list(map(_query_transform, queries)) if queries is not None else None 475 476 sparse_vector = self._parse_sparse_values_arg(sparse_vector) 477 args_dict = self._parse_non_empty_args( 478 [ 479 ("vector", vector), 480 ("id", id), 481 ("queries", queries), 482 ("top_k", top_k), 483 ("namespace", namespace), 484 ("filter", filter), 485 ("include_values", include_values), 486 ("include_metadata", include_metadata), 487 ("sparse_vector", sparse_vector), 488 ] 489 ) 490 response = self._vector_api.query( 491 QueryRequest( 492 **args_dict, 493 _check_type=_check_type, 494 **{k: v for k, v in kwargs.items() if k not in _OPENAPI_ENDPOINT_PARAMS}, 495 ), 496 **{k: v for k, v in kwargs.items() if k in _OPENAPI_ENDPOINT_PARAMS}, 497 ) 498 return parse_query_response(response, vector is not None or id)
The Query operation searches a namespace, using a query vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores.
API reference: https://docs.pinecone.io/reference/query
Examples:
>>> index.query(vector=[1, 2, 3], top_k=10, namespace='my_namespace') >>> index.query(id='id1', top_k=10, namespace='my_namespace') >>> index.query(vector=[1, 2, 3], top_k=10, namespace='my_namespace', filter={'key': 'value'}) >>> index.query(id='id1', top_k=10, namespace='my_namespace', include_metadata=True, include_values=True) >>> index.query(vector=[1, 2, 3], sparse_vector={'indices': [1, 2], 'values': [0.2, 0.4]}, >>> top_k=10, namespace='my_namespace') >>> index.query(vector=[1, 2, 3], sparse_vector=SparseValues([1, 2], [0.2, 0.4]), >>> top_k=10, namespace='my_namespace')
Arguments:
- vector (List[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 parametersqueries,idorvector.. [optional] - id (str): The unique ID of the vector to be used as a query vector.
Each
query()request can contain only one of the parametersqueries,vector, orid.. [optional] - queries ([QueryVector]): DEPRECATED. The query vectors.
Each
query()request can contain only one of the parametersqueries,vector, orid.. [optional] - top_k (int): The number of results to return for each query. Must be an integer greater than 1.
- namespace (str): The namespace to fetch vectors from. If not specified, the default namespace is used. [optional]
- filter (Dict[str, Union[str, float, int, bool, List, dict]): The filter to apply. You can use vector metadata to limit your search. See https://www.pinecone.io/docs/metadata-filtering/.. [optional]
- include_values (bool): Indicates whether vector values are included in the response. If omitted the server will use the default value of False [optional]
- include_metadata (bool): Indicates whether metadata is included in the response as well as the ids. If omitted the server will use the default value of False [optional]
- sparse_vector: (Union[SparseValues, Dict[str, Union[List[float], List[int]]]]): sparse values of the query vector. Expected to be either a SparseValues object or a dict of the form: {'indices': List[int], 'values': List[float]}, where the lists each have the same length.
Keyword Args:
Supports OpenAPI client keyword arguments. See pinecone.core.client.models.QueryRequest for more details.
Returns: QueryResponse object which contains the list of the closest vectors as ScoredVector objects, and namespace name.
500 @validate_and_convert_errors 501 def update( 502 self, 503 id: str, 504 values: Optional[List[float]] = None, 505 set_metadata: Optional[Dict[str, Union[str, float, int, bool, List[int], List[float], List[str]]]] = None, 506 namespace: Optional[str] = None, 507 sparse_values: Optional[Union[SparseValues, Dict[str, Union[List[float], List[int]]]]] = None, 508 **kwargs, 509 ) -> Dict[str, Any]: 510 """ 511 The Update operation updates vector in a namespace. 512 If a value is included, it will overwrite the previous value. 513 If a set_metadata is included, 514 the values of the fields specified in it will be added or overwrite the previous value. 515 516 API reference: https://docs.pinecone.io/reference/update 517 518 Examples: 519 >>> index.update(id='id1', values=[1, 2, 3], namespace='my_namespace') 520 >>> index.update(id='id1', set_metadata={'key': 'value'}, namespace='my_namespace') 521 >>> index.update(id='id1', values=[1, 2, 3], sparse_values={'indices': [1, 2], 'values': [0.2, 0.4]}, 522 >>> namespace='my_namespace') 523 >>> index.update(id='id1', values=[1, 2, 3], sparse_values=SparseValues(indices=[1, 2], values=[0.2, 0.4]), 524 >>> namespace='my_namespace') 525 526 Args: 527 id (str): Vector's unique id. 528 values (List[float]): vector values to set. [optional] 529 set_metadata (Dict[str, Union[str, float, int, bool, List[int], List[float], List[str]]]]): 530 metadata to set for vector. [optional] 531 namespace (str): Namespace name where to update the vector.. [optional] 532 sparse_values: (Dict[str, Union[List[float], List[int]]]): sparse values to update for the vector. 533 Expected to be either a SparseValues object or a dict of the form: 534 {'indices': List[int], 'values': List[float]} where the lists each have the same length. 535 536 Keyword Args: 537 Supports OpenAPI client keyword arguments. See pinecone.core.client.models.UpdateRequest for more details. 538 539 Returns: An empty dictionary if the update was successful. 540 """ 541 _check_type = kwargs.pop("_check_type", False) 542 sparse_values = self._parse_sparse_values_arg(sparse_values) 543 args_dict = self._parse_non_empty_args( 544 [ 545 ("values", values), 546 ("set_metadata", set_metadata), 547 ("namespace", namespace), 548 ("sparse_values", sparse_values), 549 ] 550 ) 551 return self._vector_api.update( 552 UpdateRequest( 553 id=id, 554 **args_dict, 555 _check_type=_check_type, 556 **{k: v for k, v in kwargs.items() if k not in _OPENAPI_ENDPOINT_PARAMS}, 557 ), 558 **{k: v for k, v in kwargs.items() if k in _OPENAPI_ENDPOINT_PARAMS}, 559 )
The Update operation updates vector in a namespace. If a value is included, it will overwrite the previous value. If a set_metadata is included, the values of the fields specified in it will be added or overwrite the previous value.
API reference: https://docs.pinecone.io/reference/update
Examples:
>>> index.update(id='id1', values=[1, 2, 3], namespace='my_namespace') >>> index.update(id='id1', set_metadata={'key': 'value'}, namespace='my_namespace') >>> index.update(id='id1', values=[1, 2, 3], sparse_values={'indices': [1, 2], 'values': [0.2, 0.4]}, >>> namespace='my_namespace') >>> index.update(id='id1', values=[1, 2, 3], sparse_values=SparseValues(indices=[1, 2], values=[0.2, 0.4]), >>> namespace='my_namespace')
Arguments:
- id (str): Vector's unique id.
- values (List[float]): vector values to set. [optional]
- set_metadata (Dict[str, Union[str, float, int, bool, List[int], List[float], List[str]]]]): metadata to set for vector. [optional]
- namespace (str): Namespace name where to update the vector.. [optional]
- sparse_values: (Dict[str, Union[List[float], List[int]]]): sparse values to update for the vector. Expected to be either a SparseValues object or a dict of the form: {'indices': List[int], 'values': List[float]} where the lists each have the same length.
Keyword Args:
Supports OpenAPI client keyword arguments. See pinecone.core.client.models.UpdateRequest for more details.
Returns: An empty dictionary if the update was successful.
561 @validate_and_convert_errors 562 def describe_index_stats( 563 self, filter: Optional[Dict[str, Union[str, float, int, bool, List, dict]]] = None, **kwargs 564 ) -> DescribeIndexStatsResponse: 565 """ 566 The DescribeIndexStats operation returns statistics about the index's contents. 567 For example: The vector count per namespace and the number of dimensions. 568 569 API reference: https://docs.pinecone.io/reference/describe_index_stats_post 570 571 Examples: 572 >>> index.describe_index_stats() 573 >>> index.describe_index_stats(filter={'key': 'value'}) 574 575 Args: 576 filter (Dict[str, Union[str, float, int, bool, List, dict]]): 577 If this parameter is present, the operation only returns statistics for vectors that satisfy the filter. 578 See https://www.pinecone.io/docs/metadata-filtering/.. [optional] 579 580 Returns: DescribeIndexStatsResponse object which contains stats about the index. 581 """ 582 _check_type = kwargs.pop("_check_type", False) 583 args_dict = self._parse_non_empty_args([("filter", filter)]) 584 585 return self._vector_api.describe_index_stats( 586 DescribeIndexStatsRequest( 587 **args_dict, 588 **{k: v for k, v in kwargs.items() if k not in _OPENAPI_ENDPOINT_PARAMS}, 589 _check_type=_check_type, 590 ), 591 **{k: v for k, v in kwargs.items() if k in _OPENAPI_ENDPOINT_PARAMS}, 592 )
The DescribeIndexStats operation returns statistics about the index's contents. For example: The vector count per namespace and the number of dimensions.
API reference: https://docs.pinecone.io/reference/describe_index_stats_post
Examples:
>>> index.describe_index_stats() >>> index.describe_index_stats(filter={'key': 'value'})
Arguments:
- filter (Dict[str, Union[str, float, int, bool, List, dict]]):
- If this parameter is present, the operation only returns statistics for vectors that satisfy the filter.
- See https: //www.pinecone.io/docs/metadata-filtering/.. [optional]
Returns: DescribeIndexStatsResponse object which contains stats about the index.
Inherited Members
- pinecone.core.client.api_client.ApiClient
- configuration
- pool_threads
- rest_client
- default_headers
- close
- pool
- set_default_header
- parameters_to_multipart
- sanitize_for_serialization
- deserialize
- call_api
- request
- parameters_to_tuples
- get_file_data_and_close_file
- files_parameters
- select_header_accept
- select_header_content_type
- update_params_for_auth
40class FetchResponse(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 68 @cached_property 69 def additional_properties_type(): 70 """ 71 This must be a method because a model may have properties that are 72 of type self, this must run after the class is loaded 73 """ 74 lazy_import() 75 return ( 76 bool, 77 date, 78 datetime, 79 dict, 80 float, 81 int, 82 list, 83 str, 84 none_type, 85 ) # noqa: E501 86 87 _nullable = False 88 89 @cached_property 90 def openapi_types(): 91 """ 92 This must be a method because a model may have properties that are 93 of type self, this must run after the class is loaded 94 95 Returns 96 openapi_types (dict): The key is attribute name 97 and the value is attribute type. 98 """ 99 lazy_import() 100 return { 101 "vectors": ({str: (Vector,)},), # noqa: E501 102 "namespace": (str,), # noqa: E501 103 } 104 105 @cached_property 106 def discriminator(): 107 return None 108 109 attribute_map = { 110 "vectors": "vectors", # noqa: E501 111 "namespace": "namespace", # noqa: E501 112 } 113 114 read_only_vars = {} 115 116 _composed_schemas = {} 117 118 @classmethod 119 @convert_js_args_to_python_args 120 def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 121 """FetchResponse - a model defined in OpenAPI 122 123 Keyword Args: 124 _check_type (bool): if True, values for parameters in openapi_types 125 will be type checked and a TypeError will be 126 raised if the wrong type is input. 127 Defaults to True 128 _path_to_item (tuple/list): This is a list of keys or values to 129 drill down to the model in received_data 130 when deserializing a response 131 _spec_property_naming (bool): True if the variable names in the input data 132 are serialized names, as specified in the OpenAPI document. 133 False if the variable names in the input data 134 are pythonic names, e.g. snake case (default) 135 _configuration (Configuration): the instance to use when 136 deserializing a file_type parameter. 137 If passed, type conversion is attempted 138 If omitted no type conversion is done. 139 _visited_composed_classes (tuple): This stores a tuple of 140 classes that we have traveled through so that 141 if we see that class again we will not use its 142 discriminator again. 143 When traveling through a discriminator, the 144 composed schema that is 145 is traveled through is added to this set. 146 For example if Animal has a discriminator 147 petType and we pass in "Dog", and the class Dog 148 allOf includes Animal, we move through Animal 149 once using the discriminator, and pick Dog. 150 Then in Dog, we will make an instance of the 151 Animal class but this time we won't travel 152 through its discriminator because we passed in 153 _visited_composed_classes = (Animal,) 154 vectors ({str: (Vector,)}): [optional] # noqa: E501 155 namespace (str): The namespace of the vectors.. [optional] # noqa: E501 156 """ 157 158 _check_type = kwargs.pop("_check_type", True) 159 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 160 _path_to_item = kwargs.pop("_path_to_item", ()) 161 _configuration = kwargs.pop("_configuration", None) 162 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 163 164 self = super(OpenApiModel, cls).__new__(cls) 165 166 if args: 167 raise ApiTypeError( 168 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 169 % ( 170 args, 171 self.__class__.__name__, 172 ), 173 path_to_item=_path_to_item, 174 valid_classes=(self.__class__,), 175 ) 176 177 self._data_store = {} 178 self._check_type = _check_type 179 self._spec_property_naming = _spec_property_naming 180 self._path_to_item = _path_to_item 181 self._configuration = _configuration 182 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 183 184 for var_name, var_value in kwargs.items(): 185 if ( 186 var_name not in self.attribute_map 187 and self._configuration is not None 188 and self._configuration.discard_unknown_keys 189 and self.additional_properties_type is None 190 ): 191 # discard variable. 192 continue 193 setattr(self, var_name, var_value) 194 return self 195 196 required_properties = set( 197 [ 198 "_data_store", 199 "_check_type", 200 "_spec_property_naming", 201 "_path_to_item", 202 "_configuration", 203 "_visited_composed_classes", 204 ] 205 ) 206 207 @convert_js_args_to_python_args 208 def __init__(self, *args, **kwargs): # noqa: E501 209 """FetchResponse - a model defined in OpenAPI 210 211 Keyword Args: 212 _check_type (bool): if True, values for parameters in openapi_types 213 will be type checked and a TypeError will be 214 raised if the wrong type is input. 215 Defaults to True 216 _path_to_item (tuple/list): This is a list of keys or values to 217 drill down to the model in received_data 218 when deserializing a response 219 _spec_property_naming (bool): True if the variable names in the input data 220 are serialized names, as specified in the OpenAPI document. 221 False if the variable names in the input data 222 are pythonic names, e.g. snake case (default) 223 _configuration (Configuration): the instance to use when 224 deserializing a file_type parameter. 225 If passed, type conversion is attempted 226 If omitted no type conversion is done. 227 _visited_composed_classes (tuple): This stores a tuple of 228 classes that we have traveled through so that 229 if we see that class again we will not use its 230 discriminator again. 231 When traveling through a discriminator, the 232 composed schema that is 233 is traveled through is added to this set. 234 For example if Animal has a discriminator 235 petType and we pass in "Dog", and the class Dog 236 allOf includes Animal, we move through Animal 237 once using the discriminator, and pick Dog. 238 Then in Dog, we will make an instance of the 239 Animal class but this time we won't travel 240 through its discriminator because we passed in 241 _visited_composed_classes = (Animal,) 242 vectors ({str: (Vector,)}): [optional] # noqa: E501 243 namespace (str): The namespace of the vectors.. [optional] # noqa: E501 244 """ 245 246 _check_type = kwargs.pop("_check_type", True) 247 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 248 _path_to_item = kwargs.pop("_path_to_item", ()) 249 _configuration = kwargs.pop("_configuration", None) 250 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 251 252 if args: 253 raise ApiTypeError( 254 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 255 % ( 256 args, 257 self.__class__.__name__, 258 ), 259 path_to_item=_path_to_item, 260 valid_classes=(self.__class__,), 261 ) 262 263 self._data_store = {} 264 self._check_type = _check_type 265 self._spec_property_naming = _spec_property_naming 266 self._path_to_item = _path_to_item 267 self._configuration = _configuration 268 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 269 270 for var_name, var_value in kwargs.items(): 271 if ( 272 var_name not in self.attribute_map 273 and self._configuration is not None 274 and self._configuration.discard_unknown_keys 275 and self.additional_properties_type is None 276 ): 277 # discard variable. 278 continue 279 setattr(self, var_name, var_value) 280 if var_name in self.read_only_vars: 281 raise ApiAttributeError( 282 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 283 f"class with read only attributes." 284 )
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.
207 @convert_js_args_to_python_args 208 def __init__(self, *args, **kwargs): # noqa: E501 209 """FetchResponse - a model defined in OpenAPI 210 211 Keyword Args: 212 _check_type (bool): if True, values for parameters in openapi_types 213 will be type checked and a TypeError will be 214 raised if the wrong type is input. 215 Defaults to True 216 _path_to_item (tuple/list): This is a list of keys or values to 217 drill down to the model in received_data 218 when deserializing a response 219 _spec_property_naming (bool): True if the variable names in the input data 220 are serialized names, as specified in the OpenAPI document. 221 False if the variable names in the input data 222 are pythonic names, e.g. snake case (default) 223 _configuration (Configuration): the instance to use when 224 deserializing a file_type parameter. 225 If passed, type conversion is attempted 226 If omitted no type conversion is done. 227 _visited_composed_classes (tuple): This stores a tuple of 228 classes that we have traveled through so that 229 if we see that class again we will not use its 230 discriminator again. 231 When traveling through a discriminator, the 232 composed schema that is 233 is traveled through is added to this set. 234 For example if Animal has a discriminator 235 petType and we pass in "Dog", and the class Dog 236 allOf includes Animal, we move through Animal 237 once using the discriminator, and pick Dog. 238 Then in Dog, we will make an instance of the 239 Animal class but this time we won't travel 240 through its discriminator because we passed in 241 _visited_composed_classes = (Animal,) 242 vectors ({str: (Vector,)}): [optional] # noqa: E501 243 namespace (str): The namespace of the vectors.. [optional] # noqa: E501 244 """ 245 246 _check_type = kwargs.pop("_check_type", True) 247 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 248 _path_to_item = kwargs.pop("_path_to_item", ()) 249 _configuration = kwargs.pop("_configuration", None) 250 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 251 252 if args: 253 raise ApiTypeError( 254 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 255 % ( 256 args, 257 self.__class__.__name__, 258 ), 259 path_to_item=_path_to_item, 260 valid_classes=(self.__class__,), 261 ) 262 263 self._data_store = {} 264 self._check_type = _check_type 265 self._spec_property_naming = _spec_property_naming 266 self._path_to_item = _path_to_item 267 self._configuration = _configuration 268 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 269 270 for var_name, var_value in kwargs.items(): 271 if ( 272 var_name not in self.attribute_map 273 and self._configuration is not None 274 and self._configuration.discard_unknown_keys 275 and self.additional_properties_type is None 276 ): 277 # discard variable. 278 continue 279 setattr(self, var_name, var_value) 280 if var_name in self.read_only_vars: 281 raise ApiAttributeError( 282 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 283 f"class with read only attributes." 284 )
FetchResponse - 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,) vectors ({str: (Vector,)}): [optional] # noqa: E501 namespace (str): The namespace of 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.
34class ProtobufAny(ModelNormal): 35 """NOTE: This class is auto generated by OpenAPI Generator. 36 Ref: https://openapi-generator.tech 37 38 Do not edit the class manually. 39 40 Attributes: 41 allowed_values (dict): The key is the tuple path to the attribute 42 and the for var_name this is (var_name,). The value is a dict 43 with a capitalized key describing the allowed value and an allowed 44 value. These dicts store the allowed enum values. 45 attribute_map (dict): The key is attribute name 46 and the value is json key in definition. 47 discriminator_value_class_map (dict): A dict to go from the discriminator 48 variable value to the discriminator class name. 49 validations (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 that stores validations for max_length, min_length, max_items, 52 min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, 53 inclusive_minimum, and regex. 54 additional_properties_type (tuple): A tuple of classes accepted 55 as additional properties values. 56 """ 57 58 allowed_values = {} 59 60 validations = {} 61 62 @cached_property 63 def additional_properties_type(): 64 """ 65 This must be a method because a model may have properties that are 66 of type self, this must run after the class is loaded 67 """ 68 return ( 69 bool, 70 date, 71 datetime, 72 dict, 73 float, 74 int, 75 list, 76 str, 77 none_type, 78 ) # noqa: E501 79 80 _nullable = False 81 82 @cached_property 83 def openapi_types(): 84 """ 85 This must be a method because a model may have properties that are 86 of type self, this must run after the class is loaded 87 88 Returns 89 openapi_types (dict): The key is attribute name 90 and the value is attribute type. 91 """ 92 return { 93 "type_url": (str,), # noqa: E501 94 "value": (str,), # noqa: E501 95 } 96 97 @cached_property 98 def discriminator(): 99 return None 100 101 attribute_map = { 102 "type_url": "typeUrl", # noqa: E501 103 "value": "value", # noqa: E501 104 } 105 106 read_only_vars = {} 107 108 _composed_schemas = {} 109 110 @classmethod 111 @convert_js_args_to_python_args 112 def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 113 """ProtobufAny - a model defined in OpenAPI 114 115 Keyword Args: 116 _check_type (bool): if True, values for parameters in openapi_types 117 will be type checked and a TypeError will be 118 raised if the wrong type is input. 119 Defaults to True 120 _path_to_item (tuple/list): This is a list of keys or values to 121 drill down to the model in received_data 122 when deserializing a response 123 _spec_property_naming (bool): True if the variable names in the input data 124 are serialized names, as specified in the OpenAPI document. 125 False if the variable names in the input data 126 are pythonic names, e.g. snake case (default) 127 _configuration (Configuration): the instance to use when 128 deserializing a file_type parameter. 129 If passed, type conversion is attempted 130 If omitted no type conversion is done. 131 _visited_composed_classes (tuple): This stores a tuple of 132 classes that we have traveled through so that 133 if we see that class again we will not use its 134 discriminator again. 135 When traveling through a discriminator, the 136 composed schema that is 137 is traveled through is added to this set. 138 For example if Animal has a discriminator 139 petType and we pass in "Dog", and the class Dog 140 allOf includes Animal, we move through Animal 141 once using the discriminator, and pick Dog. 142 Then in Dog, we will make an instance of the 143 Animal class but this time we won't travel 144 through its discriminator because we passed in 145 _visited_composed_classes = (Animal,) 146 type_url (str): [optional] # noqa: E501 147 value (str): [optional] # noqa: E501 148 """ 149 150 _check_type = kwargs.pop("_check_type", True) 151 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 152 _path_to_item = kwargs.pop("_path_to_item", ()) 153 _configuration = kwargs.pop("_configuration", None) 154 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 155 156 self = super(OpenApiModel, cls).__new__(cls) 157 158 if args: 159 raise ApiTypeError( 160 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 161 % ( 162 args, 163 self.__class__.__name__, 164 ), 165 path_to_item=_path_to_item, 166 valid_classes=(self.__class__,), 167 ) 168 169 self._data_store = {} 170 self._check_type = _check_type 171 self._spec_property_naming = _spec_property_naming 172 self._path_to_item = _path_to_item 173 self._configuration = _configuration 174 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 175 176 for var_name, var_value in kwargs.items(): 177 if ( 178 var_name not in self.attribute_map 179 and self._configuration is not None 180 and self._configuration.discard_unknown_keys 181 and self.additional_properties_type is None 182 ): 183 # discard variable. 184 continue 185 setattr(self, var_name, var_value) 186 return self 187 188 required_properties = set( 189 [ 190 "_data_store", 191 "_check_type", 192 "_spec_property_naming", 193 "_path_to_item", 194 "_configuration", 195 "_visited_composed_classes", 196 ] 197 ) 198 199 @convert_js_args_to_python_args 200 def __init__(self, *args, **kwargs): # noqa: E501 201 """ProtobufAny - a model defined in OpenAPI 202 203 Keyword Args: 204 _check_type (bool): if True, values for parameters in openapi_types 205 will be type checked and a TypeError will be 206 raised if the wrong type is input. 207 Defaults to True 208 _path_to_item (tuple/list): This is a list of keys or values to 209 drill down to the model in received_data 210 when deserializing a response 211 _spec_property_naming (bool): True if the variable names in the input data 212 are serialized names, as specified in the OpenAPI document. 213 False if the variable names in the input data 214 are pythonic names, e.g. snake case (default) 215 _configuration (Configuration): the instance to use when 216 deserializing a file_type parameter. 217 If passed, type conversion is attempted 218 If omitted no type conversion is done. 219 _visited_composed_classes (tuple): This stores a tuple of 220 classes that we have traveled through so that 221 if we see that class again we will not use its 222 discriminator again. 223 When traveling through a discriminator, the 224 composed schema that is 225 is traveled through is added to this set. 226 For example if Animal has a discriminator 227 petType and we pass in "Dog", and the class Dog 228 allOf includes Animal, we move through Animal 229 once using the discriminator, and pick Dog. 230 Then in Dog, we will make an instance of the 231 Animal class but this time we won't travel 232 through its discriminator because we passed in 233 _visited_composed_classes = (Animal,) 234 type_url (str): [optional] # noqa: E501 235 value (str): [optional] # noqa: E501 236 """ 237 238 _check_type = kwargs.pop("_check_type", True) 239 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 240 _path_to_item = kwargs.pop("_path_to_item", ()) 241 _configuration = kwargs.pop("_configuration", None) 242 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 243 244 if args: 245 raise ApiTypeError( 246 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 247 % ( 248 args, 249 self.__class__.__name__, 250 ), 251 path_to_item=_path_to_item, 252 valid_classes=(self.__class__,), 253 ) 254 255 self._data_store = {} 256 self._check_type = _check_type 257 self._spec_property_naming = _spec_property_naming 258 self._path_to_item = _path_to_item 259 self._configuration = _configuration 260 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 261 262 for var_name, var_value in kwargs.items(): 263 if ( 264 var_name not in self.attribute_map 265 and self._configuration is not None 266 and self._configuration.discard_unknown_keys 267 and self.additional_properties_type is None 268 ): 269 # discard variable. 270 continue 271 setattr(self, var_name, var_value) 272 if var_name in self.read_only_vars: 273 raise ApiAttributeError( 274 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 275 f"class with read only attributes." 276 )
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.
199 @convert_js_args_to_python_args 200 def __init__(self, *args, **kwargs): # noqa: E501 201 """ProtobufAny - a model defined in OpenAPI 202 203 Keyword Args: 204 _check_type (bool): if True, values for parameters in openapi_types 205 will be type checked and a TypeError will be 206 raised if the wrong type is input. 207 Defaults to True 208 _path_to_item (tuple/list): This is a list of keys or values to 209 drill down to the model in received_data 210 when deserializing a response 211 _spec_property_naming (bool): True if the variable names in the input data 212 are serialized names, as specified in the OpenAPI document. 213 False if the variable names in the input data 214 are pythonic names, e.g. snake case (default) 215 _configuration (Configuration): the instance to use when 216 deserializing a file_type parameter. 217 If passed, type conversion is attempted 218 If omitted no type conversion is done. 219 _visited_composed_classes (tuple): This stores a tuple of 220 classes that we have traveled through so that 221 if we see that class again we will not use its 222 discriminator again. 223 When traveling through a discriminator, the 224 composed schema that is 225 is traveled through is added to this set. 226 For example if Animal has a discriminator 227 petType and we pass in "Dog", and the class Dog 228 allOf includes Animal, we move through Animal 229 once using the discriminator, and pick Dog. 230 Then in Dog, we will make an instance of the 231 Animal class but this time we won't travel 232 through its discriminator because we passed in 233 _visited_composed_classes = (Animal,) 234 type_url (str): [optional] # noqa: E501 235 value (str): [optional] # noqa: E501 236 """ 237 238 _check_type = kwargs.pop("_check_type", True) 239 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 240 _path_to_item = kwargs.pop("_path_to_item", ()) 241 _configuration = kwargs.pop("_configuration", None) 242 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 243 244 if args: 245 raise ApiTypeError( 246 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 247 % ( 248 args, 249 self.__class__.__name__, 250 ), 251 path_to_item=_path_to_item, 252 valid_classes=(self.__class__,), 253 ) 254 255 self._data_store = {} 256 self._check_type = _check_type 257 self._spec_property_naming = _spec_property_naming 258 self._path_to_item = _path_to_item 259 self._configuration = _configuration 260 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 261 262 for var_name, var_value in kwargs.items(): 263 if ( 264 var_name not in self.attribute_map 265 and self._configuration is not None 266 and self._configuration.discard_unknown_keys 267 and self.additional_properties_type is None 268 ): 269 # discard variable. 270 continue 271 setattr(self, var_name, var_value) 272 if var_name in self.read_only_vars: 273 raise ApiAttributeError( 274 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 275 f"class with read only attributes." 276 )
ProtobufAny - 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,) type_url (str): [optional] # noqa: E501 value (str): [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.
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.
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.
40class QueryVector(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 ("values",): {}, 68 ("top_k",): { 69 "inclusive_maximum": 10000, 70 "inclusive_minimum": 1, 71 }, 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 "values": ([float],), # noqa: E501 108 "sparse_values": (SparseValues,), # noqa: E501 109 "top_k": (int,), # noqa: E501 110 "namespace": (str,), # noqa: E501 111 "filter": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 112 } 113 114 @cached_property 115 def discriminator(): 116 return None 117 118 attribute_map = { 119 "values": "values", # noqa: E501 120 "sparse_values": "sparseValues", # noqa: E501 121 "top_k": "topK", # noqa: E501 122 "namespace": "namespace", # noqa: E501 123 "filter": "filter", # noqa: E501 124 } 125 126 read_only_vars = {} 127 128 _composed_schemas = {} 129 130 @classmethod 131 @convert_js_args_to_python_args 132 def _from_openapi_data(cls, values, *args, **kwargs): # noqa: E501 133 """QueryVector - a model defined in OpenAPI 134 135 Args: 136 values ([float]): The query vector values. This should be the same length as the dimension of the index being queried. 137 138 Keyword Args: 139 _check_type (bool): if True, values for parameters in openapi_types 140 will be type checked and a TypeError will be 141 raised if the wrong type is input. 142 Defaults to True 143 _path_to_item (tuple/list): This is a list of keys or values to 144 drill down to the model in received_data 145 when deserializing a response 146 _spec_property_naming (bool): True if the variable names in the input data 147 are serialized names, as specified in the OpenAPI document. 148 False if the variable names in the input data 149 are pythonic names, e.g. snake case (default) 150 _configuration (Configuration): the instance to use when 151 deserializing a file_type parameter. 152 If passed, type conversion is attempted 153 If omitted no type conversion is done. 154 _visited_composed_classes (tuple): This stores a tuple of 155 classes that we have traveled through so that 156 if we see that class again we will not use its 157 discriminator again. 158 When traveling through a discriminator, the 159 composed schema that is 160 is traveled through is added to this set. 161 For example if Animal has a discriminator 162 petType and we pass in "Dog", and the class Dog 163 allOf includes Animal, we move through Animal 164 once using the discriminator, and pick Dog. 165 Then in Dog, we will make an instance of the 166 Animal class but this time we won't travel 167 through its discriminator because we passed in 168 _visited_composed_classes = (Animal,) 169 sparse_values (SparseValues): The sparse data of the query vector [optional] # noqa: E501 170 top_k (int): An override for the number of results to return for this query vector.. [optional] # noqa: E501 171 namespace (str): An override the namespace to search.. [optional] # noqa: E501 172 filter ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): An override for the metadata filter to apply. This replaces the request-level filter.. [optional] # noqa: E501 173 """ 174 175 _check_type = kwargs.pop("_check_type", True) 176 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 177 _path_to_item = kwargs.pop("_path_to_item", ()) 178 _configuration = kwargs.pop("_configuration", None) 179 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 180 181 self = super(OpenApiModel, cls).__new__(cls) 182 183 if args: 184 raise ApiTypeError( 185 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 186 % ( 187 args, 188 self.__class__.__name__, 189 ), 190 path_to_item=_path_to_item, 191 valid_classes=(self.__class__,), 192 ) 193 194 self._data_store = {} 195 self._check_type = _check_type 196 self._spec_property_naming = _spec_property_naming 197 self._path_to_item = _path_to_item 198 self._configuration = _configuration 199 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 200 201 self.values = values 202 for var_name, var_value in kwargs.items(): 203 if ( 204 var_name not in self.attribute_map 205 and self._configuration is not None 206 and self._configuration.discard_unknown_keys 207 and self.additional_properties_type is None 208 ): 209 # discard variable. 210 continue 211 setattr(self, var_name, var_value) 212 return self 213 214 required_properties = set( 215 [ 216 "_data_store", 217 "_check_type", 218 "_spec_property_naming", 219 "_path_to_item", 220 "_configuration", 221 "_visited_composed_classes", 222 ] 223 ) 224 225 @convert_js_args_to_python_args 226 def __init__(self, values, *args, **kwargs): # noqa: E501 227 """QueryVector - a model defined in OpenAPI 228 229 Args: 230 values ([float]): The query vector values. This should be the same length as the dimension of the index being queried. 231 232 Keyword Args: 233 _check_type (bool): if True, values for parameters in openapi_types 234 will be type checked and a TypeError will be 235 raised if the wrong type is input. 236 Defaults to True 237 _path_to_item (tuple/list): This is a list of keys or values to 238 drill down to the model in received_data 239 when deserializing a response 240 _spec_property_naming (bool): True if the variable names in the input data 241 are serialized names, as specified in the OpenAPI document. 242 False if the variable names in the input data 243 are pythonic names, e.g. snake case (default) 244 _configuration (Configuration): the instance to use when 245 deserializing a file_type parameter. 246 If passed, type conversion is attempted 247 If omitted no type conversion is done. 248 _visited_composed_classes (tuple): This stores a tuple of 249 classes that we have traveled through so that 250 if we see that class again we will not use its 251 discriminator again. 252 When traveling through a discriminator, the 253 composed schema that is 254 is traveled through is added to this set. 255 For example if Animal has a discriminator 256 petType and we pass in "Dog", and the class Dog 257 allOf includes Animal, we move through Animal 258 once using the discriminator, and pick Dog. 259 Then in Dog, we will make an instance of the 260 Animal class but this time we won't travel 261 through its discriminator because we passed in 262 _visited_composed_classes = (Animal,) 263 sparse_values (SparseValues): This is the sparse data of the vector [optional] # noqa: E501 264 top_k (int): An override for the number of results to return for this query vector.. [optional] # noqa: E501 265 namespace (str): An override the namespace to search.. [optional] # noqa: E501 266 filter ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): An override for the metadata filter to apply. This replaces the request-level filter.. [optional] # noqa: E501 267 """ 268 269 _check_type = kwargs.pop("_check_type", True) 270 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 271 _path_to_item = kwargs.pop("_path_to_item", ()) 272 _configuration = kwargs.pop("_configuration", None) 273 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 274 275 if args: 276 raise ApiTypeError( 277 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 278 % ( 279 args, 280 self.__class__.__name__, 281 ), 282 path_to_item=_path_to_item, 283 valid_classes=(self.__class__,), 284 ) 285 286 self._data_store = {} 287 self._check_type = _check_type 288 self._spec_property_naming = _spec_property_naming 289 self._path_to_item = _path_to_item 290 self._configuration = _configuration 291 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 292 293 self.values = values 294 for var_name, var_value in kwargs.items(): 295 if ( 296 var_name not in self.attribute_map 297 and self._configuration is not None 298 and self._configuration.discard_unknown_keys 299 and self.additional_properties_type is None 300 ): 301 # discard variable. 302 continue 303 setattr(self, var_name, var_value) 304 if var_name in self.read_only_vars: 305 raise ApiAttributeError( 306 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 307 f"class with read only attributes." 308 )
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.
225 @convert_js_args_to_python_args 226 def __init__(self, values, *args, **kwargs): # noqa: E501 227 """QueryVector - a model defined in OpenAPI 228 229 Args: 230 values ([float]): The query vector values. This should be the same length as the dimension of the index being queried. 231 232 Keyword Args: 233 _check_type (bool): if True, values for parameters in openapi_types 234 will be type checked and a TypeError will be 235 raised if the wrong type is input. 236 Defaults to True 237 _path_to_item (tuple/list): This is a list of keys or values to 238 drill down to the model in received_data 239 when deserializing a response 240 _spec_property_naming (bool): True if the variable names in the input data 241 are serialized names, as specified in the OpenAPI document. 242 False if the variable names in the input data 243 are pythonic names, e.g. snake case (default) 244 _configuration (Configuration): the instance to use when 245 deserializing a file_type parameter. 246 If passed, type conversion is attempted 247 If omitted no type conversion is done. 248 _visited_composed_classes (tuple): This stores a tuple of 249 classes that we have traveled through so that 250 if we see that class again we will not use its 251 discriminator again. 252 When traveling through a discriminator, the 253 composed schema that is 254 is traveled through is added to this set. 255 For example if Animal has a discriminator 256 petType and we pass in "Dog", and the class Dog 257 allOf includes Animal, we move through Animal 258 once using the discriminator, and pick Dog. 259 Then in Dog, we will make an instance of the 260 Animal class but this time we won't travel 261 through its discriminator because we passed in 262 _visited_composed_classes = (Animal,) 263 sparse_values (SparseValues): This is the sparse data of the vector [optional] # noqa: E501 264 top_k (int): An override for the number of results to return for this query vector.. [optional] # noqa: E501 265 namespace (str): An override the namespace to search.. [optional] # noqa: E501 266 filter ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): An override for the metadata filter to apply. This replaces the request-level filter.. [optional] # noqa: E501 267 """ 268 269 _check_type = kwargs.pop("_check_type", True) 270 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 271 _path_to_item = kwargs.pop("_path_to_item", ()) 272 _configuration = kwargs.pop("_configuration", None) 273 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 274 275 if args: 276 raise ApiTypeError( 277 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 278 % ( 279 args, 280 self.__class__.__name__, 281 ), 282 path_to_item=_path_to_item, 283 valid_classes=(self.__class__,), 284 ) 285 286 self._data_store = {} 287 self._check_type = _check_type 288 self._spec_property_naming = _spec_property_naming 289 self._path_to_item = _path_to_item 290 self._configuration = _configuration 291 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 292 293 self.values = values 294 for var_name, var_value in kwargs.items(): 295 if ( 296 var_name not in self.attribute_map 297 and self._configuration is not None 298 and self._configuration.discard_unknown_keys 299 and self.additional_properties_type is None 300 ): 301 # discard variable. 302 continue 303 setattr(self, var_name, var_value) 304 if var_name in self.read_only_vars: 305 raise ApiAttributeError( 306 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 307 f"class with read only attributes." 308 )
QueryVector - a model defined in OpenAPI
Arguments:
- values ([float]): The query vector values. This should be the same length as the dimension of the index being queried.
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 [optional] # noqa: E501 top_k (int): An override for the number of results to return for this query vector.. [optional] # noqa: E501 namespace (str): An override the namespace to search.. [optional] # noqa: E501 filter ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): An override for the metadata filter to apply. This replaces the request-level filter.. [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.
40class RpcStatus(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 68 @cached_property 69 def additional_properties_type(): 70 """ 71 This must be a method because a model may have properties that are 72 of type self, this must run after the class is loaded 73 """ 74 lazy_import() 75 return ( 76 bool, 77 date, 78 datetime, 79 dict, 80 float, 81 int, 82 list, 83 str, 84 none_type, 85 ) # noqa: E501 86 87 _nullable = False 88 89 @cached_property 90 def openapi_types(): 91 """ 92 This must be a method because a model may have properties that are 93 of type self, this must run after the class is loaded 94 95 Returns 96 openapi_types (dict): The key is attribute name 97 and the value is attribute type. 98 """ 99 lazy_import() 100 return { 101 "code": (int,), # noqa: E501 102 "message": (str,), # noqa: E501 103 "details": ([ProtobufAny],), # noqa: E501 104 } 105 106 @cached_property 107 def discriminator(): 108 return None 109 110 attribute_map = { 111 "code": "code", # noqa: E501 112 "message": "message", # noqa: E501 113 "details": "details", # 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, *args, **kwargs): # noqa: E501 123 """RpcStatus - a model defined in OpenAPI 124 125 Keyword Args: 126 _check_type (bool): if True, values for parameters in openapi_types 127 will be type checked and a TypeError will be 128 raised if the wrong type is input. 129 Defaults to True 130 _path_to_item (tuple/list): This is a list of keys or values to 131 drill down to the model in received_data 132 when deserializing a response 133 _spec_property_naming (bool): True if the variable names in the input data 134 are serialized names, as specified in the OpenAPI document. 135 False if the variable names in the input data 136 are pythonic names, e.g. snake case (default) 137 _configuration (Configuration): the instance to use when 138 deserializing a file_type parameter. 139 If passed, type conversion is attempted 140 If omitted no type conversion is done. 141 _visited_composed_classes (tuple): This stores a tuple of 142 classes that we have traveled through so that 143 if we see that class again we will not use its 144 discriminator again. 145 When traveling through a discriminator, the 146 composed schema that is 147 is traveled through is added to this set. 148 For example if Animal has a discriminator 149 petType and we pass in "Dog", and the class Dog 150 allOf includes Animal, we move through Animal 151 once using the discriminator, and pick Dog. 152 Then in Dog, we will make an instance of the 153 Animal class but this time we won't travel 154 through its discriminator because we passed in 155 _visited_composed_classes = (Animal,) 156 code (int): [optional] # noqa: E501 157 message (str): [optional] # noqa: E501 158 details ([ProtobufAny]): [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 for var_name, var_value in kwargs.items(): 188 if ( 189 var_name not in self.attribute_map 190 and self._configuration is not None 191 and self._configuration.discard_unknown_keys 192 and self.additional_properties_type is None 193 ): 194 # discard variable. 195 continue 196 setattr(self, var_name, var_value) 197 return self 198 199 required_properties = set( 200 [ 201 "_data_store", 202 "_check_type", 203 "_spec_property_naming", 204 "_path_to_item", 205 "_configuration", 206 "_visited_composed_classes", 207 ] 208 ) 209 210 @convert_js_args_to_python_args 211 def __init__(self, *args, **kwargs): # noqa: E501 212 """RpcStatus - a model defined in OpenAPI 213 214 Keyword Args: 215 _check_type (bool): if True, values for parameters in openapi_types 216 will be type checked and a TypeError will be 217 raised if the wrong type is input. 218 Defaults to True 219 _path_to_item (tuple/list): This is a list of keys or values to 220 drill down to the model in received_data 221 when deserializing a response 222 _spec_property_naming (bool): True if the variable names in the input data 223 are serialized names, as specified in the OpenAPI document. 224 False if the variable names in the input data 225 are pythonic names, e.g. snake case (default) 226 _configuration (Configuration): the instance to use when 227 deserializing a file_type parameter. 228 If passed, type conversion is attempted 229 If omitted no type conversion is done. 230 _visited_composed_classes (tuple): This stores a tuple of 231 classes that we have traveled through so that 232 if we see that class again we will not use its 233 discriminator again. 234 When traveling through a discriminator, the 235 composed schema that is 236 is traveled through is added to this set. 237 For example if Animal has a discriminator 238 petType and we pass in "Dog", and the class Dog 239 allOf includes Animal, we move through Animal 240 once using the discriminator, and pick Dog. 241 Then in Dog, we will make an instance of the 242 Animal class but this time we won't travel 243 through its discriminator because we passed in 244 _visited_composed_classes = (Animal,) 245 code (int): [optional] # noqa: E501 246 message (str): [optional] # noqa: E501 247 details ([ProtobufAny]): [optional] # noqa: E501 248 """ 249 250 _check_type = kwargs.pop("_check_type", True) 251 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 252 _path_to_item = kwargs.pop("_path_to_item", ()) 253 _configuration = kwargs.pop("_configuration", None) 254 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 255 256 if args: 257 raise ApiTypeError( 258 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 259 % ( 260 args, 261 self.__class__.__name__, 262 ), 263 path_to_item=_path_to_item, 264 valid_classes=(self.__class__,), 265 ) 266 267 self._data_store = {} 268 self._check_type = _check_type 269 self._spec_property_naming = _spec_property_naming 270 self._path_to_item = _path_to_item 271 self._configuration = _configuration 272 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 273 274 for var_name, var_value in kwargs.items(): 275 if ( 276 var_name not in self.attribute_map 277 and self._configuration is not None 278 and self._configuration.discard_unknown_keys 279 and self.additional_properties_type is None 280 ): 281 # discard variable. 282 continue 283 setattr(self, var_name, var_value) 284 if var_name in self.read_only_vars: 285 raise ApiAttributeError( 286 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 287 f"class with read only attributes." 288 )
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.
210 @convert_js_args_to_python_args 211 def __init__(self, *args, **kwargs): # noqa: E501 212 """RpcStatus - a model defined in OpenAPI 213 214 Keyword Args: 215 _check_type (bool): if True, values for parameters in openapi_types 216 will be type checked and a TypeError will be 217 raised if the wrong type is input. 218 Defaults to True 219 _path_to_item (tuple/list): This is a list of keys or values to 220 drill down to the model in received_data 221 when deserializing a response 222 _spec_property_naming (bool): True if the variable names in the input data 223 are serialized names, as specified in the OpenAPI document. 224 False if the variable names in the input data 225 are pythonic names, e.g. snake case (default) 226 _configuration (Configuration): the instance to use when 227 deserializing a file_type parameter. 228 If passed, type conversion is attempted 229 If omitted no type conversion is done. 230 _visited_composed_classes (tuple): This stores a tuple of 231 classes that we have traveled through so that 232 if we see that class again we will not use its 233 discriminator again. 234 When traveling through a discriminator, the 235 composed schema that is 236 is traveled through is added to this set. 237 For example if Animal has a discriminator 238 petType and we pass in "Dog", and the class Dog 239 allOf includes Animal, we move through Animal 240 once using the discriminator, and pick Dog. 241 Then in Dog, we will make an instance of the 242 Animal class but this time we won't travel 243 through its discriminator because we passed in 244 _visited_composed_classes = (Animal,) 245 code (int): [optional] # noqa: E501 246 message (str): [optional] # noqa: E501 247 details ([ProtobufAny]): [optional] # noqa: E501 248 """ 249 250 _check_type = kwargs.pop("_check_type", True) 251 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 252 _path_to_item = kwargs.pop("_path_to_item", ()) 253 _configuration = kwargs.pop("_configuration", None) 254 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 255 256 if args: 257 raise ApiTypeError( 258 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 259 % ( 260 args, 261 self.__class__.__name__, 262 ), 263 path_to_item=_path_to_item, 264 valid_classes=(self.__class__,), 265 ) 266 267 self._data_store = {} 268 self._check_type = _check_type 269 self._spec_property_naming = _spec_property_naming 270 self._path_to_item = _path_to_item 271 self._configuration = _configuration 272 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 273 274 for var_name, var_value in kwargs.items(): 275 if ( 276 var_name not in self.attribute_map 277 and self._configuration is not None 278 and self._configuration.discard_unknown_keys 279 and self.additional_properties_type is None 280 ): 281 # discard variable. 282 continue 283 setattr(self, var_name, var_value) 284 if var_name in self.read_only_vars: 285 raise ApiAttributeError( 286 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 287 f"class with read only attributes." 288 )
RpcStatus - 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,) code (int): [optional] # noqa: E501 message (str): [optional] # noqa: E501 details ([ProtobufAny]): [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.
40class ScoredVector(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 } 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 "score": (float,), # 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 "score": "score", # noqa: E501 120 "values": "values", # noqa: E501 121 "sparse_values": "sparseValues", # noqa: E501 122 "metadata": "metadata", # noqa: E501 123 } 124 125 read_only_vars = {} 126 127 _composed_schemas = {} 128 129 @classmethod 130 @convert_js_args_to_python_args 131 def _from_openapi_data(cls, id, *args, **kwargs): # noqa: E501 132 """ScoredVector - a model defined in OpenAPI 133 134 Args: 135 id (str): This is the vector's unique id. 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 score (float): This is a measure of similarity between this vector and the query vector. The higher the score, the more they are similar.. [optional] # noqa: E501 169 values ([float]): This is the vector data, if it is requested.. [optional] # noqa: E501 170 sparse_values (SparseValues): the sparse data of the vector [optional] # noqa: E501 171 metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): This is the metadata, if it is requested.. [optional] # noqa: E501 172 """ 173 174 _check_type = kwargs.pop("_check_type", True) 175 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 176 _path_to_item = kwargs.pop("_path_to_item", ()) 177 _configuration = kwargs.pop("_configuration", None) 178 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 179 180 self = super(OpenApiModel, cls).__new__(cls) 181 182 if args: 183 raise ApiTypeError( 184 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 185 % ( 186 args, 187 self.__class__.__name__, 188 ), 189 path_to_item=_path_to_item, 190 valid_classes=(self.__class__,), 191 ) 192 193 self._data_store = {} 194 self._check_type = _check_type 195 self._spec_property_naming = _spec_property_naming 196 self._path_to_item = _path_to_item 197 self._configuration = _configuration 198 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 199 200 self.id = id 201 for var_name, var_value in kwargs.items(): 202 if ( 203 var_name not in self.attribute_map 204 and self._configuration is not None 205 and self._configuration.discard_unknown_keys 206 and self.additional_properties_type is None 207 ): 208 # discard variable. 209 continue 210 setattr(self, var_name, var_value) 211 return self 212 213 required_properties = set( 214 [ 215 "_data_store", 216 "_check_type", 217 "_spec_property_naming", 218 "_path_to_item", 219 "_configuration", 220 "_visited_composed_classes", 221 ] 222 ) 223 224 @convert_js_args_to_python_args 225 def __init__(self, id, *args, **kwargs): # noqa: E501 226 """ScoredVector - a model defined in OpenAPI 227 228 Args: 229 id (str): This is the vector's unique id. 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 score (float): This is a measure of similarity between this vector and the query vector. The higher the score, the more they are similar.. [optional] # noqa: E501 263 values ([float]): This is the vector data, if it is requested.. [optional] # noqa: E501 264 sparse_values (SparseValues): This is the sparse data of the vector [optional] # noqa: E501 265 metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): This is the metadata, if it is requested.. [optional] # noqa: E501 266 """ 267 268 _check_type = kwargs.pop("_check_type", True) 269 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 270 _path_to_item = kwargs.pop("_path_to_item", ()) 271 _configuration = kwargs.pop("_configuration", None) 272 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 273 274 if args: 275 raise ApiTypeError( 276 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 277 % ( 278 args, 279 self.__class__.__name__, 280 ), 281 path_to_item=_path_to_item, 282 valid_classes=(self.__class__,), 283 ) 284 285 self._data_store = {} 286 self._check_type = _check_type 287 self._spec_property_naming = _spec_property_naming 288 self._path_to_item = _path_to_item 289 self._configuration = _configuration 290 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 291 292 self.id = id 293 for var_name, var_value in kwargs.items(): 294 if ( 295 var_name not in self.attribute_map 296 and self._configuration is not None 297 and self._configuration.discard_unknown_keys 298 and self.additional_properties_type is None 299 ): 300 # discard variable. 301 continue 302 setattr(self, var_name, var_value) 303 if var_name in self.read_only_vars: 304 raise ApiAttributeError( 305 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 306 f"class with read only attributes." 307 )
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.
224 @convert_js_args_to_python_args 225 def __init__(self, id, *args, **kwargs): # noqa: E501 226 """ScoredVector - a model defined in OpenAPI 227 228 Args: 229 id (str): This is the vector's unique id. 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 score (float): This is a measure of similarity between this vector and the query vector. The higher the score, the more they are similar.. [optional] # noqa: E501 263 values ([float]): This is the vector data, if it is requested.. [optional] # noqa: E501 264 sparse_values (SparseValues): This is the sparse data of the vector [optional] # noqa: E501 265 metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): This is the metadata, if it is requested.. [optional] # noqa: E501 266 """ 267 268 _check_type = kwargs.pop("_check_type", True) 269 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 270 _path_to_item = kwargs.pop("_path_to_item", ()) 271 _configuration = kwargs.pop("_configuration", None) 272 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 273 274 if args: 275 raise ApiTypeError( 276 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 277 % ( 278 args, 279 self.__class__.__name__, 280 ), 281 path_to_item=_path_to_item, 282 valid_classes=(self.__class__,), 283 ) 284 285 self._data_store = {} 286 self._check_type = _check_type 287 self._spec_property_naming = _spec_property_naming 288 self._path_to_item = _path_to_item 289 self._configuration = _configuration 290 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 291 292 self.id = id 293 for var_name, var_value in kwargs.items(): 294 if ( 295 var_name not in self.attribute_map 296 and self._configuration is not None 297 and self._configuration.discard_unknown_keys 298 and self.additional_properties_type is None 299 ): 300 # discard variable. 301 continue 302 setattr(self, var_name, var_value) 303 if var_name in self.read_only_vars: 304 raise ApiAttributeError( 305 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 306 f"class with read only attributes." 307 )
ScoredVector - a model defined in OpenAPI
Arguments:
- id (str): This is the vector's unique id.
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,) score (float): This is a measure of similarity between this vector and the query vector. The higher the score, the more they are similar.. [optional] # noqa: E501 values ([float]): This is the vector data, if it is requested.. [optional] # noqa: E501 sparse_values (SparseValues): This is the sparse data of the vector [optional] # noqa: E501 metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): This is the metadata, if it is requested.. [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.
40class SingleQueryResults(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 68 @cached_property 69 def additional_properties_type(): 70 """ 71 This must be a method because a model may have properties that are 72 of type self, this must run after the class is loaded 73 """ 74 lazy_import() 75 return ( 76 bool, 77 date, 78 datetime, 79 dict, 80 float, 81 int, 82 list, 83 str, 84 none_type, 85 ) # noqa: E501 86 87 _nullable = False 88 89 @cached_property 90 def openapi_types(): 91 """ 92 This must be a method because a model may have properties that are 93 of type self, this must run after the class is loaded 94 95 Returns 96 openapi_types (dict): The key is attribute name 97 and the value is attribute type. 98 """ 99 lazy_import() 100 return { 101 "matches": ([ScoredVector],), # noqa: E501 102 "namespace": (str,), # noqa: E501 103 } 104 105 @cached_property 106 def discriminator(): 107 return None 108 109 attribute_map = { 110 "matches": "matches", # noqa: E501 111 "namespace": "namespace", # noqa: E501 112 } 113 114 read_only_vars = {} 115 116 _composed_schemas = {} 117 118 @classmethod 119 @convert_js_args_to_python_args 120 def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 121 """SingleQueryResults - a model defined in OpenAPI 122 123 Keyword Args: 124 _check_type (bool): if True, values for parameters in openapi_types 125 will be type checked and a TypeError will be 126 raised if the wrong type is input. 127 Defaults to True 128 _path_to_item (tuple/list): This is a list of keys or values to 129 drill down to the model in received_data 130 when deserializing a response 131 _spec_property_naming (bool): True if the variable names in the input data 132 are serialized names, as specified in the OpenAPI document. 133 False if the variable names in the input data 134 are pythonic names, e.g. snake case (default) 135 _configuration (Configuration): the instance to use when 136 deserializing a file_type parameter. 137 If passed, type conversion is attempted 138 If omitted no type conversion is done. 139 _visited_composed_classes (tuple): This stores a tuple of 140 classes that we have traveled through so that 141 if we see that class again we will not use its 142 discriminator again. 143 When traveling through a discriminator, the 144 composed schema that is 145 is traveled through is added to this set. 146 For example if Animal has a discriminator 147 petType and we pass in "Dog", and the class Dog 148 allOf includes Animal, we move through Animal 149 once using the discriminator, and pick Dog. 150 Then in Dog, we will make an instance of the 151 Animal class but this time we won't travel 152 through its discriminator because we passed in 153 _visited_composed_classes = (Animal,) 154 matches ([ScoredVector]): The matches for the vectors.. [optional] # noqa: E501 155 namespace (str): The namespace for the vectors.. [optional] # noqa: E501 156 """ 157 158 _check_type = kwargs.pop("_check_type", True) 159 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 160 _path_to_item = kwargs.pop("_path_to_item", ()) 161 _configuration = kwargs.pop("_configuration", None) 162 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 163 164 self = super(OpenApiModel, cls).__new__(cls) 165 166 if args: 167 raise ApiTypeError( 168 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 169 % ( 170 args, 171 self.__class__.__name__, 172 ), 173 path_to_item=_path_to_item, 174 valid_classes=(self.__class__,), 175 ) 176 177 self._data_store = {} 178 self._check_type = _check_type 179 self._spec_property_naming = _spec_property_naming 180 self._path_to_item = _path_to_item 181 self._configuration = _configuration 182 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 183 184 for var_name, var_value in kwargs.items(): 185 if ( 186 var_name not in self.attribute_map 187 and self._configuration is not None 188 and self._configuration.discard_unknown_keys 189 and self.additional_properties_type is None 190 ): 191 # discard variable. 192 continue 193 setattr(self, var_name, var_value) 194 return self 195 196 required_properties = set( 197 [ 198 "_data_store", 199 "_check_type", 200 "_spec_property_naming", 201 "_path_to_item", 202 "_configuration", 203 "_visited_composed_classes", 204 ] 205 ) 206 207 @convert_js_args_to_python_args 208 def __init__(self, *args, **kwargs): # noqa: E501 209 """SingleQueryResults - a model defined in OpenAPI 210 211 Keyword Args: 212 _check_type (bool): if True, values for parameters in openapi_types 213 will be type checked and a TypeError will be 214 raised if the wrong type is input. 215 Defaults to True 216 _path_to_item (tuple/list): This is a list of keys or values to 217 drill down to the model in received_data 218 when deserializing a response 219 _spec_property_naming (bool): True if the variable names in the input data 220 are serialized names, as specified in the OpenAPI document. 221 False if the variable names in the input data 222 are pythonic names, e.g. snake case (default) 223 _configuration (Configuration): the instance to use when 224 deserializing a file_type parameter. 225 If passed, type conversion is attempted 226 If omitted no type conversion is done. 227 _visited_composed_classes (tuple): This stores a tuple of 228 classes that we have traveled through so that 229 if we see that class again we will not use its 230 discriminator again. 231 When traveling through a discriminator, the 232 composed schema that is 233 is traveled through is added to this set. 234 For example if Animal has a discriminator 235 petType and we pass in "Dog", and the class Dog 236 allOf includes Animal, we move through Animal 237 once using the discriminator, and pick Dog. 238 Then in Dog, we will make an instance of the 239 Animal class but this time we won't travel 240 through its discriminator because we passed in 241 _visited_composed_classes = (Animal,) 242 matches ([ScoredVector]): The matches for the vectors.. [optional] # noqa: E501 243 namespace (str): The namespace for the vectors.. [optional] # noqa: E501 244 """ 245 246 _check_type = kwargs.pop("_check_type", True) 247 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 248 _path_to_item = kwargs.pop("_path_to_item", ()) 249 _configuration = kwargs.pop("_configuration", None) 250 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 251 252 if args: 253 raise ApiTypeError( 254 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 255 % ( 256 args, 257 self.__class__.__name__, 258 ), 259 path_to_item=_path_to_item, 260 valid_classes=(self.__class__,), 261 ) 262 263 self._data_store = {} 264 self._check_type = _check_type 265 self._spec_property_naming = _spec_property_naming 266 self._path_to_item = _path_to_item 267 self._configuration = _configuration 268 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 269 270 for var_name, var_value in kwargs.items(): 271 if ( 272 var_name not in self.attribute_map 273 and self._configuration is not None 274 and self._configuration.discard_unknown_keys 275 and self.additional_properties_type is None 276 ): 277 # discard variable. 278 continue 279 setattr(self, var_name, var_value) 280 if var_name in self.read_only_vars: 281 raise ApiAttributeError( 282 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 283 f"class with read only attributes." 284 )
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.
207 @convert_js_args_to_python_args 208 def __init__(self, *args, **kwargs): # noqa: E501 209 """SingleQueryResults - a model defined in OpenAPI 210 211 Keyword Args: 212 _check_type (bool): if True, values for parameters in openapi_types 213 will be type checked and a TypeError will be 214 raised if the wrong type is input. 215 Defaults to True 216 _path_to_item (tuple/list): This is a list of keys or values to 217 drill down to the model in received_data 218 when deserializing a response 219 _spec_property_naming (bool): True if the variable names in the input data 220 are serialized names, as specified in the OpenAPI document. 221 False if the variable names in the input data 222 are pythonic names, e.g. snake case (default) 223 _configuration (Configuration): the instance to use when 224 deserializing a file_type parameter. 225 If passed, type conversion is attempted 226 If omitted no type conversion is done. 227 _visited_composed_classes (tuple): This stores a tuple of 228 classes that we have traveled through so that 229 if we see that class again we will not use its 230 discriminator again. 231 When traveling through a discriminator, the 232 composed schema that is 233 is traveled through is added to this set. 234 For example if Animal has a discriminator 235 petType and we pass in "Dog", and the class Dog 236 allOf includes Animal, we move through Animal 237 once using the discriminator, and pick Dog. 238 Then in Dog, we will make an instance of the 239 Animal class but this time we won't travel 240 through its discriminator because we passed in 241 _visited_composed_classes = (Animal,) 242 matches ([ScoredVector]): The matches for the vectors.. [optional] # noqa: E501 243 namespace (str): The namespace for the vectors.. [optional] # noqa: E501 244 """ 245 246 _check_type = kwargs.pop("_check_type", True) 247 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 248 _path_to_item = kwargs.pop("_path_to_item", ()) 249 _configuration = kwargs.pop("_configuration", None) 250 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 251 252 if args: 253 raise ApiTypeError( 254 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 255 % ( 256 args, 257 self.__class__.__name__, 258 ), 259 path_to_item=_path_to_item, 260 valid_classes=(self.__class__,), 261 ) 262 263 self._data_store = {} 264 self._check_type = _check_type 265 self._spec_property_naming = _spec_property_naming 266 self._path_to_item = _path_to_item 267 self._configuration = _configuration 268 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 269 270 for var_name, var_value in kwargs.items(): 271 if ( 272 var_name not in self.attribute_map 273 and self._configuration is not None 274 and self._configuration.discard_unknown_keys 275 and self.additional_properties_type is None 276 ): 277 # discard variable. 278 continue 279 setattr(self, var_name, var_value) 280 if var_name in self.read_only_vars: 281 raise ApiAttributeError( 282 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 283 f"class with read only attributes." 284 )
SingleQueryResults - 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,) 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.
40class DescribeIndexStatsResponse(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 68 @cached_property 69 def additional_properties_type(): 70 """ 71 This must be a method because a model may have properties that are 72 of type self, this must run after the class is loaded 73 """ 74 lazy_import() 75 return ( 76 bool, 77 date, 78 datetime, 79 dict, 80 float, 81 int, 82 list, 83 str, 84 none_type, 85 ) # noqa: E501 86 87 _nullable = False 88 89 @cached_property 90 def openapi_types(): 91 """ 92 This must be a method because a model may have properties that are 93 of type self, this must run after the class is loaded 94 95 Returns 96 openapi_types (dict): The key is attribute name 97 and the value is attribute type. 98 """ 99 lazy_import() 100 return { 101 "namespaces": ({str: (NamespaceSummary,)},), # noqa: E501 102 "dimension": (int,), # noqa: E501 103 "index_fullness": (float,), # noqa: E501 104 "total_vector_count": (int,), # noqa: E501 105 } 106 107 @cached_property 108 def discriminator(): 109 return None 110 111 attribute_map = { 112 "namespaces": "namespaces", # noqa: E501 113 "dimension": "dimension", # noqa: E501 114 "index_fullness": "indexFullness", # noqa: E501 115 "total_vector_count": "totalVectorCount", # 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 """DescribeIndexStatsResponse - 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 namespaces ({str: (NamespaceSummary,)}): A mapping for each namespace in the index from the namespace name to a summary of its contents. If a metadata filter expression is present, the summary will reflect only vectors matching that expression.. [optional] # noqa: E501 159 dimension (int): The dimension of the indexed vectors.. [optional] # noqa: E501 160 index_fullness (float): The fullness of the index, regardless of whether a metadata filter expression was passed. The granularity of this metric is 10%.. [optional] # noqa: E501 161 total_vector_count (int): [optional] # noqa: E501 162 """ 163 164 _check_type = kwargs.pop("_check_type", True) 165 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 166 _path_to_item = kwargs.pop("_path_to_item", ()) 167 _configuration = kwargs.pop("_configuration", None) 168 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 169 170 self = super(OpenApiModel, cls).__new__(cls) 171 172 if args: 173 raise ApiTypeError( 174 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 175 % ( 176 args, 177 self.__class__.__name__, 178 ), 179 path_to_item=_path_to_item, 180 valid_classes=(self.__class__,), 181 ) 182 183 self._data_store = {} 184 self._check_type = _check_type 185 self._spec_property_naming = _spec_property_naming 186 self._path_to_item = _path_to_item 187 self._configuration = _configuration 188 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 189 190 for var_name, var_value in kwargs.items(): 191 if ( 192 var_name not in self.attribute_map 193 and self._configuration is not None 194 and self._configuration.discard_unknown_keys 195 and self.additional_properties_type is None 196 ): 197 # discard variable. 198 continue 199 setattr(self, var_name, var_value) 200 return self 201 202 required_properties = set( 203 [ 204 "_data_store", 205 "_check_type", 206 "_spec_property_naming", 207 "_path_to_item", 208 "_configuration", 209 "_visited_composed_classes", 210 ] 211 ) 212 213 @convert_js_args_to_python_args 214 def __init__(self, *args, **kwargs): # noqa: E501 215 """DescribeIndexStatsResponse - a model defined in OpenAPI 216 217 Keyword Args: 218 _check_type (bool): if True, values for parameters in openapi_types 219 will be type checked and a TypeError will be 220 raised if the wrong type is input. 221 Defaults to True 222 _path_to_item (tuple/list): This is a list of keys or values to 223 drill down to the model in received_data 224 when deserializing a response 225 _spec_property_naming (bool): True if the variable names in the input data 226 are serialized names, as specified in the OpenAPI document. 227 False if the variable names in the input data 228 are pythonic names, e.g. snake case (default) 229 _configuration (Configuration): the instance to use when 230 deserializing a file_type parameter. 231 If passed, type conversion is attempted 232 If omitted no type conversion is done. 233 _visited_composed_classes (tuple): This stores a tuple of 234 classes that we have traveled through so that 235 if we see that class again we will not use its 236 discriminator again. 237 When traveling through a discriminator, the 238 composed schema that is 239 is traveled through is added to this set. 240 For example if Animal has a discriminator 241 petType and we pass in "Dog", and the class Dog 242 allOf includes Animal, we move through Animal 243 once using the discriminator, and pick Dog. 244 Then in Dog, we will make an instance of the 245 Animal class but this time we won't travel 246 through its discriminator because we passed in 247 _visited_composed_classes = (Animal,) 248 namespaces ({str: (NamespaceSummary,)}): A mapping for each namespace in the index from the namespace name to a summary of its contents. If a metadata filter expression is present, the summary will reflect only vectors matching that expression.. [optional] # noqa: E501 249 dimension (int): The dimension of the indexed vectors.. [optional] # noqa: E501 250 index_fullness (float): The fullness of the index, regardless of whether a metadata filter expression was passed. The granularity of this metric is 10%.. [optional] # noqa: E501 251 total_vector_count (int): [optional] # noqa: E501 252 """ 253 254 _check_type = kwargs.pop("_check_type", True) 255 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 256 _path_to_item = kwargs.pop("_path_to_item", ()) 257 _configuration = kwargs.pop("_configuration", None) 258 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 259 260 if args: 261 raise ApiTypeError( 262 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 263 % ( 264 args, 265 self.__class__.__name__, 266 ), 267 path_to_item=_path_to_item, 268 valid_classes=(self.__class__,), 269 ) 270 271 self._data_store = {} 272 self._check_type = _check_type 273 self._spec_property_naming = _spec_property_naming 274 self._path_to_item = _path_to_item 275 self._configuration = _configuration 276 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 277 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.
213 @convert_js_args_to_python_args 214 def __init__(self, *args, **kwargs): # noqa: E501 215 """DescribeIndexStatsResponse - a model defined in OpenAPI 216 217 Keyword Args: 218 _check_type (bool): if True, values for parameters in openapi_types 219 will be type checked and a TypeError will be 220 raised if the wrong type is input. 221 Defaults to True 222 _path_to_item (tuple/list): This is a list of keys or values to 223 drill down to the model in received_data 224 when deserializing a response 225 _spec_property_naming (bool): True if the variable names in the input data 226 are serialized names, as specified in the OpenAPI document. 227 False if the variable names in the input data 228 are pythonic names, e.g. snake case (default) 229 _configuration (Configuration): the instance to use when 230 deserializing a file_type parameter. 231 If passed, type conversion is attempted 232 If omitted no type conversion is done. 233 _visited_composed_classes (tuple): This stores a tuple of 234 classes that we have traveled through so that 235 if we see that class again we will not use its 236 discriminator again. 237 When traveling through a discriminator, the 238 composed schema that is 239 is traveled through is added to this set. 240 For example if Animal has a discriminator 241 petType and we pass in "Dog", and the class Dog 242 allOf includes Animal, we move through Animal 243 once using the discriminator, and pick Dog. 244 Then in Dog, we will make an instance of the 245 Animal class but this time we won't travel 246 through its discriminator because we passed in 247 _visited_composed_classes = (Animal,) 248 namespaces ({str: (NamespaceSummary,)}): A mapping for each namespace in the index from the namespace name to a summary of its contents. If a metadata filter expression is present, the summary will reflect only vectors matching that expression.. [optional] # noqa: E501 249 dimension (int): The dimension of the indexed vectors.. [optional] # noqa: E501 250 index_fullness (float): The fullness of the index, regardless of whether a metadata filter expression was passed. The granularity of this metric is 10%.. [optional] # noqa: E501 251 total_vector_count (int): [optional] # noqa: E501 252 """ 253 254 _check_type = kwargs.pop("_check_type", True) 255 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 256 _path_to_item = kwargs.pop("_path_to_item", ()) 257 _configuration = kwargs.pop("_configuration", None) 258 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 259 260 if args: 261 raise ApiTypeError( 262 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 263 % ( 264 args, 265 self.__class__.__name__, 266 ), 267 path_to_item=_path_to_item, 268 valid_classes=(self.__class__,), 269 ) 270 271 self._data_store = {} 272 self._check_type = _check_type 273 self._spec_property_naming = _spec_property_naming 274 self._path_to_item = _path_to_item 275 self._configuration = _configuration 276 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 277 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 )
DescribeIndexStatsResponse - 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,) namespaces ({str: (NamespaceSummary,)}): A mapping for each namespace in the index from the namespace name to a summary of its contents. If a metadata filter expression is present, the summary will reflect only vectors matching that expression.. [optional] # noqa: E501 dimension (int): The dimension of the indexed vectors.. [optional] # noqa: E501 index_fullness (float): The fullness of the index, regardless of whether a metadata filter expression was passed. The granularity of this metric is 10%.. [optional] # noqa: E501 total_vector_count (int): [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.
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.
34class UpsertResponse(ModelNormal): 35 """NOTE: This class is auto generated by OpenAPI Generator. 36 Ref: https://openapi-generator.tech 37 38 Do not edit the class manually. 39 40 Attributes: 41 allowed_values (dict): The key is the tuple path to the attribute 42 and the for var_name this is (var_name,). The value is a dict 43 with a capitalized key describing the allowed value and an allowed 44 value. These dicts store the allowed enum values. 45 attribute_map (dict): The key is attribute name 46 and the value is json key in definition. 47 discriminator_value_class_map (dict): A dict to go from the discriminator 48 variable value to the discriminator class name. 49 validations (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 that stores validations for max_length, min_length, max_items, 52 min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, 53 inclusive_minimum, and regex. 54 additional_properties_type (tuple): A tuple of classes accepted 55 as additional properties values. 56 """ 57 58 allowed_values = {} 59 60 validations = {} 61 62 @cached_property 63 def additional_properties_type(): 64 """ 65 This must be a method because a model may have properties that are 66 of type self, this must run after the class is loaded 67 """ 68 return ( 69 bool, 70 date, 71 datetime, 72 dict, 73 float, 74 int, 75 list, 76 str, 77 none_type, 78 ) # noqa: E501 79 80 _nullable = False 81 82 @cached_property 83 def openapi_types(): 84 """ 85 This must be a method because a model may have properties that are 86 of type self, this must run after the class is loaded 87 88 Returns 89 openapi_types (dict): The key is attribute name 90 and the value is attribute type. 91 """ 92 return { 93 "upserted_count": (int,), # noqa: E501 94 } 95 96 @cached_property 97 def discriminator(): 98 return None 99 100 attribute_map = { 101 "upserted_count": "upsertedCount", # noqa: E501 102 } 103 104 read_only_vars = {} 105 106 _composed_schemas = {} 107 108 @classmethod 109 @convert_js_args_to_python_args 110 def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 111 """UpsertResponse - a model defined in OpenAPI 112 113 Keyword Args: 114 _check_type (bool): if True, values for parameters in openapi_types 115 will be type checked and a TypeError will be 116 raised if the wrong type is input. 117 Defaults to True 118 _path_to_item (tuple/list): This is a list of keys or values to 119 drill down to the model in received_data 120 when deserializing a response 121 _spec_property_naming (bool): True if the variable names in the input data 122 are serialized names, as specified in the OpenAPI document. 123 False if the variable names in the input data 124 are pythonic names, e.g. snake case (default) 125 _configuration (Configuration): the instance to use when 126 deserializing a file_type parameter. 127 If passed, type conversion is attempted 128 If omitted no type conversion is done. 129 _visited_composed_classes (tuple): This stores a tuple of 130 classes that we have traveled through so that 131 if we see that class again we will not use its 132 discriminator again. 133 When traveling through a discriminator, the 134 composed schema that is 135 is traveled through is added to this set. 136 For example if Animal has a discriminator 137 petType and we pass in "Dog", and the class Dog 138 allOf includes Animal, we move through Animal 139 once using the discriminator, and pick Dog. 140 Then in Dog, we will make an instance of the 141 Animal class but this time we won't travel 142 through its discriminator because we passed in 143 _visited_composed_classes = (Animal,) 144 upserted_count (int): The number of vectors upserted.. [optional] # noqa: E501 145 """ 146 147 _check_type = kwargs.pop("_check_type", True) 148 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 149 _path_to_item = kwargs.pop("_path_to_item", ()) 150 _configuration = kwargs.pop("_configuration", None) 151 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 152 153 self = super(OpenApiModel, cls).__new__(cls) 154 155 if args: 156 raise ApiTypeError( 157 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 158 % ( 159 args, 160 self.__class__.__name__, 161 ), 162 path_to_item=_path_to_item, 163 valid_classes=(self.__class__,), 164 ) 165 166 self._data_store = {} 167 self._check_type = _check_type 168 self._spec_property_naming = _spec_property_naming 169 self._path_to_item = _path_to_item 170 self._configuration = _configuration 171 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 172 173 for var_name, var_value in kwargs.items(): 174 if ( 175 var_name not in self.attribute_map 176 and self._configuration is not None 177 and self._configuration.discard_unknown_keys 178 and self.additional_properties_type is None 179 ): 180 # discard variable. 181 continue 182 setattr(self, var_name, var_value) 183 return self 184 185 required_properties = set( 186 [ 187 "_data_store", 188 "_check_type", 189 "_spec_property_naming", 190 "_path_to_item", 191 "_configuration", 192 "_visited_composed_classes", 193 ] 194 ) 195 196 @convert_js_args_to_python_args 197 def __init__(self, *args, **kwargs): # noqa: E501 198 """UpsertResponse - a model defined in OpenAPI 199 200 Keyword Args: 201 _check_type (bool): if True, values for parameters in openapi_types 202 will be type checked and a TypeError will be 203 raised if the wrong type is input. 204 Defaults to True 205 _path_to_item (tuple/list): This is a list of keys or values to 206 drill down to the model in received_data 207 when deserializing a response 208 _spec_property_naming (bool): True if the variable names in the input data 209 are serialized names, as specified in the OpenAPI document. 210 False if the variable names in the input data 211 are pythonic names, e.g. snake case (default) 212 _configuration (Configuration): the instance to use when 213 deserializing a file_type parameter. 214 If passed, type conversion is attempted 215 If omitted no type conversion is done. 216 _visited_composed_classes (tuple): This stores a tuple of 217 classes that we have traveled through so that 218 if we see that class again we will not use its 219 discriminator again. 220 When traveling through a discriminator, the 221 composed schema that is 222 is traveled through is added to this set. 223 For example if Animal has a discriminator 224 petType and we pass in "Dog", and the class Dog 225 allOf includes Animal, we move through Animal 226 once using the discriminator, and pick Dog. 227 Then in Dog, we will make an instance of the 228 Animal class but this time we won't travel 229 through its discriminator because we passed in 230 _visited_composed_classes = (Animal,) 231 upserted_count (int): The number of vectors upserted.. [optional] # noqa: E501 232 """ 233 234 _check_type = kwargs.pop("_check_type", True) 235 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 236 _path_to_item = kwargs.pop("_path_to_item", ()) 237 _configuration = kwargs.pop("_configuration", None) 238 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 239 240 if args: 241 raise ApiTypeError( 242 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 243 % ( 244 args, 245 self.__class__.__name__, 246 ), 247 path_to_item=_path_to_item, 248 valid_classes=(self.__class__,), 249 ) 250 251 self._data_store = {} 252 self._check_type = _check_type 253 self._spec_property_naming = _spec_property_naming 254 self._path_to_item = _path_to_item 255 self._configuration = _configuration 256 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 257 258 for var_name, var_value in kwargs.items(): 259 if ( 260 var_name not in self.attribute_map 261 and self._configuration is not None 262 and self._configuration.discard_unknown_keys 263 and self.additional_properties_type is None 264 ): 265 # discard variable. 266 continue 267 setattr(self, var_name, var_value) 268 if var_name in self.read_only_vars: 269 raise ApiAttributeError( 270 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 271 f"class with read only attributes." 272 )
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.
196 @convert_js_args_to_python_args 197 def __init__(self, *args, **kwargs): # noqa: E501 198 """UpsertResponse - a model defined in OpenAPI 199 200 Keyword Args: 201 _check_type (bool): if True, values for parameters in openapi_types 202 will be type checked and a TypeError will be 203 raised if the wrong type is input. 204 Defaults to True 205 _path_to_item (tuple/list): This is a list of keys or values to 206 drill down to the model in received_data 207 when deserializing a response 208 _spec_property_naming (bool): True if the variable names in the input data 209 are serialized names, as specified in the OpenAPI document. 210 False if the variable names in the input data 211 are pythonic names, e.g. snake case (default) 212 _configuration (Configuration): the instance to use when 213 deserializing a file_type parameter. 214 If passed, type conversion is attempted 215 If omitted no type conversion is done. 216 _visited_composed_classes (tuple): This stores a tuple of 217 classes that we have traveled through so that 218 if we see that class again we will not use its 219 discriminator again. 220 When traveling through a discriminator, the 221 composed schema that is 222 is traveled through is added to this set. 223 For example if Animal has a discriminator 224 petType and we pass in "Dog", and the class Dog 225 allOf includes Animal, we move through Animal 226 once using the discriminator, and pick Dog. 227 Then in Dog, we will make an instance of the 228 Animal class but this time we won't travel 229 through its discriminator because we passed in 230 _visited_composed_classes = (Animal,) 231 upserted_count (int): The number of vectors upserted.. [optional] # noqa: E501 232 """ 233 234 _check_type = kwargs.pop("_check_type", True) 235 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 236 _path_to_item = kwargs.pop("_path_to_item", ()) 237 _configuration = kwargs.pop("_configuration", None) 238 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 239 240 if args: 241 raise ApiTypeError( 242 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 243 % ( 244 args, 245 self.__class__.__name__, 246 ), 247 path_to_item=_path_to_item, 248 valid_classes=(self.__class__,), 249 ) 250 251 self._data_store = {} 252 self._check_type = _check_type 253 self._spec_property_naming = _spec_property_naming 254 self._path_to_item = _path_to_item 255 self._configuration = _configuration 256 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 257 258 for var_name, var_value in kwargs.items(): 259 if ( 260 var_name not in self.attribute_map 261 and self._configuration is not None 262 and self._configuration.discard_unknown_keys 263 and self.additional_properties_type is None 264 ): 265 # discard variable. 266 continue 267 setattr(self, var_name, var_value) 268 if var_name in self.read_only_vars: 269 raise ApiAttributeError( 270 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 271 f"class with read only attributes." 272 )
UpsertResponse - 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,) upserted_count (int): The number of vectors upserted.. [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.
40class UpdateRequest(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 "set_metadata": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 111 "namespace": (str,), # noqa: E501 112 } 113 114 @cached_property 115 def discriminator(): 116 return None 117 118 attribute_map = { 119 "id": "id", # noqa: E501 120 "values": "values", # noqa: E501 121 "sparse_values": "sparseValues", # noqa: E501 122 "set_metadata": "setMetadata", # noqa: E501 123 "namespace": "namespace", # noqa: E501 124 } 125 126 read_only_vars = {} 127 128 _composed_schemas = {} 129 130 @classmethod 131 @convert_js_args_to_python_args 132 def _from_openapi_data(cls, id, *args, **kwargs): # noqa: E501 133 """UpdateRequest - a model defined in OpenAPI 134 135 Args: 136 id (str): Vector's unique id. 137 138 Keyword Args: 139 _check_type (bool): if True, values for parameters in openapi_types 140 will be type checked and a TypeError will be 141 raised if the wrong type is input. 142 Defaults to True 143 _path_to_item (tuple/list): This is a list of keys or values to 144 drill down to the model in received_data 145 when deserializing a response 146 _spec_property_naming (bool): True if the variable names in the input data 147 are serialized names, as specified in the OpenAPI document. 148 False if the variable names in the input data 149 are pythonic names, e.g. snake case (default) 150 _configuration (Configuration): the instance to use when 151 deserializing a file_type parameter. 152 If passed, type conversion is attempted 153 If omitted no type conversion is done. 154 _visited_composed_classes (tuple): This stores a tuple of 155 classes that we have traveled through so that 156 if we see that class again we will not use its 157 discriminator again. 158 When traveling through a discriminator, the 159 composed schema that is 160 is traveled through is added to this set. 161 For example if Animal has a discriminator 162 petType and we pass in "Dog", and the class Dog 163 allOf includes Animal, we move through Animal 164 once using the discriminator, and pick Dog. 165 Then in Dog, we will make an instance of the 166 Animal class but this time we won't travel 167 through its discriminator because we passed in 168 _visited_composed_classes = (Animal,) 169 values ([float]): Vector data.. [optional] # noqa: E501 170 sparse_values (SparseValues): This is the sparse data of the vector to update [optional] # noqa: E501 171 set_metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Metadata to *set* for the vector.. [optional] # noqa: E501 172 namespace (str): Namespace name where to update the vector.. [optional] # noqa: E501 173 """ 174 175 _check_type = kwargs.pop("_check_type", True) 176 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 177 _path_to_item = kwargs.pop("_path_to_item", ()) 178 _configuration = kwargs.pop("_configuration", None) 179 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 180 181 self = super(OpenApiModel, cls).__new__(cls) 182 183 if args: 184 raise ApiTypeError( 185 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 186 % ( 187 args, 188 self.__class__.__name__, 189 ), 190 path_to_item=_path_to_item, 191 valid_classes=(self.__class__,), 192 ) 193 194 self._data_store = {} 195 self._check_type = _check_type 196 self._spec_property_naming = _spec_property_naming 197 self._path_to_item = _path_to_item 198 self._configuration = _configuration 199 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 200 201 self.id = id 202 for var_name, var_value in kwargs.items(): 203 if ( 204 var_name not in self.attribute_map 205 and self._configuration is not None 206 and self._configuration.discard_unknown_keys 207 and self.additional_properties_type is None 208 ): 209 # discard variable. 210 continue 211 setattr(self, var_name, var_value) 212 return self 213 214 required_properties = set( 215 [ 216 "_data_store", 217 "_check_type", 218 "_spec_property_naming", 219 "_path_to_item", 220 "_configuration", 221 "_visited_composed_classes", 222 ] 223 ) 224 225 @convert_js_args_to_python_args 226 def __init__(self, id, *args, **kwargs): # noqa: E501 227 """UpdateRequest - a model defined in OpenAPI 228 229 Args: 230 id (str): Vector's unique id. 231 232 Keyword Args: 233 _check_type (bool): if True, values for parameters in openapi_types 234 will be type checked and a TypeError will be 235 raised if the wrong type is input. 236 Defaults to True 237 _path_to_item (tuple/list): This is a list of keys or values to 238 drill down to the model in received_data 239 when deserializing a response 240 _spec_property_naming (bool): True if the variable names in the input data 241 are serialized names, as specified in the OpenAPI document. 242 False if the variable names in the input data 243 are pythonic names, e.g. snake case (default) 244 _configuration (Configuration): the instance to use when 245 deserializing a file_type parameter. 246 If passed, type conversion is attempted 247 If omitted no type conversion is done. 248 _visited_composed_classes (tuple): This stores a tuple of 249 classes that we have traveled through so that 250 if we see that class again we will not use its 251 discriminator again. 252 When traveling through a discriminator, the 253 composed schema that is 254 is traveled through is added to this set. 255 For example if Animal has a discriminator 256 petType and we pass in "Dog", and the class Dog 257 allOf includes Animal, we move through Animal 258 once using the discriminator, and pick Dog. 259 Then in Dog, we will make an instance of the 260 Animal class but this time we won't travel 261 through its discriminator because we passed in 262 _visited_composed_classes = (Animal,) 263 values ([float]): Vector data.. [optional] # noqa: E501 264 sparse_values (SparseValues): This is the sparse data of the vector to update [optional] # noqa: E501 265 set_metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Metadata to *set* for the vector.. [optional] # noqa: E501 266 namespace (str): Namespace name where to update the vector.. [optional] # noqa: E501 267 """ 268 269 _check_type = kwargs.pop("_check_type", True) 270 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 271 _path_to_item = kwargs.pop("_path_to_item", ()) 272 _configuration = kwargs.pop("_configuration", None) 273 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 274 275 if args: 276 raise ApiTypeError( 277 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 278 % ( 279 args, 280 self.__class__.__name__, 281 ), 282 path_to_item=_path_to_item, 283 valid_classes=(self.__class__,), 284 ) 285 286 self._data_store = {} 287 self._check_type = _check_type 288 self._spec_property_naming = _spec_property_naming 289 self._path_to_item = _path_to_item 290 self._configuration = _configuration 291 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 292 293 self.id = id 294 for var_name, var_value in kwargs.items(): 295 if ( 296 var_name not in self.attribute_map 297 and self._configuration is not None 298 and self._configuration.discard_unknown_keys 299 and self.additional_properties_type is None 300 ): 301 # discard variable. 302 continue 303 setattr(self, var_name, var_value) 304 if var_name in self.read_only_vars: 305 raise ApiAttributeError( 306 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 307 f"class with read only attributes." 308 )
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.
225 @convert_js_args_to_python_args 226 def __init__(self, id, *args, **kwargs): # noqa: E501 227 """UpdateRequest - a model defined in OpenAPI 228 229 Args: 230 id (str): Vector's unique id. 231 232 Keyword Args: 233 _check_type (bool): if True, values for parameters in openapi_types 234 will be type checked and a TypeError will be 235 raised if the wrong type is input. 236 Defaults to True 237 _path_to_item (tuple/list): This is a list of keys or values to 238 drill down to the model in received_data 239 when deserializing a response 240 _spec_property_naming (bool): True if the variable names in the input data 241 are serialized names, as specified in the OpenAPI document. 242 False if the variable names in the input data 243 are pythonic names, e.g. snake case (default) 244 _configuration (Configuration): the instance to use when 245 deserializing a file_type parameter. 246 If passed, type conversion is attempted 247 If omitted no type conversion is done. 248 _visited_composed_classes (tuple): This stores a tuple of 249 classes that we have traveled through so that 250 if we see that class again we will not use its 251 discriminator again. 252 When traveling through a discriminator, the 253 composed schema that is 254 is traveled through is added to this set. 255 For example if Animal has a discriminator 256 petType and we pass in "Dog", and the class Dog 257 allOf includes Animal, we move through Animal 258 once using the discriminator, and pick Dog. 259 Then in Dog, we will make an instance of the 260 Animal class but this time we won't travel 261 through its discriminator because we passed in 262 _visited_composed_classes = (Animal,) 263 values ([float]): Vector data.. [optional] # noqa: E501 264 sparse_values (SparseValues): This is the sparse data of the vector to update [optional] # noqa: E501 265 set_metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Metadata to *set* for the vector.. [optional] # noqa: E501 266 namespace (str): Namespace name where to update the vector.. [optional] # noqa: E501 267 """ 268 269 _check_type = kwargs.pop("_check_type", True) 270 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 271 _path_to_item = kwargs.pop("_path_to_item", ()) 272 _configuration = kwargs.pop("_configuration", None) 273 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 274 275 if args: 276 raise ApiTypeError( 277 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 278 % ( 279 args, 280 self.__class__.__name__, 281 ), 282 path_to_item=_path_to_item, 283 valid_classes=(self.__class__,), 284 ) 285 286 self._data_store = {} 287 self._check_type = _check_type 288 self._spec_property_naming = _spec_property_naming 289 self._path_to_item = _path_to_item 290 self._configuration = _configuration 291 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 292 293 self.id = id 294 for var_name, var_value in kwargs.items(): 295 if ( 296 var_name not in self.attribute_map 297 and self._configuration is not None 298 and self._configuration.discard_unknown_keys 299 and self.additional_properties_type is None 300 ): 301 # discard variable. 302 continue 303 setattr(self, var_name, var_value) 304 if var_name in self.read_only_vars: 305 raise ApiAttributeError( 306 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 307 f"class with read only attributes." 308 )
UpdateRequest - a model defined in OpenAPI
Arguments:
- id (str): Vector's unique id.
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,) values ([float]): Vector data.. [optional] # noqa: E501 sparse_values (SparseValues): This is the sparse data of the vector to update [optional] # noqa: E501 set_metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Metadata to set for the vector.. [optional] # noqa: E501 namespace (str): Namespace name where to update the vector.. [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.
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.
34class DeleteRequest(ModelNormal): 35 """NOTE: This class is auto generated by OpenAPI Generator. 36 Ref: https://openapi-generator.tech 37 38 Do not edit the class manually. 39 40 Attributes: 41 allowed_values (dict): The key is the tuple path to the attribute 42 and the for var_name this is (var_name,). The value is a dict 43 with a capitalized key describing the allowed value and an allowed 44 value. These dicts store the allowed enum values. 45 attribute_map (dict): The key is attribute name 46 and the value is json key in definition. 47 discriminator_value_class_map (dict): A dict to go from the discriminator 48 variable value to the discriminator class name. 49 validations (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 that stores validations for max_length, min_length, max_items, 52 min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, 53 inclusive_minimum, and regex. 54 additional_properties_type (tuple): A tuple of classes accepted 55 as additional properties values. 56 """ 57 58 allowed_values = {} 59 60 validations = { 61 ("ids",): {}, 62 } 63 64 @cached_property 65 def additional_properties_type(): 66 """ 67 This must be a method because a model may have properties that are 68 of type self, this must run after the class is loaded 69 """ 70 return ( 71 bool, 72 date, 73 datetime, 74 dict, 75 float, 76 int, 77 list, 78 str, 79 none_type, 80 ) # noqa: E501 81 82 _nullable = False 83 84 @cached_property 85 def openapi_types(): 86 """ 87 This must be a method because a model may have properties that are 88 of type self, this must run after the class is loaded 89 90 Returns 91 openapi_types (dict): The key is attribute name 92 and the value is attribute type. 93 """ 94 return { 95 "ids": ([str],), # noqa: E501 96 "delete_all": (bool,), # noqa: E501 97 "namespace": (str,), # noqa: E501 98 "filter": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 99 } 100 101 @cached_property 102 def discriminator(): 103 return None 104 105 attribute_map = { 106 "ids": "ids", # noqa: E501 107 "delete_all": "deleteAll", # noqa: E501 108 "namespace": "namespace", # noqa: E501 109 "filter": "filter", # noqa: E501 110 } 111 112 read_only_vars = {} 113 114 _composed_schemas = {} 115 116 @classmethod 117 @convert_js_args_to_python_args 118 def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 119 """DeleteRequest - a model defined in OpenAPI 120 121 Keyword Args: 122 _check_type (bool): if True, values for parameters in openapi_types 123 will be type checked and a TypeError will be 124 raised if the wrong type is input. 125 Defaults to True 126 _path_to_item (tuple/list): This is a list of keys or values to 127 drill down to the model in received_data 128 when deserializing a response 129 _spec_property_naming (bool): True if the variable names in the input data 130 are serialized names, as specified in the OpenAPI document. 131 False if the variable names in the input data 132 are pythonic names, e.g. snake case (default) 133 _configuration (Configuration): the instance to use when 134 deserializing a file_type parameter. 135 If passed, type conversion is attempted 136 If omitted no type conversion is done. 137 _visited_composed_classes (tuple): This stores a tuple of 138 classes that we have traveled through so that 139 if we see that class again we will not use its 140 discriminator again. 141 When traveling through a discriminator, the 142 composed schema that is 143 is traveled through is added to this set. 144 For example if Animal has a discriminator 145 petType and we pass in "Dog", and the class Dog 146 allOf includes Animal, we move through Animal 147 once using the discriminator, and pick Dog. 148 Then in Dog, we will make an instance of the 149 Animal class but this time we won't travel 150 through its discriminator because we passed in 151 _visited_composed_classes = (Animal,) 152 ids ([str]): Vectors to delete.. [optional] # noqa: E501 153 delete_all (bool): This indicates that all vectors in the index namespace should be deleted.. [optional] if omitted the server will use the default value of False # noqa: E501 154 namespace (str): The namespace to delete vectors from, if applicable.. [optional] # noqa: E501 155 filter ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive with specifying ids to delete in the ids param or using delete_all=True. See https://www.pinecone.io/docs/metadata-filtering/.. [optional] # noqa: E501 156 """ 157 158 _check_type = kwargs.pop("_check_type", True) 159 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 160 _path_to_item = kwargs.pop("_path_to_item", ()) 161 _configuration = kwargs.pop("_configuration", None) 162 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 163 164 self = super(OpenApiModel, cls).__new__(cls) 165 166 if args: 167 raise ApiTypeError( 168 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 169 % ( 170 args, 171 self.__class__.__name__, 172 ), 173 path_to_item=_path_to_item, 174 valid_classes=(self.__class__,), 175 ) 176 177 self._data_store = {} 178 self._check_type = _check_type 179 self._spec_property_naming = _spec_property_naming 180 self._path_to_item = _path_to_item 181 self._configuration = _configuration 182 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 183 184 for var_name, var_value in kwargs.items(): 185 if ( 186 var_name not in self.attribute_map 187 and self._configuration is not None 188 and self._configuration.discard_unknown_keys 189 and self.additional_properties_type is None 190 ): 191 # discard variable. 192 continue 193 setattr(self, var_name, var_value) 194 return self 195 196 required_properties = set( 197 [ 198 "_data_store", 199 "_check_type", 200 "_spec_property_naming", 201 "_path_to_item", 202 "_configuration", 203 "_visited_composed_classes", 204 ] 205 ) 206 207 @convert_js_args_to_python_args 208 def __init__(self, *args, **kwargs): # noqa: E501 209 """DeleteRequest - a model defined in OpenAPI 210 211 Keyword Args: 212 _check_type (bool): if True, values for parameters in openapi_types 213 will be type checked and a TypeError will be 214 raised if the wrong type is input. 215 Defaults to True 216 _path_to_item (tuple/list): This is a list of keys or values to 217 drill down to the model in received_data 218 when deserializing a response 219 _spec_property_naming (bool): True if the variable names in the input data 220 are serialized names, as specified in the OpenAPI document. 221 False if the variable names in the input data 222 are pythonic names, e.g. snake case (default) 223 _configuration (Configuration): the instance to use when 224 deserializing a file_type parameter. 225 If passed, type conversion is attempted 226 If omitted no type conversion is done. 227 _visited_composed_classes (tuple): This stores a tuple of 228 classes that we have traveled through so that 229 if we see that class again we will not use its 230 discriminator again. 231 When traveling through a discriminator, the 232 composed schema that is 233 is traveled through is added to this set. 234 For example if Animal has a discriminator 235 petType and we pass in "Dog", and the class Dog 236 allOf includes Animal, we move through Animal 237 once using the discriminator, and pick Dog. 238 Then in Dog, we will make an instance of the 239 Animal class but this time we won't travel 240 through its discriminator because we passed in 241 _visited_composed_classes = (Animal,) 242 ids ([str]): Vectors to delete.. [optional] # noqa: E501 243 delete_all (bool): This indicates that all vectors in the index namespace should be deleted.. [optional] if omitted the server will use the default value of False # noqa: E501 244 namespace (str): The namespace to delete vectors from, if applicable.. [optional] # noqa: E501 245 filter ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive with specifying ids to delete in the ids param or using delete_all=True. See https://www.pinecone.io/docs/metadata-filtering/.. [optional] # noqa: E501 246 """ 247 248 _check_type = kwargs.pop("_check_type", True) 249 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 250 _path_to_item = kwargs.pop("_path_to_item", ()) 251 _configuration = kwargs.pop("_configuration", None) 252 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 253 254 if args: 255 raise ApiTypeError( 256 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 257 % ( 258 args, 259 self.__class__.__name__, 260 ), 261 path_to_item=_path_to_item, 262 valid_classes=(self.__class__,), 263 ) 264 265 self._data_store = {} 266 self._check_type = _check_type 267 self._spec_property_naming = _spec_property_naming 268 self._path_to_item = _path_to_item 269 self._configuration = _configuration 270 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 271 272 for var_name, var_value in kwargs.items(): 273 if ( 274 var_name not in self.attribute_map 275 and self._configuration is not None 276 and self._configuration.discard_unknown_keys 277 and self.additional_properties_type is None 278 ): 279 # discard variable. 280 continue 281 setattr(self, var_name, var_value) 282 if var_name in self.read_only_vars: 283 raise ApiAttributeError( 284 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 285 f"class with read only attributes." 286 )
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.
207 @convert_js_args_to_python_args 208 def __init__(self, *args, **kwargs): # noqa: E501 209 """DeleteRequest - a model defined in OpenAPI 210 211 Keyword Args: 212 _check_type (bool): if True, values for parameters in openapi_types 213 will be type checked and a TypeError will be 214 raised if the wrong type is input. 215 Defaults to True 216 _path_to_item (tuple/list): This is a list of keys or values to 217 drill down to the model in received_data 218 when deserializing a response 219 _spec_property_naming (bool): True if the variable names in the input data 220 are serialized names, as specified in the OpenAPI document. 221 False if the variable names in the input data 222 are pythonic names, e.g. snake case (default) 223 _configuration (Configuration): the instance to use when 224 deserializing a file_type parameter. 225 If passed, type conversion is attempted 226 If omitted no type conversion is done. 227 _visited_composed_classes (tuple): This stores a tuple of 228 classes that we have traveled through so that 229 if we see that class again we will not use its 230 discriminator again. 231 When traveling through a discriminator, the 232 composed schema that is 233 is traveled through is added to this set. 234 For example if Animal has a discriminator 235 petType and we pass in "Dog", and the class Dog 236 allOf includes Animal, we move through Animal 237 once using the discriminator, and pick Dog. 238 Then in Dog, we will make an instance of the 239 Animal class but this time we won't travel 240 through its discriminator because we passed in 241 _visited_composed_classes = (Animal,) 242 ids ([str]): Vectors to delete.. [optional] # noqa: E501 243 delete_all (bool): This indicates that all vectors in the index namespace should be deleted.. [optional] if omitted the server will use the default value of False # noqa: E501 244 namespace (str): The namespace to delete vectors from, if applicable.. [optional] # noqa: E501 245 filter ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive with specifying ids to delete in the ids param or using delete_all=True. See https://www.pinecone.io/docs/metadata-filtering/.. [optional] # noqa: E501 246 """ 247 248 _check_type = kwargs.pop("_check_type", True) 249 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 250 _path_to_item = kwargs.pop("_path_to_item", ()) 251 _configuration = kwargs.pop("_configuration", None) 252 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 253 254 if args: 255 raise ApiTypeError( 256 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 257 % ( 258 args, 259 self.__class__.__name__, 260 ), 261 path_to_item=_path_to_item, 262 valid_classes=(self.__class__,), 263 ) 264 265 self._data_store = {} 266 self._check_type = _check_type 267 self._spec_property_naming = _spec_property_naming 268 self._path_to_item = _path_to_item 269 self._configuration = _configuration 270 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 271 272 for var_name, var_value in kwargs.items(): 273 if ( 274 var_name not in self.attribute_map 275 and self._configuration is not None 276 and self._configuration.discard_unknown_keys 277 and self.additional_properties_type is None 278 ): 279 # discard variable. 280 continue 281 setattr(self, var_name, var_value) 282 if var_name in self.read_only_vars: 283 raise ApiAttributeError( 284 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 285 f"class with read only attributes." 286 )
DeleteRequest - 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,) ids ([str]): Vectors to delete.. [optional] # noqa: E501 delete_all (bool): This indicates that all vectors in the index namespace should be deleted.. [optional] if omitted the server will use the default value of False # noqa: E501 namespace (str): The namespace to delete vectors from, if applicable.. [optional] # noqa: E501 filter ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive with specifying ids to delete in the ids param or using delete_all=True. See https://www.pinecone.io/docs/metadata-filtering/.. [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.
34class DescribeIndexStatsRequest(ModelNormal): 35 """NOTE: This class is auto generated by OpenAPI Generator. 36 Ref: https://openapi-generator.tech 37 38 Do not edit the class manually. 39 40 Attributes: 41 allowed_values (dict): The key is the tuple path to the attribute 42 and the for var_name this is (var_name,). The value is a dict 43 with a capitalized key describing the allowed value and an allowed 44 value. These dicts store the allowed enum values. 45 attribute_map (dict): The key is attribute name 46 and the value is json key in definition. 47 discriminator_value_class_map (dict): A dict to go from the discriminator 48 variable value to the discriminator class name. 49 validations (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 that stores validations for max_length, min_length, max_items, 52 min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, 53 inclusive_minimum, and regex. 54 additional_properties_type (tuple): A tuple of classes accepted 55 as additional properties values. 56 """ 57 58 allowed_values = {} 59 60 validations = {} 61 62 @cached_property 63 def additional_properties_type(): 64 """ 65 This must be a method because a model may have properties that are 66 of type self, this must run after the class is loaded 67 """ 68 return ( 69 bool, 70 date, 71 datetime, 72 dict, 73 float, 74 int, 75 list, 76 str, 77 none_type, 78 ) # noqa: E501 79 80 _nullable = False 81 82 @cached_property 83 def openapi_types(): 84 """ 85 This must be a method because a model may have properties that are 86 of type self, this must run after the class is loaded 87 88 Returns 89 openapi_types (dict): The key is attribute name 90 and the value is attribute type. 91 """ 92 return { 93 "filter": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 94 } 95 96 @cached_property 97 def discriminator(): 98 return None 99 100 attribute_map = { 101 "filter": "filter", # noqa: E501 102 } 103 104 read_only_vars = {} 105 106 _composed_schemas = {} 107 108 @classmethod 109 @convert_js_args_to_python_args 110 def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 111 """DescribeIndexStatsRequest - a model defined in OpenAPI 112 113 Keyword Args: 114 _check_type (bool): if True, values for parameters in openapi_types 115 will be type checked and a TypeError will be 116 raised if the wrong type is input. 117 Defaults to True 118 _path_to_item (tuple/list): This is a list of keys or values to 119 drill down to the model in received_data 120 when deserializing a response 121 _spec_property_naming (bool): True if the variable names in the input data 122 are serialized names, as specified in the OpenAPI document. 123 False if the variable names in the input data 124 are pythonic names, e.g. snake case (default) 125 _configuration (Configuration): the instance to use when 126 deserializing a file_type parameter. 127 If passed, type conversion is attempted 128 If omitted no type conversion is done. 129 _visited_composed_classes (tuple): This stores a tuple of 130 classes that we have traveled through so that 131 if we see that class again we will not use its 132 discriminator again. 133 When traveling through a discriminator, the 134 composed schema that is 135 is traveled through is added to this set. 136 For example if Animal has a discriminator 137 petType and we pass in "Dog", and the class Dog 138 allOf includes Animal, we move through Animal 139 once using the discriminator, and pick Dog. 140 Then in Dog, we will make an instance of the 141 Animal class but this time we won't travel 142 through its discriminator because we passed in 143 _visited_composed_classes = (Animal,) 144 filter ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): If this parameter is present, the operation only returns statistics for vectors that satisfy the filter. See https://www.pinecone.io/docs/metadata-filtering/.. [optional] # noqa: E501 145 """ 146 147 _check_type = kwargs.pop("_check_type", True) 148 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 149 _path_to_item = kwargs.pop("_path_to_item", ()) 150 _configuration = kwargs.pop("_configuration", None) 151 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 152 153 self = super(OpenApiModel, cls).__new__(cls) 154 155 if args: 156 raise ApiTypeError( 157 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 158 % ( 159 args, 160 self.__class__.__name__, 161 ), 162 path_to_item=_path_to_item, 163 valid_classes=(self.__class__,), 164 ) 165 166 self._data_store = {} 167 self._check_type = _check_type 168 self._spec_property_naming = _spec_property_naming 169 self._path_to_item = _path_to_item 170 self._configuration = _configuration 171 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 172 173 for var_name, var_value in kwargs.items(): 174 if ( 175 var_name not in self.attribute_map 176 and self._configuration is not None 177 and self._configuration.discard_unknown_keys 178 and self.additional_properties_type is None 179 ): 180 # discard variable. 181 continue 182 setattr(self, var_name, var_value) 183 return self 184 185 required_properties = set( 186 [ 187 "_data_store", 188 "_check_type", 189 "_spec_property_naming", 190 "_path_to_item", 191 "_configuration", 192 "_visited_composed_classes", 193 ] 194 ) 195 196 @convert_js_args_to_python_args 197 def __init__(self, *args, **kwargs): # noqa: E501 198 """DescribeIndexStatsRequest - a model defined in OpenAPI 199 200 Keyword Args: 201 _check_type (bool): if True, values for parameters in openapi_types 202 will be type checked and a TypeError will be 203 raised if the wrong type is input. 204 Defaults to True 205 _path_to_item (tuple/list): This is a list of keys or values to 206 drill down to the model in received_data 207 when deserializing a response 208 _spec_property_naming (bool): True if the variable names in the input data 209 are serialized names, as specified in the OpenAPI document. 210 False if the variable names in the input data 211 are pythonic names, e.g. snake case (default) 212 _configuration (Configuration): the instance to use when 213 deserializing a file_type parameter. 214 If passed, type conversion is attempted 215 If omitted no type conversion is done. 216 _visited_composed_classes (tuple): This stores a tuple of 217 classes that we have traveled through so that 218 if we see that class again we will not use its 219 discriminator again. 220 When traveling through a discriminator, the 221 composed schema that is 222 is traveled through is added to this set. 223 For example if Animal has a discriminator 224 petType and we pass in "Dog", and the class Dog 225 allOf includes Animal, we move through Animal 226 once using the discriminator, and pick Dog. 227 Then in Dog, we will make an instance of the 228 Animal class but this time we won't travel 229 through its discriminator because we passed in 230 _visited_composed_classes = (Animal,) 231 filter ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): If this parameter is present, the operation only returns statistics for vectors that satisfy the filter. See https://www.pinecone.io/docs/metadata-filtering/.. [optional] # noqa: E501 232 """ 233 234 _check_type = kwargs.pop("_check_type", True) 235 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 236 _path_to_item = kwargs.pop("_path_to_item", ()) 237 _configuration = kwargs.pop("_configuration", None) 238 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 239 240 if args: 241 raise ApiTypeError( 242 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 243 % ( 244 args, 245 self.__class__.__name__, 246 ), 247 path_to_item=_path_to_item, 248 valid_classes=(self.__class__,), 249 ) 250 251 self._data_store = {} 252 self._check_type = _check_type 253 self._spec_property_naming = _spec_property_naming 254 self._path_to_item = _path_to_item 255 self._configuration = _configuration 256 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 257 258 for var_name, var_value in kwargs.items(): 259 if ( 260 var_name not in self.attribute_map 261 and self._configuration is not None 262 and self._configuration.discard_unknown_keys 263 and self.additional_properties_type is None 264 ): 265 # discard variable. 266 continue 267 setattr(self, var_name, var_value) 268 if var_name in self.read_only_vars: 269 raise ApiAttributeError( 270 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 271 f"class with read only attributes." 272 )
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.
196 @convert_js_args_to_python_args 197 def __init__(self, *args, **kwargs): # noqa: E501 198 """DescribeIndexStatsRequest - a model defined in OpenAPI 199 200 Keyword Args: 201 _check_type (bool): if True, values for parameters in openapi_types 202 will be type checked and a TypeError will be 203 raised if the wrong type is input. 204 Defaults to True 205 _path_to_item (tuple/list): This is a list of keys or values to 206 drill down to the model in received_data 207 when deserializing a response 208 _spec_property_naming (bool): True if the variable names in the input data 209 are serialized names, as specified in the OpenAPI document. 210 False if the variable names in the input data 211 are pythonic names, e.g. snake case (default) 212 _configuration (Configuration): the instance to use when 213 deserializing a file_type parameter. 214 If passed, type conversion is attempted 215 If omitted no type conversion is done. 216 _visited_composed_classes (tuple): This stores a tuple of 217 classes that we have traveled through so that 218 if we see that class again we will not use its 219 discriminator again. 220 When traveling through a discriminator, the 221 composed schema that is 222 is traveled through is added to this set. 223 For example if Animal has a discriminator 224 petType and we pass in "Dog", and the class Dog 225 allOf includes Animal, we move through Animal 226 once using the discriminator, and pick Dog. 227 Then in Dog, we will make an instance of the 228 Animal class but this time we won't travel 229 through its discriminator because we passed in 230 _visited_composed_classes = (Animal,) 231 filter ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): If this parameter is present, the operation only returns statistics for vectors that satisfy the filter. See https://www.pinecone.io/docs/metadata-filtering/.. [optional] # noqa: E501 232 """ 233 234 _check_type = kwargs.pop("_check_type", True) 235 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 236 _path_to_item = kwargs.pop("_path_to_item", ()) 237 _configuration = kwargs.pop("_configuration", None) 238 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 239 240 if args: 241 raise ApiTypeError( 242 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 243 % ( 244 args, 245 self.__class__.__name__, 246 ), 247 path_to_item=_path_to_item, 248 valid_classes=(self.__class__,), 249 ) 250 251 self._data_store = {} 252 self._check_type = _check_type 253 self._spec_property_naming = _spec_property_naming 254 self._path_to_item = _path_to_item 255 self._configuration = _configuration 256 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 257 258 for var_name, var_value in kwargs.items(): 259 if ( 260 var_name not in self.attribute_map 261 and self._configuration is not None 262 and self._configuration.discard_unknown_keys 263 and self.additional_properties_type is None 264 ): 265 # discard variable. 266 continue 267 setattr(self, var_name, var_value) 268 if var_name in self.read_only_vars: 269 raise ApiAttributeError( 270 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 271 f"class with read only attributes." 272 )
DescribeIndexStatsRequest - 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,) filter ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): If this parameter is present, the operation only returns statistics for vectors that satisfy the filter. See https://www.pinecone.io/docs/metadata-filtering/.. [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.
34class SparseValues(ModelNormal): 35 """NOTE: This class is auto generated by OpenAPI Generator. 36 Ref: https://openapi-generator.tech 37 38 Do not edit the class manually. 39 40 Attributes: 41 allowed_values (dict): The key is the tuple path to the attribute 42 and the for var_name this is (var_name,). The value is a dict 43 with a capitalized key describing the allowed value and an allowed 44 value. These dicts store the allowed enum values. 45 attribute_map (dict): The key is attribute name 46 and the value is json key in definition. 47 discriminator_value_class_map (dict): A dict to go from the discriminator 48 variable value to the discriminator class name. 49 validations (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 that stores validations for max_length, min_length, max_items, 52 min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, 53 inclusive_minimum, and regex. 54 additional_properties_type (tuple): A tuple of classes accepted 55 as additional properties values. 56 """ 57 58 allowed_values = {} 59 60 validations = { 61 ("indices",): {}, 62 ("values",): {}, 63 } 64 65 @cached_property 66 def additional_properties_type(): 67 """ 68 This must be a method because a model may have properties that are 69 of type self, this must run after the class is loaded 70 """ 71 return ( 72 bool, 73 date, 74 datetime, 75 dict, 76 float, 77 int, 78 list, 79 str, 80 none_type, 81 ) # noqa: E501 82 83 _nullable = False 84 85 @cached_property 86 def openapi_types(): 87 """ 88 This must be a method because a model may have properties that are 89 of type self, this must run after the class is loaded 90 91 Returns 92 openapi_types (dict): The key is attribute name 93 and the value is attribute type. 94 """ 95 return { 96 "indices": ([int],), # noqa: E501 97 "values": ([float],), # noqa: E501 98 } 99 100 @cached_property 101 def discriminator(): 102 return None 103 104 attribute_map = { 105 "indices": "indices", # noqa: E501 106 "values": "values", # noqa: E501 107 } 108 109 read_only_vars = {} 110 111 _composed_schemas = {} 112 113 @classmethod 114 @convert_js_args_to_python_args 115 def _from_openapi_data(cls, indices, values, *args, **kwargs): # noqa: E501 116 """SparseValues - a model defined in OpenAPI 117 118 Args: 119 indices ([int]): 120 values ([float]): 121 122 Keyword Args: 123 _check_type (bool): if True, values for parameters in openapi_types 124 will be type checked and a TypeError will be 125 raised if the wrong type is input. 126 Defaults to True 127 _path_to_item (tuple/list): This is a list of keys or values to 128 drill down to the model in received_data 129 when deserializing a response 130 _spec_property_naming (bool): True if the variable names in the input data 131 are serialized names, as specified in the OpenAPI document. 132 False if the variable names in the input data 133 are pythonic names, e.g. snake case (default) 134 _configuration (Configuration): the instance to use when 135 deserializing a file_type parameter. 136 If passed, type conversion is attempted 137 If omitted no type conversion is done. 138 _visited_composed_classes (tuple): This stores a tuple of 139 classes that we have traveled through so that 140 if we see that class again we will not use its 141 discriminator again. 142 When traveling through a discriminator, the 143 composed schema that is 144 is traveled through is added to this set. 145 For example if Animal has a discriminator 146 petType and we pass in "Dog", and the class Dog 147 allOf includes Animal, we move through Animal 148 once using the discriminator, and pick Dog. 149 Then in Dog, we will make an instance of the 150 Animal class but this time we won't travel 151 through its discriminator because we passed in 152 _visited_composed_classes = (Animal,) 153 """ 154 155 _check_type = kwargs.pop("_check_type", True) 156 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 157 _path_to_item = kwargs.pop("_path_to_item", ()) 158 _configuration = kwargs.pop("_configuration", None) 159 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 160 161 self = super(OpenApiModel, cls).__new__(cls) 162 163 if args: 164 raise ApiTypeError( 165 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 166 % ( 167 args, 168 self.__class__.__name__, 169 ), 170 path_to_item=_path_to_item, 171 valid_classes=(self.__class__,), 172 ) 173 174 self._data_store = {} 175 self._check_type = _check_type 176 self._spec_property_naming = _spec_property_naming 177 self._path_to_item = _path_to_item 178 self._configuration = _configuration 179 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 180 181 self.indices = indices 182 self.values = values 183 for var_name, var_value in kwargs.items(): 184 if ( 185 var_name not in self.attribute_map 186 and self._configuration is not None 187 and self._configuration.discard_unknown_keys 188 and self.additional_properties_type is None 189 ): 190 # discard variable. 191 continue 192 setattr(self, var_name, var_value) 193 return self 194 195 required_properties = set( 196 [ 197 "_data_store", 198 "_check_type", 199 "_spec_property_naming", 200 "_path_to_item", 201 "_configuration", 202 "_visited_composed_classes", 203 ] 204 ) 205 206 @convert_js_args_to_python_args 207 def __init__(self, indices, values, *args, **kwargs): # noqa: E501 208 """SparseValues - a model defined in OpenAPI 209 210 Args: 211 indices ([int]): 212 values ([float]): 213 214 Keyword Args: 215 _check_type (bool): if True, values for parameters in openapi_types 216 will be type checked and a TypeError will be 217 raised if the wrong type is input. 218 Defaults to True 219 _path_to_item (tuple/list): This is a list of keys or values to 220 drill down to the model in received_data 221 when deserializing a response 222 _spec_property_naming (bool): True if the variable names in the input data 223 are serialized names, as specified in the OpenAPI document. 224 False if the variable names in the input data 225 are pythonic names, e.g. snake case (default) 226 _configuration (Configuration): the instance to use when 227 deserializing a file_type parameter. 228 If passed, type conversion is attempted 229 If omitted no type conversion is done. 230 _visited_composed_classes (tuple): This stores a tuple of 231 classes that we have traveled through so that 232 if we see that class again we will not use its 233 discriminator again. 234 When traveling through a discriminator, the 235 composed schema that is 236 is traveled through is added to this set. 237 For example if Animal has a discriminator 238 petType and we pass in "Dog", and the class Dog 239 allOf includes Animal, we move through Animal 240 once using the discriminator, and pick Dog. 241 Then in Dog, we will make an instance of the 242 Animal class but this time we won't travel 243 through its discriminator because we passed in 244 _visited_composed_classes = (Animal,) 245 """ 246 247 _check_type = kwargs.pop("_check_type", True) 248 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 249 _path_to_item = kwargs.pop("_path_to_item", ()) 250 _configuration = kwargs.pop("_configuration", None) 251 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 252 253 if args: 254 raise ApiTypeError( 255 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 256 % ( 257 args, 258 self.__class__.__name__, 259 ), 260 path_to_item=_path_to_item, 261 valid_classes=(self.__class__,), 262 ) 263 264 self._data_store = {} 265 self._check_type = _check_type 266 self._spec_property_naming = _spec_property_naming 267 self._path_to_item = _path_to_item 268 self._configuration = _configuration 269 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 270 271 self.indices = indices 272 self.values = values 273 for var_name, var_value in kwargs.items(): 274 if ( 275 var_name not in self.attribute_map 276 and self._configuration is not None 277 and self._configuration.discard_unknown_keys 278 and self.additional_properties_type is None 279 ): 280 # discard variable. 281 continue 282 setattr(self, var_name, var_value) 283 if var_name in self.read_only_vars: 284 raise ApiAttributeError( 285 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 286 f"class with read only attributes." 287 )
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.
206 @convert_js_args_to_python_args 207 def __init__(self, indices, values, *args, **kwargs): # noqa: E501 208 """SparseValues - a model defined in OpenAPI 209 210 Args: 211 indices ([int]): 212 values ([float]): 213 214 Keyword Args: 215 _check_type (bool): if True, values for parameters in openapi_types 216 will be type checked and a TypeError will be 217 raised if the wrong type is input. 218 Defaults to True 219 _path_to_item (tuple/list): This is a list of keys or values to 220 drill down to the model in received_data 221 when deserializing a response 222 _spec_property_naming (bool): True if the variable names in the input data 223 are serialized names, as specified in the OpenAPI document. 224 False if the variable names in the input data 225 are pythonic names, e.g. snake case (default) 226 _configuration (Configuration): the instance to use when 227 deserializing a file_type parameter. 228 If passed, type conversion is attempted 229 If omitted no type conversion is done. 230 _visited_composed_classes (tuple): This stores a tuple of 231 classes that we have traveled through so that 232 if we see that class again we will not use its 233 discriminator again. 234 When traveling through a discriminator, the 235 composed schema that is 236 is traveled through is added to this set. 237 For example if Animal has a discriminator 238 petType and we pass in "Dog", and the class Dog 239 allOf includes Animal, we move through Animal 240 once using the discriminator, and pick Dog. 241 Then in Dog, we will make an instance of the 242 Animal class but this time we won't travel 243 through its discriminator because we passed in 244 _visited_composed_classes = (Animal,) 245 """ 246 247 _check_type = kwargs.pop("_check_type", True) 248 _spec_property_naming = kwargs.pop("_spec_property_naming", False) 249 _path_to_item = kwargs.pop("_path_to_item", ()) 250 _configuration = kwargs.pop("_configuration", None) 251 _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 252 253 if args: 254 raise ApiTypeError( 255 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 256 % ( 257 args, 258 self.__class__.__name__, 259 ), 260 path_to_item=_path_to_item, 261 valid_classes=(self.__class__,), 262 ) 263 264 self._data_store = {} 265 self._check_type = _check_type 266 self._spec_property_naming = _spec_property_naming 267 self._path_to_item = _path_to_item 268 self._configuration = _configuration 269 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 270 271 self.indices = indices 272 self.values = values 273 for var_name, var_value in kwargs.items(): 274 if ( 275 var_name not in self.attribute_map 276 and self._configuration is not None 277 and self._configuration.discard_unknown_keys 278 and self.additional_properties_type is None 279 ): 280 # discard variable. 281 continue 282 setattr(self, var_name, var_value) 283 if var_name in self.read_only_vars: 284 raise ApiAttributeError( 285 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 286 f"class with read only attributes." 287 )
SparseValues - a model defined in OpenAPI
Arguments:
- indices ([int]):
- values ([float]):
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,)
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.