update knowledge_kb (#34)

* update typescript

* add chunk api

* remove useless code
This commit is contained in:
yqj123
2024-01-18 18:27:38 +08:00
committed by GitHub
parent 9bf75d4511
commit fad2ec7cf3
59 changed files with 1018 additions and 1848 deletions

View File

@@ -1,25 +1,23 @@
import { Effect, ImmerReducer, Reducer, Subscription } from 'umi';
import { Effect, Reducer, Subscription } from 'umi';
export interface IndexModelState {
export interface chatModelState {
name: string;
}
export interface IndexModelType {
namespace: 'index';
state: IndexModelState;
export interface chatModelType {
namespace: 'chatModel';
state: chatModelState;
effects: {
query: Effect;
};
reducers: {
save: Reducer<IndexModelState>;
// 启用 immer 之后
// save: ImmerReducer<IndexModelState>;
save: Reducer<chatModelState>;
};
subscriptions: { setup: Subscription };
}
const IndexModel: IndexModelType = {
namespace: 'index',
const Model: chatModelType = {
namespace: 'chatModel',
state: {
name: 'kate',
},
@@ -34,10 +32,6 @@ const IndexModel: IndexModelType = {
...action.payload,
};
},
// 启用 immer 之后
// save(state, action) {
// state.name = action.payload;
// },
},
subscriptions: {
setup({ dispatch, history }) {
@@ -49,4 +43,4 @@ const IndexModel: IndexModelType = {
},
};
export default IndexModel;
export default Model;