feat(ai): add local expert library
This commit is contained in:
@@ -3,7 +3,7 @@ import { ConfigProvider, Message, Spin } from '@arco-design/web-react'
|
||||
import '@arco-design/web-react/dist/css/arco.css'
|
||||
import '../App.css'
|
||||
import { ApiError, login, setApiBaseUrl, type ApiSession } from '../api/client'
|
||||
import { createAISession, listAISessions, type CreateAISessionInput } from '../api/ai'
|
||||
import { createAISession, listAIExperts, listAISessions, type CreateAISessionInput } from '../api/ai'
|
||||
import { analyzeInboxItem, confirmInboxItem } from '../api/inbox'
|
||||
import { mapWorkspace } from '../api/mappers'
|
||||
import {
|
||||
@@ -49,6 +49,11 @@ function App() {
|
||||
return listAISessions(session, projectId, signal)
|
||||
}, [session])
|
||||
|
||||
const handleListAIExperts = useCallback((signal?: AbortSignal) => {
|
||||
if (!session) return Promise.reject(new Error('未登录'))
|
||||
return listAIExperts(session, signal)
|
||||
}, [session])
|
||||
|
||||
const handleCreateAISession = useCallback((projectId: string, input: CreateAISessionInput, signal?: AbortSignal) => {
|
||||
if (!session) return Promise.reject(new Error('未登录'))
|
||||
return createAISession(session, projectId, input, signal)
|
||||
@@ -358,6 +363,7 @@ function App() {
|
||||
onAnalyzeInbox={handleAnalyzeInbox}
|
||||
onConfirmInbox={handleConfirmInbox}
|
||||
onListAISessions={handleListAISessions}
|
||||
onListAIExperts={handleListAIExperts}
|
||||
onCreateAISession={handleCreateAISession}
|
||||
/>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user