amazon_opensearch_vector_store_driver
AmazonOpenSearchVectorStoreDriver
Bases: OpenSearchVectorStoreDriver
A Vector Store Driver for Amazon OpenSearch.
Attributes:
Name | Type | Description |
---|---|---|
session |
Session
|
The boto3 session to use. |
service |
str
|
Service name for AWS Signature v4. Values can be 'es' or 'aoss' for for OpenSearch Serverless. Defaults to 'es'. |
http_auth |
str | tuple[str, str]
|
The HTTP authentication credentials to use. Defaults to using credentials in the boto3 session. |
client |
str | tuple[str, str]
|
An optional OpenSearch client to use. Defaults to a new client using the host, port, http_auth, use_ssl, and verify_certs attributes. |
Source code in griptape/drivers/vector/amazon_opensearch_vector_store_driver.py
http_auth: str | tuple[str, str] = field(default=Factory(lambda self: import_optional_dependency('opensearchpy').AWSV4SignerAuth(self.session.get_credentials(), self.session.region_name, self.service), takes_self=True))
class-attribute
instance-attribute
service: str = field(default='es', kw_only=True)
class-attribute
instance-attribute
session: Session = field(default=Factory(lambda: import_optional_dependency('boto3').Session()), kw_only=True)
class-attribute
instance-attribute
upsert_vector(vector, *, vector_id=None, namespace=None, meta=None, **kwargs)
Inserts or updates a vector in OpenSearch.
If a vector with the given vector ID already exists, it is updated; otherwise, a new vector is inserted. Metadata associated with the vector can also be provided.