feat(ai): add local expert library

This commit is contained in:
2026-07-22 17:09:54 +08:00
parent b28a5d635c
commit 42dd0dce47
22 changed files with 3432 additions and 60 deletions

View File

@@ -6,13 +6,46 @@ export type AISessionDTO = {
title: string
context: string
status: string
expert: AIExpertDTO | null
createdAt: string
updatedAt: string
}
export type AIExpertDTO = {
id: string
slug: string
category: string
categoryName: string
name: string
description: string
emoji: string
color: string
}
export type AIExpertDetailDTO = AIExpertDTO & {
systemPrompt: string
source: string
sourceLicense: string
}
export type CreateAISessionInput = {
title: string
context: string
expertId?: string
}
export async function listAIExperts(session: ApiSession, signal?: AbortSignal) {
return apiRequest<AIExpertDTO[]>('/api/v1/ai-experts', {
token: session.token,
signal,
})
}
export async function getAIExpert(session: ApiSession, expertId: string, signal?: AbortSignal) {
return apiRequest<AIExpertDetailDTO>(`/api/v1/ai-experts/${expertId}`, {
token: session.token,
signal,
})
}
export async function listAISessions(session: ApiSession, projectId: string, signal?: AbortSignal) {