/* tslint:disable */ /* eslint-disable */ /** * KubeBlocks Cloud Internal API * The Internal API is using for interaction of ApeCloud platform microservices. * * 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 } from '../common'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import type { APIErrorResponse } from '../models'; // @ts-ignore import type { Llm } from '../models'; // @ts-ignore import type { LlmList } from '../models'; /** * LlmApi - axios parameter creator * @export */ export const LlmApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Returns the LLM config with plaintext api_key for internal service-to-service callers. * @summary Get LLM by ID with plaintext api_key * @param {string} id ID of the LLM * @param {*} [options] Override http request option. * @throws {RequiredError} */ getLLMWithAPIKey: async (id: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('getLLMWithAPIKey', 'id', id) const localVarPath = `/internal/v1/llm/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // 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 BasicAuth required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Returns LLM configs with plaintext api_key for internal service-to-service callers. * @summary List LLM with plaintext api_key * @param {*} [options] Override http request option. * @throws {RequiredError} */ listLLMWithAPIKey: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/internal/v1/llm`; // 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 BasicAuth required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * LlmApi - functional programming interface * @export */ export const LlmApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = LlmApiAxiosParamCreator(configuration) return { /** * Returns the LLM config with plaintext api_key for internal service-to-service callers. * @summary Get LLM by ID with plaintext api_key * @param {string} id ID of the LLM * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getLLMWithAPIKey(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getLLMWithAPIKey(id, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['LlmApi.getLLMWithAPIKey']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Returns LLM configs with plaintext api_key for internal service-to-service callers. * @summary List LLM with plaintext api_key * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listLLMWithAPIKey(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.listLLMWithAPIKey(options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['LlmApi.listLLMWithAPIKey']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; /** * LlmApi - factory interface * @export */ export const LlmApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = LlmApiFp(configuration) return { /** * Returns the LLM config with plaintext api_key for internal service-to-service callers. * @summary Get LLM by ID with plaintext api_key * @param {LlmApiGetLLMWithAPIKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getLLMWithAPIKey(requestParameters: LlmApiGetLLMWithAPIKeyRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getLLMWithAPIKey(requestParameters.id, options).then((request) => request(axios, basePath)); }, /** * Returns LLM configs with plaintext api_key for internal service-to-service callers. * @summary List LLM with plaintext api_key * @param {*} [options] Override http request option. * @throws {RequiredError} */ listLLMWithAPIKey(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.listLLMWithAPIKey(options).then((request) => request(axios, basePath)); }, }; }; /** * LlmApi - interface * @export * @interface LlmApi */ export interface LlmApiInterface { /** * Returns the LLM config with plaintext api_key for internal service-to-service callers. * @summary Get LLM by ID with plaintext api_key * @param {LlmApiGetLLMWithAPIKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof LlmApiInterface */ getLLMWithAPIKey(requestParameters: LlmApiGetLLMWithAPIKeyRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * Returns LLM configs with plaintext api_key for internal service-to-service callers. * @summary List LLM with plaintext api_key * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof LlmApiInterface */ listLLMWithAPIKey(options?: RawAxiosRequestConfig): AxiosPromise; } /** * Request parameters for getLLMWithAPIKey operation in LlmApi. * @export * @interface LlmApiGetLLMWithAPIKeyRequest */ export interface LlmApiGetLLMWithAPIKeyRequest { /** * ID of the LLM * @type {string} * @memberof LlmApiGetLLMWithAPIKey */ readonly id: string } /** * LlmApi - object-oriented interface * @export * @class LlmApi * @extends {BaseAPI} */ export class LlmApi extends BaseAPI implements LlmApiInterface { /** * Returns the LLM config with plaintext api_key for internal service-to-service callers. * @summary Get LLM by ID with plaintext api_key * @param {LlmApiGetLLMWithAPIKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof LlmApi */ public getLLMWithAPIKey(requestParameters: LlmApiGetLLMWithAPIKeyRequest, options?: RawAxiosRequestConfig) { return LlmApiFp(this.configuration).getLLMWithAPIKey(requestParameters.id, options).then((request) => request(this.axios, this.basePath)); } /** * Returns LLM configs with plaintext api_key for internal service-to-service callers. * @summary List LLM with plaintext api_key * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof LlmApi */ public listLLMWithAPIKey(options?: RawAxiosRequestConfig) { return LlmApiFp(this.configuration).listLLMWithAPIKey(options).then((request) => request(this.axios, this.basePath)); } }