airflow.providers.amazon.aws.operators.s3_vectors¶
Amazon S3 Vectors operators.
Classes¶
Create an Amazon S3 Vectors vector bucket. |
|
Delete an Amazon S3 Vectors vector bucket. |
|
Create an index in an Amazon S3 Vectors vector bucket. |
|
Delete an index from an Amazon S3 Vectors vector bucket. |
|
Insert vectors into an Amazon S3 Vectors index. |
|
Query vectors by similarity in an Amazon S3 Vectors index. |
Module Contents¶
- class airflow.providers.amazon.aws.operators.s3_vectors.S3VectorsCreateVectorBucketOperator(*, vector_bucket_name, encryption_configuration=None, tags=None, if_exists='skip', **kwargs)[source]¶
Bases:
airflow.providers.amazon.aws.operators.base_aws.AwsBaseOperator[airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook]Create an Amazon S3 Vectors vector bucket.
See also
For more information on how to use this operator, take a look at the guide: Create a Vector Bucket
- Parameters:
vector_bucket_name (str) – The name of the vector bucket to create (3-63 chars).
encryption_configuration (dict[str, Any] | None) – Optional encryption config dict with keys
sseType(AES256oraws:kms) and optionallykmsKeyArn.tags (dict[str, str] | None) – Optional dict of tags to apply to the vector bucket.
if_exists (Literal['fail', 'skip']) – Behavior when the bucket already exists.
"fail"raises an error,"skip"returns the existing bucket ARN.
- class airflow.providers.amazon.aws.operators.s3_vectors.S3VectorsDeleteVectorBucketOperator(*, vector_bucket_name, **kwargs)[source]¶
Bases:
airflow.providers.amazon.aws.operators.base_aws.AwsBaseOperator[airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook]Delete an Amazon S3 Vectors vector bucket.
See also
For more information on how to use this operator, take a look at the guide: Delete a Vector Bucket
- Parameters:
vector_bucket_name (str) – The name of the vector bucket to delete.
- class airflow.providers.amazon.aws.operators.s3_vectors.S3VectorsCreateIndexOperator(*, vector_bucket_name, index_name, data_type, dimension, distance_metric='cosine', metadata_configuration=None, if_exists='skip', **kwargs)[source]¶
Bases:
airflow.providers.amazon.aws.operators.base_aws.AwsBaseOperator[airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook]Create an index in an Amazon S3 Vectors vector bucket.
An index stores vectors and supports similarity search queries.
See also
For more information on how to use this operator, take a look at the guide: Create an Index
- Parameters:
vector_bucket_name (str) – The name of the vector bucket. (templated)
index_name (str) – The name of the index to create. (templated)
data_type (str) – The data type for vectors (e.g.
float32). (templated)dimension (int) – The number of dimensions for each vector.
distance_metric (str) – The distance metric for similarity search (e.g.
cosine,euclidean).metadata_configuration (dict[str, Any] | None) – Optional metadata configuration dict.
if_exists (Literal['fail', 'skip']) – Behavior when the index already exists.
"fail"raises an error,"skip"returns the existing index ARN.
- class airflow.providers.amazon.aws.operators.s3_vectors.S3VectorsDeleteIndexOperator(*, vector_bucket_name, index_name, **kwargs)[source]¶
Bases:
airflow.providers.amazon.aws.operators.base_aws.AwsBaseOperator[airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook]Delete an index from an Amazon S3 Vectors vector bucket.
See also
For more information on how to use this operator, take a look at the guide: Delete an Index
- Parameters:
- class airflow.providers.amazon.aws.operators.s3_vectors.S3VectorsPutVectorsOperator(*, vector_bucket_name, index_name, vectors, **kwargs)[source]¶
Bases:
airflow.providers.amazon.aws.operators.base_aws.AwsBaseOperator[airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook]Insert vectors into an Amazon S3 Vectors index.
See also
For more information on how to use this operator, take a look at the guide: Put Vectors
- Parameters:
- class airflow.providers.amazon.aws.operators.s3_vectors.S3VectorsQueryVectorsOperator(*, vector_bucket_name, index_name, top_k, query_vector, filter=None, return_metadata=True, return_distance=True, **kwargs)[source]¶
Bases:
airflow.providers.amazon.aws.operators.base_aws.AwsBaseOperator[airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook]Query vectors by similarity in an Amazon S3 Vectors index.
See also
For more information on how to use this operator, take a look at the guide: Query Vectors
- Parameters:
vector_bucket_name (str) – The name of the vector bucket. (templated)
index_name (str) – The name of the index. (templated)
top_k (int) – The number of results to return.
query_vector (dict[str, Any]) – The query vector dict (e.g.
{"float32": [0.1, 0.2, ...]})filter (dict[str, Any] | None) – Optional filter expression dict.
return_metadata (bool) – Whether to return metadata with results.
return_distance (bool) – Whether to return distance scores.