Class: AzureCosmosDBNoSqlVectorStore
Extends
Constructors
new AzureCosmosDBNoSqlVectorStore()
new AzureCosmosDBNoSqlVectorStore(
dbConfig
):AzureCosmosDBNoSqlVectorStore
Parameters
• dbConfig: AzureCosmosDBNoSQLConfig
& VectorStoreBaseParams
Returns
Overrides
Defined in
packages/llamaindex/src/vector-store/AzureCosmosDBNoSqlVectorStore.ts:145
Properties
cosmosClient
cosmosClient:
CosmosClient
The CosmosDB client. This is either passed in or created.
Defined in
packages/llamaindex/src/vector-store/AzureCosmosDBNoSqlVectorStore.ts:112
embeddingKey
embeddingKey:
string
The key to use for the vector embedding field in the CosmosDB container. Default: "embedding"
Defined in
packages/llamaindex/src/vector-store/AzureCosmosDBNoSqlVectorStore.ts:137
embedModel
embedModel:
BaseEmbedding
Inherited from
Defined in
packages/llamaindex/src/vector-store/types.ts:89
flatMetadata
flatMetadata:
boolean
=true
Defined in
packages/llamaindex/src/vector-store/AzureCosmosDBNoSqlVectorStore.ts:119
idKey
idKey:
string
The key to use for the id field in the CosmosDB container. Default: "id"
Defined in
packages/llamaindex/src/vector-store/AzureCosmosDBNoSqlVectorStore.ts:125
isEmbeddingQuery?
optional
isEmbeddingQuery:boolean
Inherited from
BaseVectorStore
.isEmbeddingQuery
Defined in
packages/llamaindex/src/vector-store/types.ts:91
metadataKey
metadataKey:
string
The key to use for the metadata field in the CosmosDB container. Default: "metadata"
Defined in
packages/llamaindex/src/vector-store/AzureCosmosDBNoSqlVectorStore.ts:131
storesText
storesText:
boolean
=true
Overrides
Defined in
packages/llamaindex/src/vector-store/AzureCosmosDBNoSqlVectorStore.ts:103
textKey
textKey:
string
The key to use for the text field in the CosmosDB container. Default: "text"
Defined in
packages/llamaindex/src/vector-store/AzureCosmosDBNoSqlVectorStore.ts:117
Methods
add()
add(
nodes
):Promise
<string
[]>
Adds document to the CosmosDB container.
Parameters
Returns
Promise
<string
[]>
an array of document ids which were added
Overrides
Defined in
packages/llamaindex/src/vector-store/AzureCosmosDBNoSqlVectorStore.ts:281
client()
client():
unknown
Returns
unknown
Overrides
Defined in
packages/llamaindex/src/vector-store/AzureCosmosDBNoSqlVectorStore.ts:141
delete()
delete(
refDocId
,deleteOptions
?):Promise
<void
>
Delete a document from the CosmosDB container.
Parameters
• refDocId: string
The id of the document to delete
• deleteOptions?: object
Any options to pass to the container.item.delete function
Returns
Promise
<void
>
Promise that resolves if the delete query did not throw an error.
Overrides
Defined in
packages/llamaindex/src/vector-store/AzureCosmosDBNoSqlVectorStore.ts:324
query()
query(
query
,options
?):Promise
<VectorStoreQueryResult
>
Performs a vector similarity search query in the CosmosDB container.
Parameters
• query: VectorStoreQuery
VectorStoreQuery
• options?: object
Returns
Promise
<VectorStoreQueryResult
>
List of nodes along with similarityScore
Overrides
Defined in
packages/llamaindex/src/vector-store/AzureCosmosDBNoSqlVectorStore.ts:335
fromAccountAndKey()
static
fromAccountAndKey(config
):AzureCosmosDBNoSqlVectorStore
Static method for creating an instance using a account endpoint and key.
If no endpoint and key is provided, it will attempt to use the env variable AZURE_COSMOSDB_NOSQL_ACCOUNT_ENDPOINT
as enpoint and AZURE_COSMOSDB_NOSQL_ACCOUNT_KEY
as key.
Parameters
• config: object
& AzureCosmosDBNoSQLConfig
& VectorStoreBaseParams
= {}
Returns
Instance of AzureCosmosDBNoSqlVectorStore
Defined in
packages/llamaindex/src/vector-store/AzureCosmosDBNoSqlVectorStore.ts:227
fromConnectionString()
static
fromConnectionString(config
):AzureCosmosDBNoSqlVectorStore
Static method for creating an instance using a connection string.
If no connection string is provided, it will attempt to use the env variable AZURE_COSMOSDB_NOSQL_CONNECTION_STRING
as connection string.
Parameters
• config: object
& AzureCosmosDBNoSQLConfig
& VectorStoreBaseParams
= {}
Returns
Instance of AzureCosmosDBNoSqlVectorStore
Defined in
packages/llamaindex/src/vector-store/AzureCosmosDBNoSqlVectorStore.ts:203
fromUriAndManagedIdentity()
static
fromUriAndManagedIdentity(config
):AzureCosmosDBNoSqlVectorStore
Static method for creating an instance using account endpoint and managed identity.
If no endpoint and credentials are provided, it will attempt to use the env variable AZURE_COSMOSDB_NOSQL_ACCOUNT_ENDPOINT
as endpoint and use DefaultAzureCredential() as credentials.
Parameters
• config: object
& AzureCosmosDBNoSQLConfig
& VectorStoreBaseParams
= {}
Returns
Instance of AzureCosmosDBNoSqlVectorStore
Defined in
packages/llamaindex/src/vector-store/AzureCosmosDBNoSqlVectorStore.ts:255