put_vectors
async
¶
put_vectors(
vectors: PutVectorsInputList,
*,
config_overrides: Optional[AsyncS3VectorsClientConfig] = None,
vector_bucket_name: Optional[VectorBucketName] = None,
index_name: Optional[IndexName] = None,
index_arn: Optional[IndexArn] = None,
) -> PutVectorsOutput
Adds one or more vectors to a vector index. To specify the vector index, you can either use both the vector bucket name and the vector index name, or use the vector index Amazon Resource Name (ARN).
For more information about limits, see Limitations and restrictions in the Amazon S3 User Guide.
When inserting vector data into your vector index, you must provide the vector data as float32 (32-bit floating point) values. If you pass higher-precision values to an Amazon Web Services SDK, S3 Vectors converts the values to 32-bit floating point before storing them, and GetVectors, ListVectors, and QueryVectors operations return the float32 values. Different Amazon Web Services SDKs may have different default numeric types, so ensure your vectors are properly formatted as float32 values regardless of which SDK you're using. For example, in Python, use numpy.float32 or explicitly cast your values.
- Permissions
-
You must have the
s3vectors:PutVectorspermission to use this operation.
Parameters:
-
vector_bucket_name(Optional[VectorBucketName], default:None) –The name of the vector bucket that contains the vector index.
-
index_name(Optional[IndexName], default:None) –The name of the vector index where you want to write vectors.
-
index_arn(Optional[IndexArn], default:None) –The ARN of the vector index where you want to write vectors.
-
vectors(PutVectorsInputList) –The vectors to add to a vector index. The number of vectors in a single request must not exceed the resource capacity, otherwise the request will be rejected with the error
ServiceUnavailableExceptionwith the error message "Currently unable to handle the request".
Raises:
-
AccessDeniedException–Access denied.
-
InternalServerException–The request failed due to an internal server error.
-
RequestTimeoutException–The request timed out. Retry your request.
-
TooManyRequestsException–The request was denied due to request throttling.
-
ValidationException–The requested action isn't valid.
-
KmsDisabledException–The specified Amazon Web Services KMS key isn't enabled.
-
KmsInvalidKeyUsageException–The request was rejected for one of the following reasons:
-
The
KeyUsagevalue of the KMS key is incompatible with the API operation. -
The encryption algorithm or signing algorithm specified for the operation is incompatible with the type of key material in the KMS key (
KeySpec).
For more information, see InvalidKeyUsageException in the Amazon Web Services Key Management Service API Reference.
-
-
KmsInvalidStateException–The key state of the KMS key isn't compatible with the operation.
For more information, see KMSInvalidStateException in the Amazon Web Services Key Management Service API Reference.
-
KmsNotFoundException–The KMS key can't be found.
-
NotFoundException–The request was rejected because the specified resource can't be found.
-
ServiceQuotaExceededException–Your request exceeds a service quota.
-
ServiceUnavailableException–The service is unavailable. Wait briefly and retry your request. If it continues to fail, increase your waiting time between retries.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_s3vectors/_services/async_s3_vectors.py
1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 | |