new(core.gbapp): LLM alerts for data.
This commit is contained in:
parent
789fd79777
commit
2a279d27ca
3 changed files with 12 additions and 3 deletions
|
@ -750,7 +750,7 @@ export class SystemKeywords {
|
||||||
public async saveToStorageBatch({ pid, table, rows }): Promise<void> {
|
public async saveToStorageBatch({ pid, table, rows }): Promise<void> {
|
||||||
const { min } = await DialogKeywords.getProcessInfo(pid);
|
const { min } = await DialogKeywords.getProcessInfo(pid);
|
||||||
|
|
||||||
if (typeof rows === 'object' && rows !== null) {
|
if (!Array.isArray(data) && typeof rows === 'object' && rows !== null) {
|
||||||
rows = [rows];
|
rows = [rows];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -546,11 +546,19 @@ export class ChatServices {
|
||||||
const con = min[`llm`]['gbconnection'];
|
const con = min[`llm`]['gbconnection'];
|
||||||
const dialect = con['storageDriver'];
|
const dialect = con['storageDriver'];
|
||||||
|
|
||||||
|
const answerSource = await (min.core as any)['getParam'](min.instance,
|
||||||
|
'Answer Source', false);
|
||||||
|
|
||||||
let dataSource;
|
let dataSource;
|
||||||
if (dialect === 'sqlite') {
|
if (dialect === 'sqlite' || answerSource === 'cache') {
|
||||||
|
|
||||||
|
let sqliteFilePath = answerSource === 'cache' ?
|
||||||
|
path.join('work', GBUtil.getGBAIPath(min.botId), `${con['name']}.sqlite`):
|
||||||
|
con['storageFile'];
|
||||||
|
|
||||||
dataSource = new DataSource({
|
dataSource = new DataSource({
|
||||||
type: 'sqlite',
|
type: 'sqlite',
|
||||||
database: con['storageFile'],
|
database: sqliteFilePath,
|
||||||
synchronize: false,
|
synchronize: false,
|
||||||
logging: true
|
logging: true
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
name,value
|
name,value
|
||||||
Admin, 5521999998888
|
Admin, 5521999998888
|
||||||
Answer Mode,sql
|
Answer Mode,sql
|
||||||
|
Answer Source,cache
|
||||||
llm File,northwind.db
|
llm File,northwind.db
|
||||||
llm Driver,sqlite
|
llm Driver,sqlite
|
||||||
Theme Color,red
|
Theme Color,red
|
|
Loading…
Add table
Reference in a new issue