/* tslint:disable */ /* eslint-disable */ /** * openfilz-api * API for Document Management System * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import type { Configuration } from '../configuration'; import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction, replaceWithSerializableTypeIfNeeded } from '../common'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import type { EmbeddingBackfillRequest } from '../models'; // @ts-ignore import type { EmbeddingBackfillStatus } from '../models'; /** * AIEmbeddingsApi - axios parameter creator */ export const AIEmbeddingsApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Queues every FILE without a chunk in the vector store (or every FILE when force), optionally under one folder, and returns the job at once. Poll GET /backfill/{jobId}. Run it after wiping the vector store for an embedding-provider switch. * @summary Embed existing documents * @param {EmbeddingBackfillRequest} [embeddingBackfillRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ backfill1: async (embeddingBackfillRequest?: EmbeddingBackfillRequest, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/ai/embeddings/backfill`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication keycloak_auth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(embeddingBackfillRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Progress of an embedding backfill job * @param {string} jobId * @param {*} [options] Override http request option. * @throws {RequiredError} */ backfillStatus1: async (jobId: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'jobId' is not null or undefined assertParamExists('backfillStatus1', 'jobId', jobId) const localVarPath = `/api/v1/ai/embeddings/backfill/{jobId}` .replace('{jobId}', encodeURIComponent(String(jobId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication keycloak_auth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) localVarHeaderParameter['Accept'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * AIEmbeddingsApi - functional programming interface */ export const AIEmbeddingsApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = AIEmbeddingsApiAxiosParamCreator(configuration) return { /** * Queues every FILE without a chunk in the vector store (or every FILE when force), optionally under one folder, and returns the job at once. Poll GET /backfill/{jobId}. Run it after wiping the vector store for an embedding-provider switch. * @summary Embed existing documents * @param {EmbeddingBackfillRequest} [embeddingBackfillRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async backfill1(embeddingBackfillRequest?: EmbeddingBackfillRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.backfill1(embeddingBackfillRequest, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['AIEmbeddingsApi.backfill1']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Progress of an embedding backfill job * @param {string} jobId * @param {*} [options] Override http request option. * @throws {RequiredError} */ async backfillStatus1(jobId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.backfillStatus1(jobId, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['AIEmbeddingsApi.backfillStatus1']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; /** * AIEmbeddingsApi - factory interface */ export const AIEmbeddingsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = AIEmbeddingsApiFp(configuration) return { /** * Queues every FILE without a chunk in the vector store (or every FILE when force), optionally under one folder, and returns the job at once. Poll GET /backfill/{jobId}. Run it after wiping the vector store for an embedding-provider switch. * @summary Embed existing documents * @param {EmbeddingBackfillRequest} [embeddingBackfillRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ backfill1(embeddingBackfillRequest?: EmbeddingBackfillRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.backfill1(embeddingBackfillRequest, options).then((request) => request(axios, basePath)); }, /** * * @summary Progress of an embedding backfill job * @param {string} jobId * @param {*} [options] Override http request option. * @throws {RequiredError} */ backfillStatus1(jobId: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.backfillStatus1(jobId, options).then((request) => request(axios, basePath)); }, }; }; /** * AIEmbeddingsApi - object-oriented interface */ export class AIEmbeddingsApi extends BaseAPI { /** * Queues every FILE without a chunk in the vector store (or every FILE when force), optionally under one folder, and returns the job at once. Poll GET /backfill/{jobId}. Run it after wiping the vector store for an embedding-provider switch. * @summary Embed existing documents * @param {EmbeddingBackfillRequest} [embeddingBackfillRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ public backfill1(embeddingBackfillRequest?: EmbeddingBackfillRequest, options?: RawAxiosRequestConfig) { return AIEmbeddingsApiFp(this.configuration).backfill1(embeddingBackfillRequest, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Progress of an embedding backfill job * @param {string} jobId * @param {*} [options] Override http request option. * @throws {RequiredError} */ public backfillStatus1(jobId: string, options?: RawAxiosRequestConfig) { return AIEmbeddingsApiFp(this.configuration).backfillStatus1(jobId, options).then((request) => request(this.axios, this.basePath)); } }