260720
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
import type {
|
||||
ActivityOutlineGenParams,
|
||||
ActivityOutlineGenResponse
|
||||
} from './model';
|
||||
|
||||
/**
|
||||
* 活动策划大纲生成
|
||||
*/
|
||||
export async function activityOutlineGen(data: ActivityOutlineGenParams) {
|
||||
const res = await request.post<ApiResult<ActivityOutlineGenResponse>>(
|
||||
MODULES_API_URL + '/ai/activityOutlineGen',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message || '生成失败'));
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
export interface ActivityOutlineGenParams {
|
||||
event_theme: string;
|
||||
people: string;
|
||||
event_time: string;
|
||||
event_funding: string;
|
||||
event_type?: string;
|
||||
event_location?: string;
|
||||
event_meme?: string;
|
||||
}
|
||||
|
||||
export interface ActivityOutlineGenResponse {
|
||||
answer?: string;
|
||||
conversationId?: string;
|
||||
messageId?: string;
|
||||
raw?: Record<string, any>;
|
||||
[key: string]: any;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { AiChatHistory, AiChatHistoryParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
export async function pageAiChatHistory(params: AiChatHistoryParam) {
|
||||
const res = await request.get<ApiResult<PageResult<AiChatHistory>>>(
|
||||
MODULES_API_URL + '/ai/ai-chat-history/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
export async function listAiChatHistory(params?: AiChatHistoryParam) {
|
||||
const res = await request.get<ApiResult<AiChatHistory[]>>(
|
||||
MODULES_API_URL + '/ai/ai-chat-history',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
export async function addAiChatHistory(data: AiChatHistory) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/ai/ai-chat-history',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
export async function updateAiChatHistory(data: AiChatHistory) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/ai/ai-chat-history',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
export async function removeAiChatHistory(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/ai/ai-chat-history/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
export async function removeBatchAiChatHistory(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/ai/ai-chat-history/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*/
|
||||
export async function getAiChatHistory(id: number) {
|
||||
const res = await request.get<ApiResult<AiChatHistory>>(
|
||||
MODULES_API_URL + '/ai/ai-chat-history/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export interface AiChatHistory {
|
||||
//
|
||||
id?: number;
|
||||
//
|
||||
chatId?: number;
|
||||
//
|
||||
conversationId?: string;
|
||||
//
|
||||
userId?: number;
|
||||
//
|
||||
content?: string;
|
||||
//
|
||||
reply?: string;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface AiChatHistoryParam extends PageParam {
|
||||
id?: number;
|
||||
chatId?: number;
|
||||
conversationId?: string;
|
||||
userId?: number;
|
||||
content?: string;
|
||||
reply?: string;
|
||||
status?: number;
|
||||
deleted?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { AiChatList, AiChatListParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
export async function pageAiChatList(params: AiChatListParam) {
|
||||
const res = await request.get<ApiResult<PageResult<AiChatList>>>(
|
||||
MODULES_API_URL + '/ai/ai-chat-list/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
export async function listAiChatList(params?: AiChatListParam) {
|
||||
const res = await request.get<ApiResult<AiChatList[]>>(
|
||||
MODULES_API_URL + '/ai/ai-chat-list',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
export async function addAiChatList(data: AiChatList) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/ai/ai-chat-list',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
export async function updateAiChatList(data: AiChatList) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/ai/ai-chat-list',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
export async function removeAiChatList(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/ai/ai-chat-list/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
export async function removeBatchAiChatList(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/ai/ai-chat-list/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*/
|
||||
export async function getAiChatList(id: number) {
|
||||
const res = await request.get<ApiResult<AiChatList>>(
|
||||
MODULES_API_URL + '/ai/ai-chat-list/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export interface AiChatList {
|
||||
//
|
||||
id?: number;
|
||||
//
|
||||
conversationId?: string;
|
||||
//
|
||||
userId?: number;
|
||||
//
|
||||
roleId?: number;
|
||||
//
|
||||
roleName?: string;
|
||||
//
|
||||
roleDesc?: string;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
//
|
||||
title?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface AiChatListParam extends PageParam {
|
||||
id?: number;
|
||||
conversationId?: string;
|
||||
userId?: number;
|
||||
roleId?: number;
|
||||
roleName?: string;
|
||||
roleDesc?: string;
|
||||
status?: number;
|
||||
deleted?: number;
|
||||
title?: string;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
import type {
|
||||
ChallengeCupDocumentListResult,
|
||||
ChallengeCupDocumentParam,
|
||||
CompetitionHistoryPreprocessResult
|
||||
} from './model';
|
||||
|
||||
export async function preprocessCompetitionHistoryFiles(
|
||||
files: File[],
|
||||
scoreFile?: File,
|
||||
manualText?: string
|
||||
) {
|
||||
const formData = new FormData();
|
||||
files.forEach((file) => {
|
||||
formData.append('files', file);
|
||||
});
|
||||
if (scoreFile) {
|
||||
formData.append('scoreFile', scoreFile);
|
||||
}
|
||||
if (manualText?.trim()) {
|
||||
formData.append('manualText', manualText.trim());
|
||||
}
|
||||
const res = await request.post<ApiResult<CompetitionHistoryPreprocessResult>>(
|
||||
MODULES_API_URL + '/ai/competition-history/preprocess',
|
||||
formData
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message || '历史竞赛文件预处理失败'));
|
||||
}
|
||||
|
||||
export async function listChallengeCupDocuments(
|
||||
params?: ChallengeCupDocumentParam
|
||||
) {
|
||||
const res = await request.get<ApiResult<ChallengeCupDocumentListResult>>(
|
||||
MODULES_API_URL + '/ai/knowledge-base/challenge-cup/documents',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message || '获取知识库文档失败'));
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
export interface AiUploadedFile {
|
||||
id?: string | number;
|
||||
upload_file_id?: string | number;
|
||||
name?: string;
|
||||
size?: number;
|
||||
extension?: string;
|
||||
mime_type?: string;
|
||||
created_by?: string;
|
||||
created_at?: number;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export interface CompetitionHistoryPreprocessResult {
|
||||
answer?: string;
|
||||
taskId?: string;
|
||||
workflowRunId?: string;
|
||||
outputs?: Record<string, any>;
|
||||
raw?: Record<string, any>;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export interface ChallengeCupDocument {
|
||||
id: string;
|
||||
name?: string;
|
||||
data_source_type?: string;
|
||||
display_status?: string;
|
||||
indexing_status?: string;
|
||||
enabled?: boolean;
|
||||
word_count?: number;
|
||||
created_at?: number;
|
||||
updated_at?: number;
|
||||
archived?: boolean;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export interface ChallengeCupDocumentListResult {
|
||||
data: ChallengeCupDocument[];
|
||||
has_more?: boolean;
|
||||
limit?: number;
|
||||
total?: number;
|
||||
page?: number;
|
||||
}
|
||||
|
||||
export interface ChallengeCupDocumentParam {
|
||||
page?: number;
|
||||
limit?: number;
|
||||
keyword?: string;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
import request from '@/utils/request';
|
||||
import type { AxiosRequestConfig } from 'axios';
|
||||
import type { ApiResult } from '@/api';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
import type { FileRecord } from '@/api/system/file/model';
|
||||
import type {
|
||||
CreativeAssistantRequest,
|
||||
CreativeAssistantResponse
|
||||
} from './model';
|
||||
|
||||
/**
|
||||
* AI文件上传
|
||||
*/
|
||||
export async function uploadAiFile(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
const res = await request.post<ApiResult<FileRecord>>(
|
||||
MODULES_API_URL + '/ai/file/upload',
|
||||
formData
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message || '上传失败'));
|
||||
}
|
||||
|
||||
/**
|
||||
* AI创意助手
|
||||
* 说明:接口路径根据当前项目命名规则按 /ai/creativeAssistant 约定,
|
||||
* 若后端实际路径不同,可直接在这里调整。
|
||||
*/
|
||||
export async function creativeAssistant(
|
||||
data: CreativeAssistantRequest,
|
||||
config?: AxiosRequestConfig
|
||||
) {
|
||||
const res = await request.post<ApiResult<CreativeAssistantResponse>>(
|
||||
MODULES_API_URL + '/ai/creativeAssistant',
|
||||
data,
|
||||
config
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message || '执行失败'));
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import type { FileRecord } from '@/api/system/file/model';
|
||||
|
||||
export interface CreativeAssistantUploadFile {
|
||||
transfer_method: 'local_file';
|
||||
type: 'image' | 'document' | 'audio' | 'video';
|
||||
upload_file_id?: number;
|
||||
url: string;
|
||||
}
|
||||
|
||||
export interface CreativeAssistantRequest {
|
||||
user_content?: string;
|
||||
user_contentString?: string;
|
||||
user_files?: CreativeAssistantUploadFile[];
|
||||
}
|
||||
|
||||
export interface CreativeAssistantOutputs {
|
||||
video_result?: Partial<FileRecord>[];
|
||||
video_message?: string;
|
||||
Script_result?: string;
|
||||
photo_files?: Partial<FileRecord>[];
|
||||
photo_message?: string;
|
||||
}
|
||||
|
||||
export interface CreativeAssistantResponse {
|
||||
outputs?: CreativeAssistantOutputs;
|
||||
[key: string]: any;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { KnowledgeBaseListResult, KnowledgeBaseParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 知识库列表
|
||||
*/
|
||||
export async function listKnowledgeBase(params?: KnowledgeBaseParam) {
|
||||
const res = await request.get<ApiResult<KnowledgeBaseListResult>>(
|
||||
MODULES_API_URL + '/ai/knowledge-base/list',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* 知识库
|
||||
*/
|
||||
export interface KnowledgeBase {
|
||||
id: string;
|
||||
name: string;
|
||||
description?: string;
|
||||
provider?: string;
|
||||
permission?: string;
|
||||
data_source_type?: string;
|
||||
indexing_technique?: string;
|
||||
app_count?: number;
|
||||
document_count?: number;
|
||||
word_count?: number;
|
||||
created_by?: string;
|
||||
author_name?: string;
|
||||
created_at?: number;
|
||||
updated_by?: string;
|
||||
updated_at?: number;
|
||||
embedding_model?: string;
|
||||
embedding_model_provider?: string;
|
||||
embedding_available?: boolean;
|
||||
enable_api?: boolean;
|
||||
total_documents?: number;
|
||||
total_available_documents?: number;
|
||||
is_multimodal?: boolean;
|
||||
is_published?: boolean;
|
||||
tags?: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 知识库列表响应
|
||||
*/
|
||||
export interface KnowledgeBaseListResult {
|
||||
data: KnowledgeBase[];
|
||||
has_more: boolean;
|
||||
limit: number;
|
||||
total: number;
|
||||
page: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface KnowledgeBaseParam {
|
||||
page?: number;
|
||||
limit?: number;
|
||||
keyword?: string;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import request from '@/utils/request';
|
||||
import type { AxiosRequestConfig } from 'axios';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { ManuscriptGenParams, ManuscriptGenResult } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* AI内容创作
|
||||
*/
|
||||
export async function manuscriptGen(
|
||||
data: ManuscriptGenParams,
|
||||
config?: AxiosRequestConfig
|
||||
) {
|
||||
const res = await request.post<ApiResult<ManuscriptGenResult>>(
|
||||
MODULES_API_URL + '/ai/manuscriptGen',
|
||||
data,
|
||||
config
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message || '生成失败'));
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import type { FileRecord } from '@/api/system/file/model';
|
||||
|
||||
export interface ManuscriptGenParams {
|
||||
docType?: string;
|
||||
eventType?: string;
|
||||
theme?: string;
|
||||
time?: string;
|
||||
location?: string;
|
||||
participants?: string;
|
||||
highlights?: string;
|
||||
number?: number;
|
||||
files?: Partial<FileRecord>[];
|
||||
}
|
||||
|
||||
export type ManuscriptGenResult = string | Record<string, any>;
|
||||
Reference in New Issue
Block a user