@upstash/search
Version:
An HTTP/REST based AI Search client built on top of Upstash REST API.
50 lines (47 loc) • 1.29 kB
text/typescript
import { R as RequesterConfig, S as Search$1 } from './search-vvSJOhvD.mjs';
import '@upstash/vector';
/**
* Connection credentials for upstash vector.
* Get them from https://console.upstash.com/vector/<uuid>
*/
type ClientConfig = {
/**
* UPSTASH_SEARCH_REST_URL
*/
url?: string;
/**
* UPSTASH_SEARCH_REST_TOKEN
*/
token?: string;
/**
* Enable telemetry to help us improve the SDK.
* The sdk will send the sdk version, platform and node version as telemetry headers.
*
* @default true
*/
enableTelemetry?: boolean;
} & RequesterConfig;
/**
* Provides search capabilities over indexes.
*/
declare class Search extends Search$1 {
/**
* Creates a new Search instance.
*
* @param vectorIndex - The underlying index used for search operations.
*/
constructor(params: ClientConfig);
/**
* Creates a new Search instance using env variables
* `UPSTASH_SEARCH_REST_URL` and
* `UPSTASH_SEARCH_REST_TOKEN`
*
* @param env
* @returns
*/
static fromEnv: (env?: {
UPSTASH_SEARCH_REST_URL: string;
UPSTASH_SEARCH_REST_TOKEN: string;
}, config?: Omit<ClientConfig, "url" | "token">) => Search;
}
export { type ClientConfig, Search };