UNIVPLMDataIntegration/Web/src/api-services/aiChat/apis/llmchat-api.ts
2025-09-14 18:13:03 +08:00

552 lines
28 KiB
TypeScript

/* tslint:disable */
/* eslint-disable */
/**
* AiChat
* <br/><u><b><font color='FF0000'> 👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!</font></b></u>
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';
import { Configuration } from '../configuration';
// Some imports not used depending on template conditions
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
import { AdminNETResultBoolean } from '../models';
import { AdminNETResultChatOutput } from '../models';
import { AdminNETResultModelListOutput } from '../models';
import { AdminNETResultSqlSugarPagedListChatListOutput } from '../models';
import { ChatInput } from '../models';
import { ChatListInput } from '../models';
import { ModelListChangeInput } from '../models';
/**
* LLMChatApi - axios parameter creator
* @export
*/
export const LLMChatApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
* 切换模型
* @summary 切换模型
* @param {ModelListChangeInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiLLMChatChangeModelPost: async (body?: ModelListChangeInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/lLMChat/changeModel`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication Bearer required
// http bearer authentication required
if (configuration && configuration.accessToken) {
const accessToken = typeof configuration.accessToken === 'function'
? await configuration.accessToken()
: await configuration.accessToken;
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
}
localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
* 获取聊天列表
* @summary 获取聊天列表
* @param {ChatListInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiLLMChatChatListPost: async (body?: ChatListInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/lLMChat/chatList`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication Bearer required
// http bearer authentication required
if (configuration && configuration.accessToken) {
const accessToken = typeof configuration.accessToken === 'function'
? await configuration.accessToken()
: await configuration.accessToken;
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
}
localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
* 聊天补全
* @summary 聊天补全
* @param {ChatInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiLLMChatChatPost: async (body?: ChatInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/lLMChat/chat`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication Bearer required
// http bearer authentication required
if (configuration && configuration.accessToken) {
const accessToken = typeof configuration.accessToken === 'function'
? await configuration.accessToken()
: await configuration.accessToken;
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
}
localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
* 删除所属摘要的所有聊天记录
* @summary 删除所属摘要的所有聊天记录
* @param {ChatInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiLLMChatDeleteSummaryAllPost: async (body?: ChatInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/lLMChat/deleteSummaryAll`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication Bearer required
// http bearer authentication required
if (configuration && configuration.accessToken) {
const accessToken = typeof configuration.accessToken === 'function'
? await configuration.accessToken()
: await configuration.accessToken;
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
}
localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
* 获取模型列表
* @summary 获取模型列表
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiLLMChatModelListGet: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/lLMChat/modelList`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication Bearer required
// http bearer authentication required
if (configuration && configuration.accessToken) {
const accessToken = typeof configuration.accessToken === 'function'
? await configuration.accessToken()
: await configuration.accessToken;
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
* 重命名所属摘要的标签
* @summary 重命名所属摘要的标签
* @param {ChatInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiLLMChatRenameSummaryLablePost: async (body?: ChatInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/lLMChat/renameSummaryLable`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication Bearer required
// http bearer authentication required
if (configuration && configuration.accessToken) {
const accessToken = typeof configuration.accessToken === 'function'
? await configuration.accessToken()
: await configuration.accessToken;
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
}
localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
}
};
/**
* LLMChatApi - functional programming interface
* @export
*/
export const LLMChatApiFp = function(configuration?: Configuration) {
return {
/**
* 切换模型
* @summary 切换模型
* @param {ModelListChangeInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiLLMChatChangeModelPost(body?: ModelListChangeInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminNETResultBoolean>>> {
const localVarAxiosArgs = await LLMChatApiAxiosParamCreator(configuration).apiLLMChatChangeModelPost(body, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
* 获取聊天列表
* @summary 获取聊天列表
* @param {ChatListInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiLLMChatChatListPost(body?: ChatListInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminNETResultSqlSugarPagedListChatListOutput>>> {
const localVarAxiosArgs = await LLMChatApiAxiosParamCreator(configuration).apiLLMChatChatListPost(body, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
* 聊天补全
* @summary 聊天补全
* @param {ChatInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiLLMChatChatPost(body?: ChatInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminNETResultChatOutput>>> {
const localVarAxiosArgs = await LLMChatApiAxiosParamCreator(configuration).apiLLMChatChatPost(body, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
* 删除所属摘要的所有聊天记录
* @summary 删除所属摘要的所有聊天记录
* @param {ChatInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiLLMChatDeleteSummaryAllPost(body?: ChatInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminNETResultBoolean>>> {
const localVarAxiosArgs = await LLMChatApiAxiosParamCreator(configuration).apiLLMChatDeleteSummaryAllPost(body, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
* 获取模型列表
* @summary 获取模型列表
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiLLMChatModelListGet(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminNETResultModelListOutput>>> {
const localVarAxiosArgs = await LLMChatApiAxiosParamCreator(configuration).apiLLMChatModelListGet(options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
* 重命名所属摘要的标签
* @summary 重命名所属摘要的标签
* @param {ChatInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiLLMChatRenameSummaryLablePost(body?: ChatInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminNETResultBoolean>>> {
const localVarAxiosArgs = await LLMChatApiAxiosParamCreator(configuration).apiLLMChatRenameSummaryLablePost(body, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
}
};
/**
* LLMChatApi - factory interface
* @export
*/
export const LLMChatApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
return {
/**
* 切换模型
* @summary 切换模型
* @param {ModelListChangeInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiLLMChatChangeModelPost(body?: ModelListChangeInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminNETResultBoolean>> {
return LLMChatApiFp(configuration).apiLLMChatChangeModelPost(body, options).then((request) => request(axios, basePath));
},
/**
* 获取聊天列表
* @summary 获取聊天列表
* @param {ChatListInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiLLMChatChatListPost(body?: ChatListInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminNETResultSqlSugarPagedListChatListOutput>> {
return LLMChatApiFp(configuration).apiLLMChatChatListPost(body, options).then((request) => request(axios, basePath));
},
/**
* 聊天补全
* @summary 聊天补全
* @param {ChatInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiLLMChatChatPost(body?: ChatInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminNETResultChatOutput>> {
return LLMChatApiFp(configuration).apiLLMChatChatPost(body, options).then((request) => request(axios, basePath));
},
/**
* 删除所属摘要的所有聊天记录
* @summary 删除所属摘要的所有聊天记录
* @param {ChatInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiLLMChatDeleteSummaryAllPost(body?: ChatInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminNETResultBoolean>> {
return LLMChatApiFp(configuration).apiLLMChatDeleteSummaryAllPost(body, options).then((request) => request(axios, basePath));
},
/**
* 获取模型列表
* @summary 获取模型列表
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiLLMChatModelListGet(options?: AxiosRequestConfig): Promise<AxiosResponse<AdminNETResultModelListOutput>> {
return LLMChatApiFp(configuration).apiLLMChatModelListGet(options).then((request) => request(axios, basePath));
},
/**
* 重命名所属摘要的标签
* @summary 重命名所属摘要的标签
* @param {ChatInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiLLMChatRenameSummaryLablePost(body?: ChatInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminNETResultBoolean>> {
return LLMChatApiFp(configuration).apiLLMChatRenameSummaryLablePost(body, options).then((request) => request(axios, basePath));
},
};
};
/**
* LLMChatApi - object-oriented interface
* @export
* @class LLMChatApi
* @extends {BaseAPI}
*/
export class LLMChatApi extends BaseAPI {
/**
* 切换模型
* @summary 切换模型
* @param {ModelListChangeInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof LLMChatApi
*/
public async apiLLMChatChangeModelPost(body?: ModelListChangeInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminNETResultBoolean>> {
return LLMChatApiFp(this.configuration).apiLLMChatChangeModelPost(body, options).then((request) => request(this.axios, this.basePath));
}
/**
* 获取聊天列表
* @summary 获取聊天列表
* @param {ChatListInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof LLMChatApi
*/
public async apiLLMChatChatListPost(body?: ChatListInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminNETResultSqlSugarPagedListChatListOutput>> {
return LLMChatApiFp(this.configuration).apiLLMChatChatListPost(body, options).then((request) => request(this.axios, this.basePath));
}
/**
* 聊天补全
* @summary 聊天补全
* @param {ChatInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof LLMChatApi
*/
public async apiLLMChatChatPost(body?: ChatInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminNETResultChatOutput>> {
return LLMChatApiFp(this.configuration).apiLLMChatChatPost(body, options).then((request) => request(this.axios, this.basePath));
}
/**
* 删除所属摘要的所有聊天记录
* @summary 删除所属摘要的所有聊天记录
* @param {ChatInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof LLMChatApi
*/
public async apiLLMChatDeleteSummaryAllPost(body?: ChatInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminNETResultBoolean>> {
return LLMChatApiFp(this.configuration).apiLLMChatDeleteSummaryAllPost(body, options).then((request) => request(this.axios, this.basePath));
}
/**
* 获取模型列表
* @summary 获取模型列表
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof LLMChatApi
*/
public async apiLLMChatModelListGet(options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminNETResultModelListOutput>> {
return LLMChatApiFp(this.configuration).apiLLMChatModelListGet(options).then((request) => request(this.axios, this.basePath));
}
/**
* 重命名所属摘要的标签
* @summary 重命名所属摘要的标签
* @param {ChatInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof LLMChatApi
*/
public async apiLLMChatRenameSummaryLablePost(body?: ChatInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminNETResultBoolean>> {
return LLMChatApiFp(this.configuration).apiLLMChatRenameSummaryLablePost(body, options).then((request) => request(this.axios, this.basePath));
}
}