初始化模版工程
This commit is contained in:
25
components/nova-sdk/context/context.ts
Normal file
25
components/nova-sdk/context/context.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { createContext } from 'react'
|
||||
import type { NovaKitContextValue, NovaAPI } from '../types'
|
||||
import { TaskStatus } from '../types'
|
||||
|
||||
const defaultApiStub: NovaAPI = {
|
||||
apiClient: null,
|
||||
getArtifactUrl: async () => ({ data: '' }),
|
||||
stopChat: async () => {},
|
||||
getConversationInfoList: async () => ({ data: [] }),
|
||||
}
|
||||
|
||||
export const NovaKitContext = createContext<NovaKitContextValue>({
|
||||
agentId: '',
|
||||
agentName: 'Autonomous Agent',
|
||||
messageList: [],
|
||||
taskStatus: TaskStatus.PENDING,
|
||||
conversationId: null,
|
||||
isLoading: false,
|
||||
artifacts: [],
|
||||
api: defaultApiStub,
|
||||
setLoading: () => {},
|
||||
loading: false,
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user