fix(basic.gblib): update ChatServices.ts #420

Closed
eltociear wants to merge 2540 commits from patch-1 into main
2 changed files with 9 additions and 6 deletions
Showing only changes of commit 063c149b94 - Show all commits

View file

@ -47,6 +47,7 @@ import { GBLogEx } from '../../core.gbapp/services/GBLogEx.js';
* Basic services for BASIC manipulation. * Basic services for BASIC manipulation.
*/ */
export class ScheduleServices extends GBService { export class ScheduleServices extends GBService {
public async deleteScheduleIfAny(min: GBMinInstance, name: string) { public async deleteScheduleIfAny(min: GBMinInstance, name: string) {
let i = 1; let i = 1;

View file

@ -22,20 +22,22 @@ export class SecService extends GBService {
displayName: string, displayName: string,
email: string email: string
): Promise<GuaribasUser> { ): Promise<GuaribasUser> {
const gbaiPath = DialogKeywords.getGBAIPath(min.botId);
const dir = urlJoin ('work',gbaiPath, 'users', userSystemId);
if (!Fs.existsSync(dir)) {
mkdirp.sync(dir);
}
let user = await GuaribasUser.findOne({ let user = await GuaribasUser.findOne({
where: { where: {
userSystemId: userSystemId userSystemId: userSystemId
} }
}); });
const gbaiPath = DialogKeywords.getGBAIPath(min.botId);
const dir = urlJoin ('work',gbaiPath, 'users', userSystemId);
if (!user) { if (!user) {
user = GuaribasUser.build(); user = GuaribasUser.build();
if (!Fs.existsSync(dir)) {
mkdirp.sync(dir);
}
} }
const systemPromptFile = urlJoin(dir, 'systemPrompt.txt'); const systemPromptFile = urlJoin(dir, 'systemPrompt.txt');