closevector-common
Version:
30 lines (27 loc) • 932 B
text/typescript
export interface CloseVectorEmbeddingsParams {
timeout?: number;
/**
* The maximum number of documents to embed in a single request. This is
* limited by the OpenAI API to a maximum of 2048.
*/
batchSize?: number;
/**
* Whether to strip new lines from the input text. This is recommended by
* OpenAI, but may not be suitable for all use cases.
*/
stripNewLines?: boolean;
/**
* The maximum number of concurrent calls that can be made.
* Defaults to `Infinity`, which means no limit.
*/
maxConcurrency?: number;
/**
* The maximum number of retries that can be made for a single call,
* with an exponential backoff between each attempt. Defaults to 6.
*/
maxRetries?: number;
}
export interface CloseVectorEmbeddings {
embedDocuments(documents: string[]): Promise<number[][]>;
embedQuery(document: string): Promise<number[]>;
}