mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-20 09:20:16 +00:00
Vector search for NoSQL accounts (#1843)
* Add container vector policy and indexing policy support * Add vector search capability * hide vector settings for shared throughput DB * update package-lock * fix pipeline * remove comments * Address comments * Address comments
This commit is contained in:
@@ -16,3 +16,7 @@ export const isServerlessAccount = (): boolean => {
|
||||
isCapabilityEnabled(Constants.CapabilityNames.EnableServerless)
|
||||
);
|
||||
};
|
||||
|
||||
export const isVectorSearchEnabled = (): boolean => {
|
||||
return userContext.apiType === "SQL" && isCapabilityEnabled(Constants.CapabilityNames.EnableNoSQLVectorSearch);
|
||||
};
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import { configContext } from "../../../../ConfigContext";
|
||||
import { armRequest } from "../../request";
|
||||
import * as Types from "./types";
|
||||
const apiVersion = "2024-02-15-preview";
|
||||
const apiVersion = "2024-05-15-preview";
|
||||
|
||||
/* Lists the SQL databases under an existing Azure Cosmos DB database account. */
|
||||
export async function listSqlDatabases(
|
||||
|
||||
@@ -1235,6 +1235,9 @@ export interface SqlDatabaseResource {
|
||||
export interface SqlContainerResource {
|
||||
/* Name of the Cosmos DB SQL container */
|
||||
id: string;
|
||||
|
||||
vectorEmbeddingPolicy?: VectorEmbeddingPolicy;
|
||||
|
||||
/* The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container */
|
||||
indexingPolicy?: IndexingPolicy;
|
||||
|
||||
@@ -1267,6 +1270,17 @@ export interface SqlContainerResource {
|
||||
computedProperties?: ComputedProperty[];
|
||||
}
|
||||
|
||||
export interface VectorEmbeddingPolicy {
|
||||
vectorEmbeddings: VectorEmbedding[];
|
||||
}
|
||||
|
||||
export interface VectorEmbedding {
|
||||
path?: string;
|
||||
dataType?: string;
|
||||
dimensions?: number;
|
||||
distanceFunction?: string;
|
||||
}
|
||||
|
||||
/* Cosmos DB indexing policy */
|
||||
export interface IndexingPolicy {
|
||||
/* Indicates if the indexing policy is automatic */
|
||||
@@ -1285,6 +1299,13 @@ export interface IndexingPolicy {
|
||||
|
||||
/* List of spatial specifics */
|
||||
spatialIndexes?: SpatialSpec[];
|
||||
|
||||
vectorIndexes?: VectorIndex[];
|
||||
}
|
||||
|
||||
export interface VectorIndex {
|
||||
path?: string;
|
||||
type?: string;
|
||||
}
|
||||
|
||||
/* undocumented */
|
||||
|
||||
Reference in New Issue
Block a user