first commit

This commit is contained in:
liu
2026-07-13 15:23:29 +08:00
commit 50885a98c8
473 changed files with 33772 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
import createAxios from '@/utils/request';
import type { IAgent } from '@/domain/iAgents';
export async function getAgentList() {
return createAxios<IAgent[]>({
url: '/ai/agent',
method: 'get',
});
}
export async function getAgent(id: number) {
return createAxios<IAgent>({
url: `/ai/agent/${id}`,
method: 'get',
});
}
export async function updateAgent(id: number, data: {enabled: boolean}) {
return createAxios({
url: `/ai/agent/${id}`,
method: 'put',
data,
});
}
+26
View File
@@ -0,0 +1,26 @@
import createAxios from '@/utils/request';
import type {BubbleItemType, ConversationItemType} from "@ant-design/x";
/** 获取会话列表 */
export async function getConversations() {
return createAxios<ConversationItemType[]>({
url: '/ai/chat/conversations',
method: 'get',
});
}
/** 获取会话消息 */
export async function getMessages(conversationId: string) {
return createAxios<BubbleItemType[]>({
url: `/ai/chat/messages/${conversationId}`,
method: 'get',
});
}
/** 删除会话 */
export async function deleteConversation(conversationId: string) {
return createAxios({
url: `/ai/chat/conversations/${conversationId}`,
method: 'delete',
});
}
+18
View File
@@ -0,0 +1,18 @@
import createAxios from '@/utils/request';
import type { IAgentMessage } from '@/domain/iAgents.ts';
interface PaginatorData<T> {
data: T[];
total: number;
pageSize: number;
current: number;
}
/** 获取会话消息列表 */
export async function getMessages(conversationId: string, params?: Record<string, any>) {
return createAxios<PaginatorData<IAgentMessage>>({
url: `/ai/conversation/${conversationId}/messages`,
method: 'get',
params,
});
}