UNPKG

portkey-ai

Version:
89 lines (88 loc) 4.59 kB
import { Uploadable } from 'openai/uploads'; import { ApiClientInterface } from '../_types/generalTypes'; import { ApiResource } from '../apiResource'; import { RequestOptions } from '../baseClient'; import { FileChunkingStrategyParam } from 'openai/resources/vector-stores/vector-stores'; import { CursorPageParams, Metadata } from '../_types/sharedTypes'; export declare class VectorStores extends ApiResource { files: Files; fileBatches: FileBatches; constructor(client: any); create(_body: VectorStoreCreateParams, params?: ApiClientInterface, opts?: RequestOptions): Promise<any>; retrieve(vectorStoreId: string, params?: ApiClientInterface, opts?: RequestOptions): Promise<any>; update(vectorStoreId: string, _body: VectorStoreUpdateParams, params?: ApiClientInterface, opts?: RequestOptions): Promise<any>; list(_query?: VectorStoreListParams | RequestOptions, params?: ApiClientInterface, opts?: RequestOptions): Promise<any>; del(vectorStoreId: string, params?: ApiClientInterface, opts?: RequestOptions): Promise<any>; } export declare class Files extends ApiResource { create(vectorStoreId: string, _body: FileCreateParams, params?: ApiClientInterface, opts?: RequestOptions): Promise<any>; retrieve(vectorStoreId: string, fileId: string, params?: ApiClientInterface, opts?: RequestOptions): Promise<any>; list(vectorStoreId: string, _query?: FileListParams | RequestOptions, params?: ApiClientInterface, opts?: RequestOptions): Promise<any>; del(vectorStoreId: string, fileId: string, params?: ApiClientInterface, opts?: RequestOptions): Promise<any>; createAndPoll(vectorStoreId: string, _body: FileCreateParams, params?: ApiClientInterface, opts?: RequestOptions): Promise<any>; poll(vectorStoreId: string, fileId: string, params?: ApiClientInterface, opts?: RequestOptions & { pollIntervalMs?: number; }): Promise<any>; upload(vectorStoreId: string, file: Uploadable, params?: ApiClientInterface, opts?: RequestOptions): Promise<any>; uploadAndPoll(vectorStoreId: string, file: Uploadable, params?: ApiClientInterface, opts?: RequestOptions): Promise<any>; } export declare class FileBatches extends ApiResource { create(vectorStoreId: string, _body: FileBatchCreateParams, params?: ApiClientInterface, opts?: RequestOptions): Promise<any>; retrieve(vectorStoreId: string, batchId: string, params?: ApiClientInterface, opts?: RequestOptions): Promise<any>; cancel(vectorStoreId: string, batchId: string, params?: ApiClientInterface, opts?: RequestOptions): Promise<any>; createAndPoll(vectorStoreId: string, _body: FileBatchCreateParams, params?: ApiClientInterface, opts?: RequestOptions): Promise<any>; listFiles(vectorStoreId: string, batchId: string, _query?: FileBatchListFilesParams | RequestOptions, params?: ApiClientInterface, opts?: RequestOptions): Promise<any>; poll(vectorStoreId: string, batchId: string, params?: ApiClientInterface, opts?: RequestOptions & { pollIntervalMs?: number; }): Promise<any>; uploadAndPoll(vectorStoreId: string, { files, fileIds }: { files: Uploadable[]; fileIds?: string[]; }, params?: ApiClientInterface, opts?: RequestOptions & { pollIntervalMs?: number; maxConcurrency?: number; }): Promise<any>; } export interface ExpiresAfter { anchor: 'last_active_at'; days: number; } export interface VectorStoreCreateParams { chunking_strategy?: FileChunkingStrategyParam; expires_after?: ExpiresAfter; file_ids?: Array<string>; metadata?: Metadata | null; name?: string; [key: string]: any; } export interface VectorStoreUpdateParams { expires_after?: ExpiresAfter | null; metadata?: Metadata | null; name?: string | null; [key: string]: any; } export interface VectorStoreListParams extends CursorPageParams { before?: string; order?: 'asc' | 'desc'; } export interface FileCreateParams { file_id: string; chunking_strategy?: FileChunkingStrategyParam; [key: string]: any; } export interface FileListParams extends CursorPageParams { before?: string; filter?: 'in_progress' | 'completed' | 'failed' | 'cancelled'; order?: 'asc' | 'desc'; [key: string]: any; } export interface FileBatchCreateParams { file_ids: Array<string>; chunking_strategy?: FileChunkingStrategyParam; [key: string]: any; } export interface FileBatchListFilesParams extends CursorPageParams { before?: string; filter?: 'in_progress' | 'completed' | 'failed' | 'cancelled'; order?: 'asc' | 'desc'; }