pinecone.core.client.api.vector_operations_api
Pinecone vector operations API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: version not set Contact: support@pinecone.io Generated by: https://openapi-generator.tech
1""" 2 Pinecone vector operations API 3 4 No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 5 6 The version of the OpenAPI document: version not set 7 Contact: support@pinecone.io 8 Generated by: https://openapi-generator.tech 9""" 10 11 12import re # noqa: F401 13import sys # noqa: F401 14 15from pinecone.core.client.api_client import ApiClient, Endpoint as _Endpoint 16from pinecone.core.client.model_utils import ( # noqa: F401 17 check_allowed_values, 18 check_validations, 19 date, 20 datetime, 21 file_type, 22 none_type, 23 validate_and_convert_types, 24) 25from pinecone.core.client.model.delete_request import DeleteRequest 26from pinecone.core.client.model.describe_index_stats_request import DescribeIndexStatsRequest 27from pinecone.core.client.model.describe_index_stats_response import DescribeIndexStatsResponse 28from pinecone.core.client.model.fetch_response import FetchResponse 29from pinecone.core.client.model.query_request import QueryRequest 30from pinecone.core.client.model.query_response import QueryResponse 31from pinecone.core.client.model.rpc_status import RpcStatus 32from pinecone.core.client.model.update_request import UpdateRequest 33from pinecone.core.client.model.upsert_request import UpsertRequest 34from pinecone.core.client.model.upsert_response import UpsertResponse 35 36 37class VectorOperationsApi(object): 38 """NOTE: This class is auto generated by OpenAPI Generator 39 Ref: https://openapi-generator.tech 40 41 Do not edit the class manually. 42 """ 43 44 def __init__(self, api_client=None): 45 if api_client is None: 46 api_client = ApiClient() 47 self.api_client = api_client 48 49 def __delete(self, delete_request, **kwargs): 50 """Delete # noqa: E501 51 52 The `Delete` operation deletes records by ID from a single namespace. # noqa: E501 53 This method makes a synchronous HTTP request by default. To make an 54 asynchronous HTTP request, pass async_req=True 55 56 >>> thread = api.delete(delete_request, async_req=True) 57 >>> result = thread.get() 58 59 Args: 60 delete_request (DeleteRequest): 61 62 Keyword Args: 63 _return_http_data_only (bool): Return response data without head status 64 code and headers. Default is True. 65 _preload_content (bool): if False, the urllib3.HTTPResponse object 66 is returned without reading or decoding response data. 67 Default is True. 68 _request_timeout (int/float/tuple): The timeout setting for this request. If 69 one number is provided, it is the total request timeout. It can also 70 be a pair (tuple) of (connection, read) timeouts. 71 Default is None. 72 _check_input_type (bool): Specifies if type checking 73 should be done on the data sent to the server. 74 Default is True. 75 _check_return_type (bool): Specifies if type checking 76 should be done on the data received from the server. 77 Default is True. 78 _host_index (int/None): Specifies the index of the server 79 that we want to use. 80 Default is to read from the configuration. 81 async_req (bool): execute request asynchronously 82 83 Returns: 84 {str: (bool, date, datetime, dict, float, int, list, str, none_type)} 85 If the method is called asynchronously, returns the request 86 thread. 87 """ 88 kwargs["async_req"] = kwargs.get("async_req", False) 89 kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) 90 kwargs["_preload_content"] = kwargs.get("_preload_content", True) 91 kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) 92 kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) 93 kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) 94 kwargs["_host_index"] = kwargs.get("_host_index") 95 kwargs["delete_request"] = delete_request 96 return self.call_with_http_info(**kwargs) 97 98 self.delete = _Endpoint( 99 settings={ 100 "response_type": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), 101 "auth": ["ApiKeyAuth"], 102 "endpoint_path": "/vectors/delete", 103 "operation_id": "delete", 104 "http_method": "POST", 105 "servers": None, 106 }, 107 params_map={ 108 "all": [ 109 "delete_request", 110 ], 111 "required": [ 112 "delete_request", 113 ], 114 "nullable": [], 115 "enum": [], 116 "validation": [], 117 }, 118 root_map={ 119 "validations": {}, 120 "allowed_values": {}, 121 "openapi_types": { 122 "delete_request": (DeleteRequest,), 123 }, 124 "attribute_map": {}, 125 "location_map": { 126 "delete_request": "body", 127 }, 128 "collection_format_map": {}, 129 }, 130 headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, 131 api_client=api_client, 132 callable=__delete, 133 ) 134 135 def __delete1(self, **kwargs): 136 """Delete # noqa: E501 137 138 The `Delete` operation deletes records by ID from a single namespace. # noqa: E501 139 This method makes a synchronous HTTP request by default. To make an 140 asynchronous HTTP request, pass async_req=True 141 142 >>> thread = api.delete1(async_req=True) 143 >>> result = thread.get() 144 145 146 Keyword Args: 147 ids ([str]): Vectors to delete. [optional] 148 delete_all (bool): This indicates that all records in the index namespace should be deleted. [optional] Default is False. 149 namespace (str): The namespace to delete records from, if applicable. [optional] 150 _return_http_data_only (bool): Response data without head status 151 code and headers. Default is True. 152 _preload_content (bool): If False, the urllib3.HTTPResponse object 153 is returned without reading or decoding response data. 154 Default is True. 155 _request_timeout (int/float/tuple): Timeout setting for this request. If 156 one number is provided, this number is the total request timeout. This argument can also 157 be a pair (tuple) of (connection, read) timeouts. 158 Default is None. 159 _check_input_type (bool): Specifies if type checking 160 should be done after the data is sent to the server. 161 Default is True. 162 _check_return_type (bool): Specifies if type checking 163 should be done after the data is received from the server. 164 Default is True. 165 _host_index (int/None): Specifies the index of the server 166 to use. 167 Default is to read from the configuration. 168 async_req (bool): execute request asynchronously 169 170 Returns: 171 {str: (bool, date, datetime, dict, float, int, list, str, none_type)} 172 If the method is called asynchronously, returns the request 173 thread. 174 """ 175 kwargs["async_req"] = kwargs.get("async_req", False) 176 kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) 177 kwargs["_preload_content"] = kwargs.get("_preload_content", True) 178 kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) 179 kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) 180 kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) 181 kwargs["_host_index"] = kwargs.get("_host_index") 182 return self.call_with_http_info(**kwargs) 183 184 self.delete1 = _Endpoint( 185 settings={ 186 "response_type": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), 187 "auth": ["ApiKeyAuth"], 188 "endpoint_path": "/vectors/delete", 189 "operation_id": "delete1", 190 "http_method": "DELETE", 191 "servers": None, 192 }, 193 params_map={ 194 "all": [ 195 "ids", 196 "delete_all", 197 "namespace", 198 ], 199 "required": [], 200 "nullable": [], 201 "enum": [], 202 "validation": [], 203 }, 204 root_map={ 205 "validations": {}, 206 "allowed_values": {}, 207 "openapi_types": { 208 "ids": ([str],), 209 "delete_all": (bool,), 210 "namespace": (str,), 211 }, 212 "attribute_map": { 213 "ids": "ids", 214 "delete_all": "deleteAll", 215 "namespace": "namespace", 216 }, 217 "location_map": { 218 "ids": "query", 219 "delete_all": "query", 220 "namespace": "query", 221 }, 222 "collection_format_map": { 223 "ids": "multi", 224 }, 225 }, 226 headers_map={ 227 "accept": ["application/json"], 228 "content_type": [], 229 }, 230 api_client=api_client, 231 callable=__delete1, 232 ) 233 234 def __describe_index_stats(self, describe_index_stats_request, **kwargs): 235 """DescribeIndexStats # noqa: E501 236 237 The `DescribeIndexStats` operation returns statistics about the index's contents, including the vector count per namespace, the number of dimensions, and the index fullness. The index fullness result may be inaccurate during pod resizing; to get the status of a pod resizing process, use [`describe_index`](https://www.pinecone.io/docs/api/operation/describe_index/). # noqa: E501 238 This method makes a synchronous HTTP request by default. To make an 239 asynchronous HTTP request, pass async_req=True 240 241 >>> thread = api.describe_index_stats(describe_index_stats_request, async_req=True) 242 >>> result = thread.get() 243 244 Args: 245 describe_index_stats_request (DescribeIndexStatsRequest): 246 247 Keyword Args: 248 _return_http_data_only (bool): Return head status 249 code or headers. Default is True. 250 _preload_content (bool): If False, the urllib3.HTTPResponse object 251 is returned without reading or decoding response data. 252 Default is True. 253 _request_timeout (int/float/tuple): The timeout setting for this request. If 254 one number is provided, it is the total request timeout. It can also 255 be a pair (tuple) of (connection, read) timeouts. 256 Default is None. 257 _check_input_type (bool): Specifies if type checking 258 should be done on the data sent to the server. 259 Default is True. 260 _check_return_type (bool): Specifies if type checking 261 should be done on the data received from the server. 262 Default is True. 263 _host_index (int/None): Specifies the index of the server 264 that we want to use. 265 Default is to read from the configuration. 266 async_req (bool): execute request asynchronously 267 268 Returns: 269 DescribeIndexStatsResponse 270 If the method is called asynchronously, returns the request 271 thread. 272 """ 273 kwargs["async_req"] = kwargs.get("async_req", False) 274 kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) 275 kwargs["_preload_content"] = kwargs.get("_preload_content", True) 276 kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) 277 kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) 278 kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) 279 kwargs["_host_index"] = kwargs.get("_host_index") 280 kwargs["describe_index_stats_request"] = describe_index_stats_request 281 return self.call_with_http_info(**kwargs) 282 283 self.describe_index_stats = _Endpoint( 284 settings={ 285 "response_type": (DescribeIndexStatsResponse,), 286 "auth": ["ApiKeyAuth"], 287 "endpoint_path": "/describe_index_stats", 288 "operation_id": "describe_index_stats", 289 "http_method": "POST", 290 "servers": None, 291 }, 292 params_map={ 293 "all": [ 294 "describe_index_stats_request", 295 ], 296 "required": [ 297 "describe_index_stats_request", 298 ], 299 "nullable": [], 300 "enum": [], 301 "validation": [], 302 }, 303 root_map={ 304 "validations": {}, 305 "allowed_values": {}, 306 "openapi_types": { 307 "describe_index_stats_request": (DescribeIndexStatsRequest,), 308 }, 309 "attribute_map": {}, 310 "location_map": { 311 "describe_index_stats_request": "body", 312 }, 313 "collection_format_map": {}, 314 }, 315 headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, 316 api_client=api_client, 317 callable=__describe_index_stats, 318 ) 319 320 def __describe_index_stats1(self, **kwargs): 321 """DescribeIndexStats # noqa: E501 322 323 The `DescribeIndexStats` operation returns statistics about the index's contents, including the vector count per namespace, the number of dimensions, and the index fullness. The index fullness result may be inaccurate during pod resizing; to get the status of a pod resizing process, use [`describe_index`](https://www.pinecone.io/docs/api/operation/describe_index/). # noqa: E501 324 This method makes a synchronous HTTP request by default. To make an 325 asynchronous HTTP request, pass async_req=True 326 327 >>> thread = api.describe_index_stats1(async_req=True) 328 >>> result = thread.get() 329 330 331 Keyword Args: 332 _return_http_data_only (bool): Response data without head status 333 code and headers. Default is True. 334 _preload_content (bool): if False, the urllib3.HTTPResponse object 335 is returned without reading or decoding response data. 336 Default is True. 337 _request_timeout (int/float/tuple): The timeout setting for this request. If 338 one number is provided, it is the total request timeout. It can also 339 be a pair (tuple) of (connection, read) timeouts. 340 Default is None. 341 _check_input_type (bool): Specifies if type checking 342 should be done on the data sent to the server. 343 Default is True. 344 _check_return_type (bool): Specifies if type checking 345 should be done on the data received from the server. 346 Default is True. 347 _host_index (int/None): Specifies the index of the server 348 that we want to use. 349 Default is to read from the configuration. 350 async_req (bool): execute request asynchronously 351 352 Returns: 353 DescribeIndexStatsResponse 354 If the method is called asynchronously, returns the request 355 thread. 356 """ 357 kwargs["async_req"] = kwargs.get("async_req", False) 358 kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) 359 kwargs["_preload_content"] = kwargs.get("_preload_content", True) 360 kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) 361 kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) 362 kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) 363 kwargs["_host_index"] = kwargs.get("_host_index") 364 return self.call_with_http_info(**kwargs) 365 366 self.describe_index_stats1 = _Endpoint( 367 settings={ 368 "response_type": (DescribeIndexStatsResponse,), 369 "auth": ["ApiKeyAuth"], 370 "endpoint_path": "/describe_index_stats", 371 "operation_id": "describe_index_stats1", 372 "http_method": "GET", 373 "servers": None, 374 }, 375 params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []}, 376 root_map={ 377 "validations": {}, 378 "allowed_values": {}, 379 "openapi_types": {}, 380 "attribute_map": {}, 381 "location_map": {}, 382 "collection_format_map": {}, 383 }, 384 headers_map={ 385 "accept": ["application/json"], 386 "content_type": [], 387 }, 388 api_client=api_client, 389 callable=__describe_index_stats1, 390 ) 391 392 def __fetch(self, ids, **kwargs): 393 """Fetch # noqa: E501 394 395 The `Fetch` operation looks up and returns vectors by ID from a single namespace. The returned vectors include the vector data and metadata. # noqa: E501 396 This method makes a synchronous HTTP request by default. To make an 397 asynchronous HTTP request, pass async_req=True 398 399 >>> thread = api.fetch(ids, async_req=True) 400 >>> result = thread.get() 401 402 Args: 403 ids ([str]): The vector IDs to fetch. Does not accept values containing spaces. 404 405 Keyword Args: 406 namespace (str): [optional] 407 _return_http_data_only (bool): Response data without head status 408 code and headers. Default is True. 409 _preload_content (bool): if False, the urllib3.HTTPResponse object 410 is returned without reading or decoding response data. 411 Default is True. 412 _request_timeout (int/float/tuple): The timeout setting for this request. If 413 one number is provided, it is the total request timeout. It can also 414 be a pair (tuple) of (connection, read) timeouts. 415 Default is None. 416 _check_input_type (bool): Specifies if type checking 417 should be done on the data sent to the server. 418 Default is True. 419 _check_return_type (bool): Specifies if type checking 420 should be done on the data received from the server. 421 Default is True. 422 _host_index (int/None): Specifies the index of the server 423 that we want to use. 424 Default is to read from the configuration. 425 async_req (bool): execute request asynchronously 426 427 Returns: 428 FetchResponse 429 If the method is called asynchronously, returns the request 430 thread. 431 """ 432 kwargs["async_req"] = kwargs.get("async_req", False) 433 kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) 434 kwargs["_preload_content"] = kwargs.get("_preload_content", True) 435 kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) 436 kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) 437 kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) 438 kwargs["_host_index"] = kwargs.get("_host_index") 439 kwargs["ids"] = ids 440 return self.call_with_http_info(**kwargs) 441 442 self.fetch = _Endpoint( 443 settings={ 444 "response_type": (FetchResponse,), 445 "auth": ["ApiKeyAuth"], 446 "endpoint_path": "/vectors/fetch", 447 "operation_id": "fetch", 448 "http_method": "GET", 449 "servers": None, 450 }, 451 params_map={ 452 "all": [ 453 "ids", 454 "namespace", 455 ], 456 "required": [ 457 "ids", 458 ], 459 "nullable": [], 460 "enum": [], 461 "validation": [], 462 }, 463 root_map={ 464 "validations": {}, 465 "allowed_values": {}, 466 "openapi_types": { 467 "ids": ([str],), 468 "namespace": (str,), 469 }, 470 "attribute_map": { 471 "ids": "ids", 472 "namespace": "namespace", 473 }, 474 "location_map": { 475 "ids": "query", 476 "namespace": "query", 477 }, 478 "collection_format_map": { 479 "ids": "multi", 480 }, 481 }, 482 headers_map={ 483 "accept": ["application/json"], 484 "content_type": [], 485 }, 486 api_client=api_client, 487 callable=__fetch, 488 ) 489 490 def __query(self, query_request, **kwargs): 491 """Query # noqa: E501 492 493 The `Query` operation searches a namespace using a query vector. It retrieves the IDs of the most similar records in a namespace along with their similarity scores. # noqa: E501 494 This method makes a synchronous HTTP request by default. To make an 495 asynchronous HTTP request, pass async_req=True 496 497 >>> thread = api.query(query_request, async_req=True) 498 >>> result = thread.get() 499 500 Args: 501 query_request (QueryRequest): 502 503 Keyword Args: 504 _return_http_data_only (bool): Return response data without head status 505 code and headers. Default is True. 506 _preload_content (bool): If False, the urllib3.HTTPResponse object 507 is returned without reading or decoding response data. 508 Default is True. 509 _request_timeout (int/float/tuple): The timeout setting for this request. If 510 one number is provided, it is the total request timeout. It can also 511 be a pair (tuple) of (connection, read) timeouts. 512 Default is None. 513 _check_input_type (bool): Specifies if type checking 514 should be done on the data sent to the server. 515 Default is True. 516 _check_return_type (bool): Specifies if type checking 517 should be done on the data received from the server. 518 Default is True. 519 _host_index (int/None): Specifies the index of the server 520 that we want to use. 521 Default is to read from the configuration. 522 async_req (bool): execute request asynchronously 523 524 Returns: 525 QueryResponse 526 If the method is called asynchronously, returns the request 527 thread. 528 """ 529 kwargs["async_req"] = kwargs.get("async_req", False) 530 kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) 531 kwargs["_preload_content"] = kwargs.get("_preload_content", True) 532 kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) 533 kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) 534 kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) 535 kwargs["_host_index"] = kwargs.get("_host_index") 536 kwargs["query_request"] = query_request 537 return self.call_with_http_info(**kwargs) 538 539 self.query = _Endpoint( 540 settings={ 541 "response_type": (QueryResponse,), 542 "auth": ["ApiKeyAuth"], 543 "endpoint_path": "/query", 544 "operation_id": "query", 545 "http_method": "POST", 546 "servers": None, 547 }, 548 params_map={ 549 "all": [ 550 "query_request", 551 ], 552 "required": [ 553 "query_request", 554 ], 555 "nullable": [], 556 "enum": [], 557 "validation": [], 558 }, 559 root_map={ 560 "validations": {}, 561 "allowed_values": {}, 562 "openapi_types": { 563 "query_request": (QueryRequest,), 564 }, 565 "attribute_map": {}, 566 "location_map": { 567 "query_request": "body", 568 }, 569 "collection_format_map": {}, 570 }, 571 headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, 572 api_client=api_client, 573 callable=__query, 574 ) 575 576 def __update(self, update_request, **kwargs): 577 """Update # noqa: E501 578 579 The `Update` operation updates a vector in a namespace. If a value is included, it overwrites the previous value. If set_metadata is included, the values of the fields specified in it are added to or overwrite the previous values. # noqa: E501 580 This method makes a synchronous HTTP request by default. To make an 581 asynchronous HTTP request, pass async_req=True 582 583 >>> thread = api.update(update_request, async_req=True) 584 >>> result = thread.get() 585 586 Args: 587 update_request (UpdateRequest): 588 589 Keyword Args: 590 _return_http_data_only (bool): Response head status 591 code and headers. Default is True. 592 _preload_content (bool): if False, the urllib3.HTTPResponse object 593 is returned without reading or decoding response data. 594 Default is True. 595 _request_timeout (int/float/tuple): The timeout setting for this request. If 596 one number is provided, it is the total request timeout. It can also 597 be a pair (tuple) of (connection, read) timeouts. 598 Default is None. 599 _check_input_type (bool): Specifies if type checking 600 should be done on the data sent to the server. 601 Default is True. 602 _check_return_type (bool): Specifies if type checking 603 should be done on the data received from the server. 604 Default is True. 605 _host_index (int/None): Specifies the index of the server 606 that we want to use. 607 Default is to read from the configuration. 608 async_req (bool): execute request asynchronously 609 610 Returns: 611 {str: (bool, date, datetime, dict, float, int, list, str, none_type)} 612 If the method is called asynchronously, returns the request 613 thread. 614 """ 615 kwargs["async_req"] = kwargs.get("async_req", False) 616 kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) 617 kwargs["_preload_content"] = kwargs.get("_preload_content", True) 618 kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) 619 kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) 620 kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) 621 kwargs["_host_index"] = kwargs.get("_host_index") 622 kwargs["update_request"] = update_request 623 return self.call_with_http_info(**kwargs) 624 625 self.update = _Endpoint( 626 settings={ 627 "response_type": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), 628 "auth": ["ApiKeyAuth"], 629 "endpoint_path": "/vectors/update", 630 "operation_id": "update", 631 "http_method": "POST", 632 "servers": None, 633 }, 634 params_map={ 635 "all": [ 636 "update_request", 637 ], 638 "required": [ 639 "update_request", 640 ], 641 "nullable": [], 642 "enum": [], 643 "validation": [], 644 }, 645 root_map={ 646 "validations": {}, 647 "allowed_values": {}, 648 "openapi_types": { 649 "update_request": (UpdateRequest,), 650 }, 651 "attribute_map": {}, 652 "location_map": { 653 "update_request": "body", 654 }, 655 "collection_format_map": {}, 656 }, 657 headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, 658 api_client=api_client, 659 callable=__update, 660 ) 661 662 def __upsert(self, upsert_request, **kwargs): 663 """Upsert # noqa: E501 664 665 The `Upsert` operation writes vectors into a namespace. If a new value is upserted for an existing vector ID, it overwrites the previous value. # noqa: E501 666 This method makes a synchronous HTTP request by default. To make an 667 asynchronous HTTP request, pass async_req=True 668 669 >>> thread = api.upsert(upsert_request, async_req=True) 670 >>> result = thread.get() 671 672 Args: 673 upsert_request (UpsertRequest): 674 675 Keyword Args: 676 _return_http_data_only (bool): Return response data without head status 677 code and headers. Default is True. 678 _preload_content (bool): if False, the urllib3.HTTPResponse object 679 is returned without reading or decoding response data. 680 Default is True. 681 _request_timeout (int/float/tuple): The timeout setting for this request. If 682 one number is provided, it is the total request timeout. It can also 683 be a pair (tuple) of (connection, read) timeouts. 684 Default is None. 685 _check_input_type (bool): Specifies if type checking 686 should be done on the data sent to the server. 687 Default is True. 688 _check_return_type (bool): Specifies if type checking 689 should be done on the data received from the server. 690 Default is True. 691 _host_index (int/None): Specifies the index of the server 692 that we want to use. 693 Default is to read from the configuration. 694 async_req (bool): execute request asynchronously 695 696 Returns: 697 UpsertResponse 698 If the method is called asynchronously, returns the request 699 thread. 700 """ 701 kwargs["async_req"] = kwargs.get("async_req", False) 702 kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) 703 kwargs["_preload_content"] = kwargs.get("_preload_content", True) 704 kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) 705 kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) 706 kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) 707 kwargs["_host_index"] = kwargs.get("_host_index") 708 kwargs["upsert_request"] = upsert_request 709 return self.call_with_http_info(**kwargs) 710 711 self.upsert = _Endpoint( 712 settings={ 713 "response_type": (UpsertResponse,), 714 "auth": ["ApiKeyAuth"], 715 "endpoint_path": "/vectors/upsert", 716 "operation_id": "upsert", 717 "http_method": "POST", 718 "servers": None, 719 }, 720 params_map={ 721 "all": [ 722 "upsert_request", 723 ], 724 "required": [ 725 "upsert_request", 726 ], 727 "nullable": [], 728 "enum": [], 729 "validation": [], 730 }, 731 root_map={ 732 "validations": {}, 733 "allowed_values": {}, 734 "openapi_types": { 735 "upsert_request": (UpsertRequest,), 736 }, 737 "attribute_map": {}, 738 "location_map": { 739 "upsert_request": "body", 740 }, 741 "collection_format_map": {}, 742 }, 743 headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, 744 api_client=api_client, 745 callable=__upsert, 746 )
class
VectorOperationsApi:
38class VectorOperationsApi(object): 39 """NOTE: This class is auto generated by OpenAPI Generator 40 Ref: https://openapi-generator.tech 41 42 Do not edit the class manually. 43 """ 44 45 def __init__(self, api_client=None): 46 if api_client is None: 47 api_client = ApiClient() 48 self.api_client = api_client 49 50 def __delete(self, delete_request, **kwargs): 51 """Delete # noqa: E501 52 53 The `Delete` operation deletes records by ID from a single namespace. # noqa: E501 54 This method makes a synchronous HTTP request by default. To make an 55 asynchronous HTTP request, pass async_req=True 56 57 >>> thread = api.delete(delete_request, async_req=True) 58 >>> result = thread.get() 59 60 Args: 61 delete_request (DeleteRequest): 62 63 Keyword Args: 64 _return_http_data_only (bool): Return response data without head status 65 code and headers. Default is True. 66 _preload_content (bool): if False, the urllib3.HTTPResponse object 67 is returned without reading or decoding response data. 68 Default is True. 69 _request_timeout (int/float/tuple): The timeout setting for this request. If 70 one number is provided, it is the total request timeout. It can also 71 be a pair (tuple) of (connection, read) timeouts. 72 Default is None. 73 _check_input_type (bool): Specifies if type checking 74 should be done on the data sent to the server. 75 Default is True. 76 _check_return_type (bool): Specifies if type checking 77 should be done on the data received from the server. 78 Default is True. 79 _host_index (int/None): Specifies the index of the server 80 that we want to use. 81 Default is to read from the configuration. 82 async_req (bool): execute request asynchronously 83 84 Returns: 85 {str: (bool, date, datetime, dict, float, int, list, str, none_type)} 86 If the method is called asynchronously, returns the request 87 thread. 88 """ 89 kwargs["async_req"] = kwargs.get("async_req", False) 90 kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) 91 kwargs["_preload_content"] = kwargs.get("_preload_content", True) 92 kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) 93 kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) 94 kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) 95 kwargs["_host_index"] = kwargs.get("_host_index") 96 kwargs["delete_request"] = delete_request 97 return self.call_with_http_info(**kwargs) 98 99 self.delete = _Endpoint( 100 settings={ 101 "response_type": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), 102 "auth": ["ApiKeyAuth"], 103 "endpoint_path": "/vectors/delete", 104 "operation_id": "delete", 105 "http_method": "POST", 106 "servers": None, 107 }, 108 params_map={ 109 "all": [ 110 "delete_request", 111 ], 112 "required": [ 113 "delete_request", 114 ], 115 "nullable": [], 116 "enum": [], 117 "validation": [], 118 }, 119 root_map={ 120 "validations": {}, 121 "allowed_values": {}, 122 "openapi_types": { 123 "delete_request": (DeleteRequest,), 124 }, 125 "attribute_map": {}, 126 "location_map": { 127 "delete_request": "body", 128 }, 129 "collection_format_map": {}, 130 }, 131 headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, 132 api_client=api_client, 133 callable=__delete, 134 ) 135 136 def __delete1(self, **kwargs): 137 """Delete # noqa: E501 138 139 The `Delete` operation deletes records by ID from a single namespace. # noqa: E501 140 This method makes a synchronous HTTP request by default. To make an 141 asynchronous HTTP request, pass async_req=True 142 143 >>> thread = api.delete1(async_req=True) 144 >>> result = thread.get() 145 146 147 Keyword Args: 148 ids ([str]): Vectors to delete. [optional] 149 delete_all (bool): This indicates that all records in the index namespace should be deleted. [optional] Default is False. 150 namespace (str): The namespace to delete records from, if applicable. [optional] 151 _return_http_data_only (bool): Response data without head status 152 code and headers. Default is True. 153 _preload_content (bool): If False, the urllib3.HTTPResponse object 154 is returned without reading or decoding response data. 155 Default is True. 156 _request_timeout (int/float/tuple): Timeout setting for this request. If 157 one number is provided, this number is the total request timeout. This argument can also 158 be a pair (tuple) of (connection, read) timeouts. 159 Default is None. 160 _check_input_type (bool): Specifies if type checking 161 should be done after the data is sent to the server. 162 Default is True. 163 _check_return_type (bool): Specifies if type checking 164 should be done after the data is received from the server. 165 Default is True. 166 _host_index (int/None): Specifies the index of the server 167 to use. 168 Default is to read from the configuration. 169 async_req (bool): execute request asynchronously 170 171 Returns: 172 {str: (bool, date, datetime, dict, float, int, list, str, none_type)} 173 If the method is called asynchronously, returns the request 174 thread. 175 """ 176 kwargs["async_req"] = kwargs.get("async_req", False) 177 kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) 178 kwargs["_preload_content"] = kwargs.get("_preload_content", True) 179 kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) 180 kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) 181 kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) 182 kwargs["_host_index"] = kwargs.get("_host_index") 183 return self.call_with_http_info(**kwargs) 184 185 self.delete1 = _Endpoint( 186 settings={ 187 "response_type": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), 188 "auth": ["ApiKeyAuth"], 189 "endpoint_path": "/vectors/delete", 190 "operation_id": "delete1", 191 "http_method": "DELETE", 192 "servers": None, 193 }, 194 params_map={ 195 "all": [ 196 "ids", 197 "delete_all", 198 "namespace", 199 ], 200 "required": [], 201 "nullable": [], 202 "enum": [], 203 "validation": [], 204 }, 205 root_map={ 206 "validations": {}, 207 "allowed_values": {}, 208 "openapi_types": { 209 "ids": ([str],), 210 "delete_all": (bool,), 211 "namespace": (str,), 212 }, 213 "attribute_map": { 214 "ids": "ids", 215 "delete_all": "deleteAll", 216 "namespace": "namespace", 217 }, 218 "location_map": { 219 "ids": "query", 220 "delete_all": "query", 221 "namespace": "query", 222 }, 223 "collection_format_map": { 224 "ids": "multi", 225 }, 226 }, 227 headers_map={ 228 "accept": ["application/json"], 229 "content_type": [], 230 }, 231 api_client=api_client, 232 callable=__delete1, 233 ) 234 235 def __describe_index_stats(self, describe_index_stats_request, **kwargs): 236 """DescribeIndexStats # noqa: E501 237 238 The `DescribeIndexStats` operation returns statistics about the index's contents, including the vector count per namespace, the number of dimensions, and the index fullness. The index fullness result may be inaccurate during pod resizing; to get the status of a pod resizing process, use [`describe_index`](https://www.pinecone.io/docs/api/operation/describe_index/). # noqa: E501 239 This method makes a synchronous HTTP request by default. To make an 240 asynchronous HTTP request, pass async_req=True 241 242 >>> thread = api.describe_index_stats(describe_index_stats_request, async_req=True) 243 >>> result = thread.get() 244 245 Args: 246 describe_index_stats_request (DescribeIndexStatsRequest): 247 248 Keyword Args: 249 _return_http_data_only (bool): Return head status 250 code or headers. Default is True. 251 _preload_content (bool): If False, the urllib3.HTTPResponse object 252 is returned without reading or decoding response data. 253 Default is True. 254 _request_timeout (int/float/tuple): The timeout setting for this request. If 255 one number is provided, it is the total request timeout. It can also 256 be a pair (tuple) of (connection, read) timeouts. 257 Default is None. 258 _check_input_type (bool): Specifies if type checking 259 should be done on the data sent to the server. 260 Default is True. 261 _check_return_type (bool): Specifies if type checking 262 should be done on the data received from the server. 263 Default is True. 264 _host_index (int/None): Specifies the index of the server 265 that we want to use. 266 Default is to read from the configuration. 267 async_req (bool): execute request asynchronously 268 269 Returns: 270 DescribeIndexStatsResponse 271 If the method is called asynchronously, returns the request 272 thread. 273 """ 274 kwargs["async_req"] = kwargs.get("async_req", False) 275 kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) 276 kwargs["_preload_content"] = kwargs.get("_preload_content", True) 277 kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) 278 kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) 279 kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) 280 kwargs["_host_index"] = kwargs.get("_host_index") 281 kwargs["describe_index_stats_request"] = describe_index_stats_request 282 return self.call_with_http_info(**kwargs) 283 284 self.describe_index_stats = _Endpoint( 285 settings={ 286 "response_type": (DescribeIndexStatsResponse,), 287 "auth": ["ApiKeyAuth"], 288 "endpoint_path": "/describe_index_stats", 289 "operation_id": "describe_index_stats", 290 "http_method": "POST", 291 "servers": None, 292 }, 293 params_map={ 294 "all": [ 295 "describe_index_stats_request", 296 ], 297 "required": [ 298 "describe_index_stats_request", 299 ], 300 "nullable": [], 301 "enum": [], 302 "validation": [], 303 }, 304 root_map={ 305 "validations": {}, 306 "allowed_values": {}, 307 "openapi_types": { 308 "describe_index_stats_request": (DescribeIndexStatsRequest,), 309 }, 310 "attribute_map": {}, 311 "location_map": { 312 "describe_index_stats_request": "body", 313 }, 314 "collection_format_map": {}, 315 }, 316 headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, 317 api_client=api_client, 318 callable=__describe_index_stats, 319 ) 320 321 def __describe_index_stats1(self, **kwargs): 322 """DescribeIndexStats # noqa: E501 323 324 The `DescribeIndexStats` operation returns statistics about the index's contents, including the vector count per namespace, the number of dimensions, and the index fullness. The index fullness result may be inaccurate during pod resizing; to get the status of a pod resizing process, use [`describe_index`](https://www.pinecone.io/docs/api/operation/describe_index/). # noqa: E501 325 This method makes a synchronous HTTP request by default. To make an 326 asynchronous HTTP request, pass async_req=True 327 328 >>> thread = api.describe_index_stats1(async_req=True) 329 >>> result = thread.get() 330 331 332 Keyword Args: 333 _return_http_data_only (bool): Response data without head status 334 code and headers. Default is True. 335 _preload_content (bool): if False, the urllib3.HTTPResponse object 336 is returned without reading or decoding response data. 337 Default is True. 338 _request_timeout (int/float/tuple): The timeout setting for this request. If 339 one number is provided, it is the total request timeout. It can also 340 be a pair (tuple) of (connection, read) timeouts. 341 Default is None. 342 _check_input_type (bool): Specifies if type checking 343 should be done on the data sent to the server. 344 Default is True. 345 _check_return_type (bool): Specifies if type checking 346 should be done on the data received from the server. 347 Default is True. 348 _host_index (int/None): Specifies the index of the server 349 that we want to use. 350 Default is to read from the configuration. 351 async_req (bool): execute request asynchronously 352 353 Returns: 354 DescribeIndexStatsResponse 355 If the method is called asynchronously, returns the request 356 thread. 357 """ 358 kwargs["async_req"] = kwargs.get("async_req", False) 359 kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) 360 kwargs["_preload_content"] = kwargs.get("_preload_content", True) 361 kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) 362 kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) 363 kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) 364 kwargs["_host_index"] = kwargs.get("_host_index") 365 return self.call_with_http_info(**kwargs) 366 367 self.describe_index_stats1 = _Endpoint( 368 settings={ 369 "response_type": (DescribeIndexStatsResponse,), 370 "auth": ["ApiKeyAuth"], 371 "endpoint_path": "/describe_index_stats", 372 "operation_id": "describe_index_stats1", 373 "http_method": "GET", 374 "servers": None, 375 }, 376 params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []}, 377 root_map={ 378 "validations": {}, 379 "allowed_values": {}, 380 "openapi_types": {}, 381 "attribute_map": {}, 382 "location_map": {}, 383 "collection_format_map": {}, 384 }, 385 headers_map={ 386 "accept": ["application/json"], 387 "content_type": [], 388 }, 389 api_client=api_client, 390 callable=__describe_index_stats1, 391 ) 392 393 def __fetch(self, ids, **kwargs): 394 """Fetch # noqa: E501 395 396 The `Fetch` operation looks up and returns vectors by ID from a single namespace. The returned vectors include the vector data and metadata. # noqa: E501 397 This method makes a synchronous HTTP request by default. To make an 398 asynchronous HTTP request, pass async_req=True 399 400 >>> thread = api.fetch(ids, async_req=True) 401 >>> result = thread.get() 402 403 Args: 404 ids ([str]): The vector IDs to fetch. Does not accept values containing spaces. 405 406 Keyword Args: 407 namespace (str): [optional] 408 _return_http_data_only (bool): Response data without head status 409 code and headers. Default is True. 410 _preload_content (bool): if False, the urllib3.HTTPResponse object 411 is returned without reading or decoding response data. 412 Default is True. 413 _request_timeout (int/float/tuple): The timeout setting for this request. If 414 one number is provided, it is the total request timeout. It can also 415 be a pair (tuple) of (connection, read) timeouts. 416 Default is None. 417 _check_input_type (bool): Specifies if type checking 418 should be done on the data sent to the server. 419 Default is True. 420 _check_return_type (bool): Specifies if type checking 421 should be done on the data received from the server. 422 Default is True. 423 _host_index (int/None): Specifies the index of the server 424 that we want to use. 425 Default is to read from the configuration. 426 async_req (bool): execute request asynchronously 427 428 Returns: 429 FetchResponse 430 If the method is called asynchronously, returns the request 431 thread. 432 """ 433 kwargs["async_req"] = kwargs.get("async_req", False) 434 kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) 435 kwargs["_preload_content"] = kwargs.get("_preload_content", True) 436 kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) 437 kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) 438 kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) 439 kwargs["_host_index"] = kwargs.get("_host_index") 440 kwargs["ids"] = ids 441 return self.call_with_http_info(**kwargs) 442 443 self.fetch = _Endpoint( 444 settings={ 445 "response_type": (FetchResponse,), 446 "auth": ["ApiKeyAuth"], 447 "endpoint_path": "/vectors/fetch", 448 "operation_id": "fetch", 449 "http_method": "GET", 450 "servers": None, 451 }, 452 params_map={ 453 "all": [ 454 "ids", 455 "namespace", 456 ], 457 "required": [ 458 "ids", 459 ], 460 "nullable": [], 461 "enum": [], 462 "validation": [], 463 }, 464 root_map={ 465 "validations": {}, 466 "allowed_values": {}, 467 "openapi_types": { 468 "ids": ([str],), 469 "namespace": (str,), 470 }, 471 "attribute_map": { 472 "ids": "ids", 473 "namespace": "namespace", 474 }, 475 "location_map": { 476 "ids": "query", 477 "namespace": "query", 478 }, 479 "collection_format_map": { 480 "ids": "multi", 481 }, 482 }, 483 headers_map={ 484 "accept": ["application/json"], 485 "content_type": [], 486 }, 487 api_client=api_client, 488 callable=__fetch, 489 ) 490 491 def __query(self, query_request, **kwargs): 492 """Query # noqa: E501 493 494 The `Query` operation searches a namespace using a query vector. It retrieves the IDs of the most similar records in a namespace along with their similarity scores. # noqa: E501 495 This method makes a synchronous HTTP request by default. To make an 496 asynchronous HTTP request, pass async_req=True 497 498 >>> thread = api.query(query_request, async_req=True) 499 >>> result = thread.get() 500 501 Args: 502 query_request (QueryRequest): 503 504 Keyword Args: 505 _return_http_data_only (bool): Return response data without head status 506 code and headers. Default is True. 507 _preload_content (bool): If False, the urllib3.HTTPResponse object 508 is returned without reading or decoding response data. 509 Default is True. 510 _request_timeout (int/float/tuple): The timeout setting for this request. If 511 one number is provided, it is the total request timeout. It can also 512 be a pair (tuple) of (connection, read) timeouts. 513 Default is None. 514 _check_input_type (bool): Specifies if type checking 515 should be done on the data sent to the server. 516 Default is True. 517 _check_return_type (bool): Specifies if type checking 518 should be done on the data received from the server. 519 Default is True. 520 _host_index (int/None): Specifies the index of the server 521 that we want to use. 522 Default is to read from the configuration. 523 async_req (bool): execute request asynchronously 524 525 Returns: 526 QueryResponse 527 If the method is called asynchronously, returns the request 528 thread. 529 """ 530 kwargs["async_req"] = kwargs.get("async_req", False) 531 kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) 532 kwargs["_preload_content"] = kwargs.get("_preload_content", True) 533 kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) 534 kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) 535 kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) 536 kwargs["_host_index"] = kwargs.get("_host_index") 537 kwargs["query_request"] = query_request 538 return self.call_with_http_info(**kwargs) 539 540 self.query = _Endpoint( 541 settings={ 542 "response_type": (QueryResponse,), 543 "auth": ["ApiKeyAuth"], 544 "endpoint_path": "/query", 545 "operation_id": "query", 546 "http_method": "POST", 547 "servers": None, 548 }, 549 params_map={ 550 "all": [ 551 "query_request", 552 ], 553 "required": [ 554 "query_request", 555 ], 556 "nullable": [], 557 "enum": [], 558 "validation": [], 559 }, 560 root_map={ 561 "validations": {}, 562 "allowed_values": {}, 563 "openapi_types": { 564 "query_request": (QueryRequest,), 565 }, 566 "attribute_map": {}, 567 "location_map": { 568 "query_request": "body", 569 }, 570 "collection_format_map": {}, 571 }, 572 headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, 573 api_client=api_client, 574 callable=__query, 575 ) 576 577 def __update(self, update_request, **kwargs): 578 """Update # noqa: E501 579 580 The `Update` operation updates a vector in a namespace. If a value is included, it overwrites the previous value. If set_metadata is included, the values of the fields specified in it are added to or overwrite the previous values. # noqa: E501 581 This method makes a synchronous HTTP request by default. To make an 582 asynchronous HTTP request, pass async_req=True 583 584 >>> thread = api.update(update_request, async_req=True) 585 >>> result = thread.get() 586 587 Args: 588 update_request (UpdateRequest): 589 590 Keyword Args: 591 _return_http_data_only (bool): Response head status 592 code and headers. Default is True. 593 _preload_content (bool): if False, the urllib3.HTTPResponse object 594 is returned without reading or decoding response data. 595 Default is True. 596 _request_timeout (int/float/tuple): The timeout setting for this request. If 597 one number is provided, it is the total request timeout. It can also 598 be a pair (tuple) of (connection, read) timeouts. 599 Default is None. 600 _check_input_type (bool): Specifies if type checking 601 should be done on the data sent to the server. 602 Default is True. 603 _check_return_type (bool): Specifies if type checking 604 should be done on the data received from the server. 605 Default is True. 606 _host_index (int/None): Specifies the index of the server 607 that we want to use. 608 Default is to read from the configuration. 609 async_req (bool): execute request asynchronously 610 611 Returns: 612 {str: (bool, date, datetime, dict, float, int, list, str, none_type)} 613 If the method is called asynchronously, returns the request 614 thread. 615 """ 616 kwargs["async_req"] = kwargs.get("async_req", False) 617 kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) 618 kwargs["_preload_content"] = kwargs.get("_preload_content", True) 619 kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) 620 kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) 621 kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) 622 kwargs["_host_index"] = kwargs.get("_host_index") 623 kwargs["update_request"] = update_request 624 return self.call_with_http_info(**kwargs) 625 626 self.update = _Endpoint( 627 settings={ 628 "response_type": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), 629 "auth": ["ApiKeyAuth"], 630 "endpoint_path": "/vectors/update", 631 "operation_id": "update", 632 "http_method": "POST", 633 "servers": None, 634 }, 635 params_map={ 636 "all": [ 637 "update_request", 638 ], 639 "required": [ 640 "update_request", 641 ], 642 "nullable": [], 643 "enum": [], 644 "validation": [], 645 }, 646 root_map={ 647 "validations": {}, 648 "allowed_values": {}, 649 "openapi_types": { 650 "update_request": (UpdateRequest,), 651 }, 652 "attribute_map": {}, 653 "location_map": { 654 "update_request": "body", 655 }, 656 "collection_format_map": {}, 657 }, 658 headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, 659 api_client=api_client, 660 callable=__update, 661 ) 662 663 def __upsert(self, upsert_request, **kwargs): 664 """Upsert # noqa: E501 665 666 The `Upsert` operation writes vectors into a namespace. If a new value is upserted for an existing vector ID, it overwrites the previous value. # noqa: E501 667 This method makes a synchronous HTTP request by default. To make an 668 asynchronous HTTP request, pass async_req=True 669 670 >>> thread = api.upsert(upsert_request, async_req=True) 671 >>> result = thread.get() 672 673 Args: 674 upsert_request (UpsertRequest): 675 676 Keyword Args: 677 _return_http_data_only (bool): Return response data without head status 678 code and headers. Default is True. 679 _preload_content (bool): if False, the urllib3.HTTPResponse object 680 is returned without reading or decoding response data. 681 Default is True. 682 _request_timeout (int/float/tuple): The timeout setting for this request. If 683 one number is provided, it is the total request timeout. It can also 684 be a pair (tuple) of (connection, read) timeouts. 685 Default is None. 686 _check_input_type (bool): Specifies if type checking 687 should be done on the data sent to the server. 688 Default is True. 689 _check_return_type (bool): Specifies if type checking 690 should be done on the data received from the server. 691 Default is True. 692 _host_index (int/None): Specifies the index of the server 693 that we want to use. 694 Default is to read from the configuration. 695 async_req (bool): execute request asynchronously 696 697 Returns: 698 UpsertResponse 699 If the method is called asynchronously, returns the request 700 thread. 701 """ 702 kwargs["async_req"] = kwargs.get("async_req", False) 703 kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) 704 kwargs["_preload_content"] = kwargs.get("_preload_content", True) 705 kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) 706 kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) 707 kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) 708 kwargs["_host_index"] = kwargs.get("_host_index") 709 kwargs["upsert_request"] = upsert_request 710 return self.call_with_http_info(**kwargs) 711 712 self.upsert = _Endpoint( 713 settings={ 714 "response_type": (UpsertResponse,), 715 "auth": ["ApiKeyAuth"], 716 "endpoint_path": "/vectors/upsert", 717 "operation_id": "upsert", 718 "http_method": "POST", 719 "servers": None, 720 }, 721 params_map={ 722 "all": [ 723 "upsert_request", 724 ], 725 "required": [ 726 "upsert_request", 727 ], 728 "nullable": [], 729 "enum": [], 730 "validation": [], 731 }, 732 root_map={ 733 "validations": {}, 734 "allowed_values": {}, 735 "openapi_types": { 736 "upsert_request": (UpsertRequest,), 737 }, 738 "attribute_map": {}, 739 "location_map": { 740 "upsert_request": "body", 741 }, 742 "collection_format_map": {}, 743 }, 744 headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, 745 api_client=api_client, 746 callable=__upsert, 747 )
NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech
Do not edit the class manually.
VectorOperationsApi(api_client=None)
45 def __init__(self, api_client=None): 46 if api_client is None: 47 api_client = ApiClient() 48 self.api_client = api_client 49 50 def __delete(self, delete_request, **kwargs): 51 """Delete # noqa: E501 52 53 The `Delete` operation deletes records by ID from a single namespace. # noqa: E501 54 This method makes a synchronous HTTP request by default. To make an 55 asynchronous HTTP request, pass async_req=True 56 57 >>> thread = api.delete(delete_request, async_req=True) 58 >>> result = thread.get() 59 60 Args: 61 delete_request (DeleteRequest): 62 63 Keyword Args: 64 _return_http_data_only (bool): Return response data without head status 65 code and headers. Default is True. 66 _preload_content (bool): if False, the urllib3.HTTPResponse object 67 is returned without reading or decoding response data. 68 Default is True. 69 _request_timeout (int/float/tuple): The timeout setting for this request. If 70 one number is provided, it is the total request timeout. It can also 71 be a pair (tuple) of (connection, read) timeouts. 72 Default is None. 73 _check_input_type (bool): Specifies if type checking 74 should be done on the data sent to the server. 75 Default is True. 76 _check_return_type (bool): Specifies if type checking 77 should be done on the data received from the server. 78 Default is True. 79 _host_index (int/None): Specifies the index of the server 80 that we want to use. 81 Default is to read from the configuration. 82 async_req (bool): execute request asynchronously 83 84 Returns: 85 {str: (bool, date, datetime, dict, float, int, list, str, none_type)} 86 If the method is called asynchronously, returns the request 87 thread. 88 """ 89 kwargs["async_req"] = kwargs.get("async_req", False) 90 kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) 91 kwargs["_preload_content"] = kwargs.get("_preload_content", True) 92 kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) 93 kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) 94 kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) 95 kwargs["_host_index"] = kwargs.get("_host_index") 96 kwargs["delete_request"] = delete_request 97 return self.call_with_http_info(**kwargs) 98 99 self.delete = _Endpoint( 100 settings={ 101 "response_type": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), 102 "auth": ["ApiKeyAuth"], 103 "endpoint_path": "/vectors/delete", 104 "operation_id": "delete", 105 "http_method": "POST", 106 "servers": None, 107 }, 108 params_map={ 109 "all": [ 110 "delete_request", 111 ], 112 "required": [ 113 "delete_request", 114 ], 115 "nullable": [], 116 "enum": [], 117 "validation": [], 118 }, 119 root_map={ 120 "validations": {}, 121 "allowed_values": {}, 122 "openapi_types": { 123 "delete_request": (DeleteRequest,), 124 }, 125 "attribute_map": {}, 126 "location_map": { 127 "delete_request": "body", 128 }, 129 "collection_format_map": {}, 130 }, 131 headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, 132 api_client=api_client, 133 callable=__delete, 134 ) 135 136 def __delete1(self, **kwargs): 137 """Delete # noqa: E501 138 139 The `Delete` operation deletes records by ID from a single namespace. # noqa: E501 140 This method makes a synchronous HTTP request by default. To make an 141 asynchronous HTTP request, pass async_req=True 142 143 >>> thread = api.delete1(async_req=True) 144 >>> result = thread.get() 145 146 147 Keyword Args: 148 ids ([str]): Vectors to delete. [optional] 149 delete_all (bool): This indicates that all records in the index namespace should be deleted. [optional] Default is False. 150 namespace (str): The namespace to delete records from, if applicable. [optional] 151 _return_http_data_only (bool): Response data without head status 152 code and headers. Default is True. 153 _preload_content (bool): If False, the urllib3.HTTPResponse object 154 is returned without reading or decoding response data. 155 Default is True. 156 _request_timeout (int/float/tuple): Timeout setting for this request. If 157 one number is provided, this number is the total request timeout. This argument can also 158 be a pair (tuple) of (connection, read) timeouts. 159 Default is None. 160 _check_input_type (bool): Specifies if type checking 161 should be done after the data is sent to the server. 162 Default is True. 163 _check_return_type (bool): Specifies if type checking 164 should be done after the data is received from the server. 165 Default is True. 166 _host_index (int/None): Specifies the index of the server 167 to use. 168 Default is to read from the configuration. 169 async_req (bool): execute request asynchronously 170 171 Returns: 172 {str: (bool, date, datetime, dict, float, int, list, str, none_type)} 173 If the method is called asynchronously, returns the request 174 thread. 175 """ 176 kwargs["async_req"] = kwargs.get("async_req", False) 177 kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) 178 kwargs["_preload_content"] = kwargs.get("_preload_content", True) 179 kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) 180 kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) 181 kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) 182 kwargs["_host_index"] = kwargs.get("_host_index") 183 return self.call_with_http_info(**kwargs) 184 185 self.delete1 = _Endpoint( 186 settings={ 187 "response_type": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), 188 "auth": ["ApiKeyAuth"], 189 "endpoint_path": "/vectors/delete", 190 "operation_id": "delete1", 191 "http_method": "DELETE", 192 "servers": None, 193 }, 194 params_map={ 195 "all": [ 196 "ids", 197 "delete_all", 198 "namespace", 199 ], 200 "required": [], 201 "nullable": [], 202 "enum": [], 203 "validation": [], 204 }, 205 root_map={ 206 "validations": {}, 207 "allowed_values": {}, 208 "openapi_types": { 209 "ids": ([str],), 210 "delete_all": (bool,), 211 "namespace": (str,), 212 }, 213 "attribute_map": { 214 "ids": "ids", 215 "delete_all": "deleteAll", 216 "namespace": "namespace", 217 }, 218 "location_map": { 219 "ids": "query", 220 "delete_all": "query", 221 "namespace": "query", 222 }, 223 "collection_format_map": { 224 "ids": "multi", 225 }, 226 }, 227 headers_map={ 228 "accept": ["application/json"], 229 "content_type": [], 230 }, 231 api_client=api_client, 232 callable=__delete1, 233 ) 234 235 def __describe_index_stats(self, describe_index_stats_request, **kwargs): 236 """DescribeIndexStats # noqa: E501 237 238 The `DescribeIndexStats` operation returns statistics about the index's contents, including the vector count per namespace, the number of dimensions, and the index fullness. The index fullness result may be inaccurate during pod resizing; to get the status of a pod resizing process, use [`describe_index`](https://www.pinecone.io/docs/api/operation/describe_index/). # noqa: E501 239 This method makes a synchronous HTTP request by default. To make an 240 asynchronous HTTP request, pass async_req=True 241 242 >>> thread = api.describe_index_stats(describe_index_stats_request, async_req=True) 243 >>> result = thread.get() 244 245 Args: 246 describe_index_stats_request (DescribeIndexStatsRequest): 247 248 Keyword Args: 249 _return_http_data_only (bool): Return head status 250 code or headers. Default is True. 251 _preload_content (bool): If False, the urllib3.HTTPResponse object 252 is returned without reading or decoding response data. 253 Default is True. 254 _request_timeout (int/float/tuple): The timeout setting for this request. If 255 one number is provided, it is the total request timeout. It can also 256 be a pair (tuple) of (connection, read) timeouts. 257 Default is None. 258 _check_input_type (bool): Specifies if type checking 259 should be done on the data sent to the server. 260 Default is True. 261 _check_return_type (bool): Specifies if type checking 262 should be done on the data received from the server. 263 Default is True. 264 _host_index (int/None): Specifies the index of the server 265 that we want to use. 266 Default is to read from the configuration. 267 async_req (bool): execute request asynchronously 268 269 Returns: 270 DescribeIndexStatsResponse 271 If the method is called asynchronously, returns the request 272 thread. 273 """ 274 kwargs["async_req"] = kwargs.get("async_req", False) 275 kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) 276 kwargs["_preload_content"] = kwargs.get("_preload_content", True) 277 kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) 278 kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) 279 kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) 280 kwargs["_host_index"] = kwargs.get("_host_index") 281 kwargs["describe_index_stats_request"] = describe_index_stats_request 282 return self.call_with_http_info(**kwargs) 283 284 self.describe_index_stats = _Endpoint( 285 settings={ 286 "response_type": (DescribeIndexStatsResponse,), 287 "auth": ["ApiKeyAuth"], 288 "endpoint_path": "/describe_index_stats", 289 "operation_id": "describe_index_stats", 290 "http_method": "POST", 291 "servers": None, 292 }, 293 params_map={ 294 "all": [ 295 "describe_index_stats_request", 296 ], 297 "required": [ 298 "describe_index_stats_request", 299 ], 300 "nullable": [], 301 "enum": [], 302 "validation": [], 303 }, 304 root_map={ 305 "validations": {}, 306 "allowed_values": {}, 307 "openapi_types": { 308 "describe_index_stats_request": (DescribeIndexStatsRequest,), 309 }, 310 "attribute_map": {}, 311 "location_map": { 312 "describe_index_stats_request": "body", 313 }, 314 "collection_format_map": {}, 315 }, 316 headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, 317 api_client=api_client, 318 callable=__describe_index_stats, 319 ) 320 321 def __describe_index_stats1(self, **kwargs): 322 """DescribeIndexStats # noqa: E501 323 324 The `DescribeIndexStats` operation returns statistics about the index's contents, including the vector count per namespace, the number of dimensions, and the index fullness. The index fullness result may be inaccurate during pod resizing; to get the status of a pod resizing process, use [`describe_index`](https://www.pinecone.io/docs/api/operation/describe_index/). # noqa: E501 325 This method makes a synchronous HTTP request by default. To make an 326 asynchronous HTTP request, pass async_req=True 327 328 >>> thread = api.describe_index_stats1(async_req=True) 329 >>> result = thread.get() 330 331 332 Keyword Args: 333 _return_http_data_only (bool): Response data without head status 334 code and headers. Default is True. 335 _preload_content (bool): if False, the urllib3.HTTPResponse object 336 is returned without reading or decoding response data. 337 Default is True. 338 _request_timeout (int/float/tuple): The timeout setting for this request. If 339 one number is provided, it is the total request timeout. It can also 340 be a pair (tuple) of (connection, read) timeouts. 341 Default is None. 342 _check_input_type (bool): Specifies if type checking 343 should be done on the data sent to the server. 344 Default is True. 345 _check_return_type (bool): Specifies if type checking 346 should be done on the data received from the server. 347 Default is True. 348 _host_index (int/None): Specifies the index of the server 349 that we want to use. 350 Default is to read from the configuration. 351 async_req (bool): execute request asynchronously 352 353 Returns: 354 DescribeIndexStatsResponse 355 If the method is called asynchronously, returns the request 356 thread. 357 """ 358 kwargs["async_req"] = kwargs.get("async_req", False) 359 kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) 360 kwargs["_preload_content"] = kwargs.get("_preload_content", True) 361 kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) 362 kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) 363 kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) 364 kwargs["_host_index"] = kwargs.get("_host_index") 365 return self.call_with_http_info(**kwargs) 366 367 self.describe_index_stats1 = _Endpoint( 368 settings={ 369 "response_type": (DescribeIndexStatsResponse,), 370 "auth": ["ApiKeyAuth"], 371 "endpoint_path": "/describe_index_stats", 372 "operation_id": "describe_index_stats1", 373 "http_method": "GET", 374 "servers": None, 375 }, 376 params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []}, 377 root_map={ 378 "validations": {}, 379 "allowed_values": {}, 380 "openapi_types": {}, 381 "attribute_map": {}, 382 "location_map": {}, 383 "collection_format_map": {}, 384 }, 385 headers_map={ 386 "accept": ["application/json"], 387 "content_type": [], 388 }, 389 api_client=api_client, 390 callable=__describe_index_stats1, 391 ) 392 393 def __fetch(self, ids, **kwargs): 394 """Fetch # noqa: E501 395 396 The `Fetch` operation looks up and returns vectors by ID from a single namespace. The returned vectors include the vector data and metadata. # noqa: E501 397 This method makes a synchronous HTTP request by default. To make an 398 asynchronous HTTP request, pass async_req=True 399 400 >>> thread = api.fetch(ids, async_req=True) 401 >>> result = thread.get() 402 403 Args: 404 ids ([str]): The vector IDs to fetch. Does not accept values containing spaces. 405 406 Keyword Args: 407 namespace (str): [optional] 408 _return_http_data_only (bool): Response data without head status 409 code and headers. Default is True. 410 _preload_content (bool): if False, the urllib3.HTTPResponse object 411 is returned without reading or decoding response data. 412 Default is True. 413 _request_timeout (int/float/tuple): The timeout setting for this request. If 414 one number is provided, it is the total request timeout. It can also 415 be a pair (tuple) of (connection, read) timeouts. 416 Default is None. 417 _check_input_type (bool): Specifies if type checking 418 should be done on the data sent to the server. 419 Default is True. 420 _check_return_type (bool): Specifies if type checking 421 should be done on the data received from the server. 422 Default is True. 423 _host_index (int/None): Specifies the index of the server 424 that we want to use. 425 Default is to read from the configuration. 426 async_req (bool): execute request asynchronously 427 428 Returns: 429 FetchResponse 430 If the method is called asynchronously, returns the request 431 thread. 432 """ 433 kwargs["async_req"] = kwargs.get("async_req", False) 434 kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) 435 kwargs["_preload_content"] = kwargs.get("_preload_content", True) 436 kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) 437 kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) 438 kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) 439 kwargs["_host_index"] = kwargs.get("_host_index") 440 kwargs["ids"] = ids 441 return self.call_with_http_info(**kwargs) 442 443 self.fetch = _Endpoint( 444 settings={ 445 "response_type": (FetchResponse,), 446 "auth": ["ApiKeyAuth"], 447 "endpoint_path": "/vectors/fetch", 448 "operation_id": "fetch", 449 "http_method": "GET", 450 "servers": None, 451 }, 452 params_map={ 453 "all": [ 454 "ids", 455 "namespace", 456 ], 457 "required": [ 458 "ids", 459 ], 460 "nullable": [], 461 "enum": [], 462 "validation": [], 463 }, 464 root_map={ 465 "validations": {}, 466 "allowed_values": {}, 467 "openapi_types": { 468 "ids": ([str],), 469 "namespace": (str,), 470 }, 471 "attribute_map": { 472 "ids": "ids", 473 "namespace": "namespace", 474 }, 475 "location_map": { 476 "ids": "query", 477 "namespace": "query", 478 }, 479 "collection_format_map": { 480 "ids": "multi", 481 }, 482 }, 483 headers_map={ 484 "accept": ["application/json"], 485 "content_type": [], 486 }, 487 api_client=api_client, 488 callable=__fetch, 489 ) 490 491 def __query(self, query_request, **kwargs): 492 """Query # noqa: E501 493 494 The `Query` operation searches a namespace using a query vector. It retrieves the IDs of the most similar records in a namespace along with their similarity scores. # noqa: E501 495 This method makes a synchronous HTTP request by default. To make an 496 asynchronous HTTP request, pass async_req=True 497 498 >>> thread = api.query(query_request, async_req=True) 499 >>> result = thread.get() 500 501 Args: 502 query_request (QueryRequest): 503 504 Keyword Args: 505 _return_http_data_only (bool): Return response data without head status 506 code and headers. Default is True. 507 _preload_content (bool): If False, the urllib3.HTTPResponse object 508 is returned without reading or decoding response data. 509 Default is True. 510 _request_timeout (int/float/tuple): The timeout setting for this request. If 511 one number is provided, it is the total request timeout. It can also 512 be a pair (tuple) of (connection, read) timeouts. 513 Default is None. 514 _check_input_type (bool): Specifies if type checking 515 should be done on the data sent to the server. 516 Default is True. 517 _check_return_type (bool): Specifies if type checking 518 should be done on the data received from the server. 519 Default is True. 520 _host_index (int/None): Specifies the index of the server 521 that we want to use. 522 Default is to read from the configuration. 523 async_req (bool): execute request asynchronously 524 525 Returns: 526 QueryResponse 527 If the method is called asynchronously, returns the request 528 thread. 529 """ 530 kwargs["async_req"] = kwargs.get("async_req", False) 531 kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) 532 kwargs["_preload_content"] = kwargs.get("_preload_content", True) 533 kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) 534 kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) 535 kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) 536 kwargs["_host_index"] = kwargs.get("_host_index") 537 kwargs["query_request"] = query_request 538 return self.call_with_http_info(**kwargs) 539 540 self.query = _Endpoint( 541 settings={ 542 "response_type": (QueryResponse,), 543 "auth": ["ApiKeyAuth"], 544 "endpoint_path": "/query", 545 "operation_id": "query", 546 "http_method": "POST", 547 "servers": None, 548 }, 549 params_map={ 550 "all": [ 551 "query_request", 552 ], 553 "required": [ 554 "query_request", 555 ], 556 "nullable": [], 557 "enum": [], 558 "validation": [], 559 }, 560 root_map={ 561 "validations": {}, 562 "allowed_values": {}, 563 "openapi_types": { 564 "query_request": (QueryRequest,), 565 }, 566 "attribute_map": {}, 567 "location_map": { 568 "query_request": "body", 569 }, 570 "collection_format_map": {}, 571 }, 572 headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, 573 api_client=api_client, 574 callable=__query, 575 ) 576 577 def __update(self, update_request, **kwargs): 578 """Update # noqa: E501 579 580 The `Update` operation updates a vector in a namespace. If a value is included, it overwrites the previous value. If set_metadata is included, the values of the fields specified in it are added to or overwrite the previous values. # noqa: E501 581 This method makes a synchronous HTTP request by default. To make an 582 asynchronous HTTP request, pass async_req=True 583 584 >>> thread = api.update(update_request, async_req=True) 585 >>> result = thread.get() 586 587 Args: 588 update_request (UpdateRequest): 589 590 Keyword Args: 591 _return_http_data_only (bool): Response head status 592 code and headers. Default is True. 593 _preload_content (bool): if False, the urllib3.HTTPResponse object 594 is returned without reading or decoding response data. 595 Default is True. 596 _request_timeout (int/float/tuple): The timeout setting for this request. If 597 one number is provided, it is the total request timeout. It can also 598 be a pair (tuple) of (connection, read) timeouts. 599 Default is None. 600 _check_input_type (bool): Specifies if type checking 601 should be done on the data sent to the server. 602 Default is True. 603 _check_return_type (bool): Specifies if type checking 604 should be done on the data received from the server. 605 Default is True. 606 _host_index (int/None): Specifies the index of the server 607 that we want to use. 608 Default is to read from the configuration. 609 async_req (bool): execute request asynchronously 610 611 Returns: 612 {str: (bool, date, datetime, dict, float, int, list, str, none_type)} 613 If the method is called asynchronously, returns the request 614 thread. 615 """ 616 kwargs["async_req"] = kwargs.get("async_req", False) 617 kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) 618 kwargs["_preload_content"] = kwargs.get("_preload_content", True) 619 kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) 620 kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) 621 kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) 622 kwargs["_host_index"] = kwargs.get("_host_index") 623 kwargs["update_request"] = update_request 624 return self.call_with_http_info(**kwargs) 625 626 self.update = _Endpoint( 627 settings={ 628 "response_type": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), 629 "auth": ["ApiKeyAuth"], 630 "endpoint_path": "/vectors/update", 631 "operation_id": "update", 632 "http_method": "POST", 633 "servers": None, 634 }, 635 params_map={ 636 "all": [ 637 "update_request", 638 ], 639 "required": [ 640 "update_request", 641 ], 642 "nullable": [], 643 "enum": [], 644 "validation": [], 645 }, 646 root_map={ 647 "validations": {}, 648 "allowed_values": {}, 649 "openapi_types": { 650 "update_request": (UpdateRequest,), 651 }, 652 "attribute_map": {}, 653 "location_map": { 654 "update_request": "body", 655 }, 656 "collection_format_map": {}, 657 }, 658 headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, 659 api_client=api_client, 660 callable=__update, 661 ) 662 663 def __upsert(self, upsert_request, **kwargs): 664 """Upsert # noqa: E501 665 666 The `Upsert` operation writes vectors into a namespace. If a new value is upserted for an existing vector ID, it overwrites the previous value. # noqa: E501 667 This method makes a synchronous HTTP request by default. To make an 668 asynchronous HTTP request, pass async_req=True 669 670 >>> thread = api.upsert(upsert_request, async_req=True) 671 >>> result = thread.get() 672 673 Args: 674 upsert_request (UpsertRequest): 675 676 Keyword Args: 677 _return_http_data_only (bool): Return response data without head status 678 code and headers. Default is True. 679 _preload_content (bool): if False, the urllib3.HTTPResponse object 680 is returned without reading or decoding response data. 681 Default is True. 682 _request_timeout (int/float/tuple): The timeout setting for this request. If 683 one number is provided, it is the total request timeout. It can also 684 be a pair (tuple) of (connection, read) timeouts. 685 Default is None. 686 _check_input_type (bool): Specifies if type checking 687 should be done on the data sent to the server. 688 Default is True. 689 _check_return_type (bool): Specifies if type checking 690 should be done on the data received from the server. 691 Default is True. 692 _host_index (int/None): Specifies the index of the server 693 that we want to use. 694 Default is to read from the configuration. 695 async_req (bool): execute request asynchronously 696 697 Returns: 698 UpsertResponse 699 If the method is called asynchronously, returns the request 700 thread. 701 """ 702 kwargs["async_req"] = kwargs.get("async_req", False) 703 kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) 704 kwargs["_preload_content"] = kwargs.get("_preload_content", True) 705 kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) 706 kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) 707 kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) 708 kwargs["_host_index"] = kwargs.get("_host_index") 709 kwargs["upsert_request"] = upsert_request 710 return self.call_with_http_info(**kwargs) 711 712 self.upsert = _Endpoint( 713 settings={ 714 "response_type": (UpsertResponse,), 715 "auth": ["ApiKeyAuth"], 716 "endpoint_path": "/vectors/upsert", 717 "operation_id": "upsert", 718 "http_method": "POST", 719 "servers": None, 720 }, 721 params_map={ 722 "all": [ 723 "upsert_request", 724 ], 725 "required": [ 726 "upsert_request", 727 ], 728 "nullable": [], 729 "enum": [], 730 "validation": [], 731 }, 732 root_map={ 733 "validations": {}, 734 "allowed_values": {}, 735 "openapi_types": { 736 "upsert_request": (UpsertRequest,), 737 }, 738 "attribute_map": {}, 739 "location_map": { 740 "upsert_request": "body", 741 }, 742 "collection_format_map": {}, 743 }, 744 headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, 745 api_client=api_client, 746 callable=__upsert, 747 )