import type { FacetResultData, QueryVectorIndexResponse, RerankerConfig, VectorSearchClient } from "@databricks/sdk-vectorsearch/v1"; import type { EmbeddingProvider, RetrieveOptions, RetrievedChunk, Retriever } from "@fabric-harness/sdk"; import type { DatabricksRawProtocolClient } from "./raw-protocol-client.js"; export type DatabricksVectorSearchClient = Pick & Partial>; export type DatabricksAiSearchInputMode = "text" | "vector" | "text-and-vector"; export type DatabricksAiSearchStrategy = "ann" | "hybrid" | "full-text"; export interface DatabricksAiSearchQueryOptions extends RetrieveOptions { /** Override the configured input mode for this query. */ inputMode?: DatabricksAiSearchInputMode; /** Override the configured retrieval algorithm for this query. */ strategy?: DatabricksAiSearchStrategy; /** Precomputed query vector. Required when no embeddings provider can supply a vector input. */ queryVector?: number[]; /** Minimum score accepted by Databricks AI Search. */ scoreThreshold?: number; /** Text columns searched for the query text. */ queryColumns?: string[]; /** Sort clauses such as `rating DESC`. */ sortColumns?: string[]; /** Facet expressions returned with the result set. */ facets?: string[]; /** Native Databricks reranker configuration. */ reranker?: RerankerConfig; /** Columns supplied to the native reranker. */ columnsToRerank?: string[]; } export interface DatabricksAiSearchQueryResult { chunks: RetrievedChunk[]; nextPageToken?: string; facetResult?: FacetResultData; /** Complete generated-SDK response for callers that need native result metadata. */ response: QueryVectorIndexResponse; } export interface DatabricksAiSearchRetriever extends Retriever { readonly kind: "databricks-ai-search"; readonly index: string; readonly inputMode: DatabricksAiSearchInputMode; readonly strategy: DatabricksAiSearchStrategy; query(query: string, options?: DatabricksAiSearchQueryOptions): Promise; nextPage(pageToken: string, options?: { signal?: AbortSignal; }): Promise; } export interface DatabricksAiSearchOptions { client: DatabricksVectorSearchClient; /** * Private bundle transport used only when SDK 0.21 rejects a valid floating-point score while * decoding a live query response. Other SDK failures remain fail-closed. */ rawProtocolClient?: DatabricksRawProtocolClient; /** Full index name: `catalog.schema.index`. */ index: string; /** Column that holds the chunk text returned to the model. */ textColumn: string; /** Columns to retrieve. Defaults to `[textColumn]` plus `idColumn` when set. */ columns?: string[]; /** Column to surface as `RetrievedChunk.id`. */ idColumn?: string; /** * Query representation. Text indexes default to `text`; self-managed indexes use `vector`; * `text-and-vector` sends both inputs where the selected Databricks strategy supports them. */ inputMode?: DatabricksAiSearchInputMode; /** * Databricks retrieval algorithm. Text input defaults to `hybrid`, while vector-only input * defaults to `ann`. */ strategy?: DatabricksAiSearchStrategy; /** Required for vector input unless each query supplies `queryVector`. */ embeddings?: EmbeddingProvider; scoreThreshold?: number; queryColumns?: string[]; sortColumns?: string[]; facets?: string[]; reranker?: RerankerConfig; columnsToRerank?: string[]; name?: string; } /** Databricks AI Search as a {@link Retriever}. Runs under the bundle's Unity Catalog principal. */ export declare function databricksAiSearch(options: DatabricksAiSearchOptions): DatabricksAiSearchRetriever; //# sourceMappingURL=vector-search.d.ts.map