new(core.gbapp): LLM alerts for data.
This commit is contained in:
parent
7500148252
commit
90c1e2b461
2 changed files with 11 additions and 3 deletions
|
|
@ -750,7 +750,7 @@ export class SystemKeywords {
|
|||
public async saveToStorageBatch({ pid, table, rows }): Promise<void> {
|
||||
const { min } = await DialogKeywords.getProcessInfo(pid);
|
||||
|
||||
if (typeof rows === 'object' && rows !== null) {
|
||||
if (!Array.isArray(data) && typeof rows === 'object' && rows !== null) {
|
||||
rows = [rows];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -545,12 +545,20 @@ export class ChatServices {
|
|||
} else if (LLMMode === 'sql' || LLMMode === 'chart') {
|
||||
const con = min[`llm`]['gbconnection'];
|
||||
const dialect = con['storageDriver'];
|
||||
|
||||
const answerSource = await (min.core as any)['getParam'](min.instance,
|
||||
'Answer Source', false);
|
||||
|
||||
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({
|
||||
type: 'sqlite',
|
||||
database: con['storageFile'],
|
||||
database: sqliteFilePath,
|
||||
synchronize: false,
|
||||
logging: true
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue