diff --git a/packages/basic.gblib/services/SystemKeywords.ts b/packages/basic.gblib/services/SystemKeywords.ts index fcd3bb782..62224b6f8 100644 --- a/packages/basic.gblib/services/SystemKeywords.ts +++ b/packages/basic.gblib/services/SystemKeywords.ts @@ -795,43 +795,6 @@ export class SystemKeywords { * @example SAVE "Billing", columnName1, columnName2 * */ - public async saveToStorage({ pid, table, fieldsValues, fieldsNames }): Promise { - if (!fieldsValues || fieldsValues.length === 0 || !fieldsValues[0]) { - return; - } - - const { min } = await DialogKeywords.getProcessInfo(pid); - GBLogEx.info(min, `SAVE '${table}': 1 row.`); - - const definition = this.getTableFromName(table, min); - - // Uppercases fields. - - let dst = {}; - let i = 0; - Object.keys(fieldsValues).forEach(fieldSrc => { - const field = fieldsNames[i].charAt(0).toUpperCase() + fieldsNames[i].slice(1); - - dst[field] = fieldsValues[fieldSrc]; - - i++; - }); - dst = null; - - let item; - await retry( - async bail => { - item = await definition.create(dst); - }, - { - retries: 5, - onRetry: err => { - GBLog.error(`Retrying SaveToStorage due to: ${err.message}.`); - } - } - ); - return item; - } public async saveToStorageWithJSON({ pid, table, fieldsValues, fieldsNames }): Promise { const { min, user } = await DialogKeywords.getProcessInfo(pid); diff --git a/packages/core.gbapp/services/GBDeployer.ts b/packages/core.gbapp/services/GBDeployer.ts index bc1af018c..d39f1d0ff 100644 --- a/packages/core.gbapp/services/GBDeployer.ts +++ b/packages/core.gbapp/services/GBDeployer.ts @@ -155,7 +155,7 @@ export class GBDeployer implements IGBDeployer { (await fs.readdir(source)) .map(name => path.join(source, name)) .filter(isDirectory); - const dirs = getDirectories(directory); + const dirs = await getDirectories(directory); await CollectionUtil.asyncForEach(dirs, async element => { // For each folder, checks its extensions looking for valid packages. diff --git a/templates/edu.gbai/edu.gbdialog/enrollment.bas b/templates/edu.gbai/edu.gbdialog/enrollment.bas new file mode 100644 index 000000000..c2aed9024 --- /dev/null +++ b/templates/edu.gbai/edu.gbdialog/enrollment.bas @@ -0,0 +1,20 @@ +PARAM nome AS string LIKE "João Silva" DESCRIPTION "Required full name of the individual." +PARAM datanasc AS date LIKE "23/09/2001" DESCRIPTION "Required birth date of the individual in DD/MM/YYYY format." +PARAM email AS string LIKE "joao.silva@example.com" DESCRIPTION "Required email address for contact purposes." +PARAM cpf AS integer LIKE "12345678900" DESCRIPTION "Required CPF number of the individual (only numbers)." +PARAM rg AS integer LIKE "12345678" DESCRIPTION "Required RG or CNH number of the individual (only numbers)." +PARAM orgaorg AS string LIKE "SSP-SP" DESCRIPTION "Required issuing authority of the individual's RG or CNH." +PARAM dataemite AS date LIKE "15/08/2007" DESCRIPTION "Required issue date of the individual's RG or CNH in DD/MM/YYYY format." +PARAM ender AS string LIKE "Rua das Flores, 123, São Paulo, SP" DESCRIPTION "Required full address of the individual." +PARAM nomealuno AS string LIKE "Ana Silva" DESCRIPTION "Required full name of the student for enrollment." +PARAM cpfaluno AS integer LIKE "98765432100" DESCRIPTION "Required CPF number of the student (only numbers)." +PARAM datanascaluno AS date LIKE "07/03/2010" DESCRIPTION "Required birth date of the student in DD/MM/YYYY format." +PARAM rgaluno AS integer LIKE "87654321" DESCRIPTION "Required RG number of the student (only numbers)." +PARAM orgaoaluno AS string LIKE "SSP-SP" DESCRIPTION "Required issuing authority of the student's RG or CNH." +PARAM emissaoaluno AS date LIKE "10/05/2015" DESCRIPTION "Required issue date of the student's RG or CNH in DD/MM/YYYY format." +PARAM respfinaluno AS string LIKE "Maria Oliveira" DESCRIPTION "Required full name of the financial responsible party for the student." + +DESCRIPTION "This is a the enrollment process, called when the user wants to enrol. Once all information is collected, confirm the details and inform them that their enrollment request has been successfully submitted. Provide a polite and professional tone throughout the interaction." + +SAVE "enrollments.csv", id, from, nome, datanasc, email, cpf, rg, orgaorg, dataemite, ender, nomealuno, cpfaluno, datanascaluno + \ No newline at end of file diff --git a/templates/edu.gbai/edu.gbdialog/start.bas b/templates/edu.gbai/edu.gbdialog/start.bas index 3a9b36065..c45ed53f6 100644 --- a/templates/edu.gbai/edu.gbdialog/start.bas +++ b/templates/edu.gbai/edu.gbdialog/start.bas @@ -1,47 +1,3 @@ -REM SEND FILE “logo.png” -SAVE “Log.xlsx”, from, mobile, today, now, "start" - -TALK "Olá " + username + “, eu sou o *Bot*. - -row = FIND “People.xlsx”, “mobile=” + from -IF row = null THEN - - TALK Verifiquei que é seu primeiro contato conosco por aqui. Vamos fazer o seu cadastro e realizar a matrícula logo em seguida. - TALK Por favor, me informe o seu *Nome Completo*: - HEAR nome AS NAME - TALK Qual a sua *data de nascimento*? Exemplo: 23/09/2001. - HEAR datanasc AS DATE - TALK Informe por favor, um *e-mail* pra contato. - HEAR email as EMAIL - TALK Por favor, me informe o seu *CPF* (apenas números). - HEAR cpf AS INTEGER - TALK Qual o *número do seu RG ou CNH* (apenas números, por favor)? - HEAR rg AS INTEGER - TALK Qual o *Órgão emissor* do seu RG ou CNH? - HEAR orgaorg - TALK Qual a *data de emissão* do seu *RG* ou *CNH*? Exemplo: 15/08/2007 - HEAR dataemite AS DATE - TALK Qual o seu endereço completo? - HEAR ender - TALK Pronto! Agora vamos realizar a matrícula do aluno.\n\nPor favor, me informe o *Nome Completo*: - HEAR nomealuno AS NAME - TALK Me informe o *CPF* (apenas números) do aluno: - HEAR cpfaluno as INTEGER - TALK Qual a *data de nascimento* do aluno? Exemplo: 07/03/2010 - HEAR datanascaluno AS DATE - TALK Qual o *RG* (apenas números) do aluno? - HEAR rgaluno AS DATE - TALK Qual o *Órgão Emissor* do documento? - HEAR orgaoaluno - TALK Qual o *Data de Emissão* do documento? - HEAR emissaoaluno AS DATE - TALK Qual o nome do responsável financeiro do aluno? - HEAR respfinaluno AS NAME - TALK Vou registrar agora estes dados, um instante por favor... - SAVE People.xlsx, id, from, nome, datanasc, email, cpf, rg, orgaorg, dataemite, ender, nomealuno, cpfaluno, datanascaluno - TALK "Pronto, + username + ! O cadastro foi realizado. Iremos entrar em contato. \n\nObrigado!" - -ELSE - SAVE Log.xlsx, from, mobile, today, now, hello - TALK Olá, + username + ! Bem-vinda(o) de volta. Você pode tirar dúvidas comigo sobre a secretaria. -END IF \ No newline at end of file +BEGIN SYSTEM PROMPT + Act as an AI assistant for an educational institution. Your role is to help users with enrollment, provide information about courses, answer admissions-related questions, and guide them through the registration process. Ensure a friendly, professional tone while offering clear, accurate assistance to reduce administrative workload and enhance the user experience. +END SySTEM PROMPT \ No newline at end of file diff --git a/templates/edu.gbai/edu.gbot/config.csv b/templates/edu.gbai/edu.gbot/config.csv new file mode 100644 index 000000000..b073cbdfb --- /dev/null +++ b/templates/edu.gbai/edu.gbot/config.csv @@ -0,0 +1,3 @@ +name,value +Answer Mode,tool +Start Dialog,start \ No newline at end of file diff --git a/templates/api-server.gbai/api.gbdialog/start.bas b/templates/llm-server.gbai/llm-server.gbdialog/start.bas similarity index 100% rename from templates/api-server.gbai/api.gbdialog/start.bas rename to templates/llm-server.gbai/llm-server.gbdialog/start.bas