new(core.gbapp): LLM alerts for data.

This commit is contained in:
me@rodrigorodriguez.com 2024-10-17 16:52:04 -03:00
parent 5bae484af0
commit 44e3ecc077

View file

@ -551,9 +551,9 @@ export class ChatServices {
let dataSource; let dataSource;
if (answerSource === 'cache') { if (answerSource === 'cache') {
let sqliteFilePath = let sqliteFilePath =
path.join('work', GBUtil.getGBAIPath(min.botId), `${con['name']}.sqlite`); path.join('work', GBUtil.getGBAIPath(min.botId), `${con['name']}.sqlite`);
GBLogEx.info(min, `Using data from cache: Path.basename(${sqliteFilePath}).`);
dataSource = new DataSource({ dataSource = new DataSource({
type: 'sqlite', type: 'sqlite',
@ -619,7 +619,7 @@ export class ChatServices {
* Create the final prompt template which is tasked with getting the natural * Create the final prompt template which is tasked with getting the natural
* language response to the SQL query. * language response to the SQL query.
*/ */
const finalResponsePrompt = const finalResponsePrompt =
PromptTemplate.fromTemplate(`Based on the table schema below, question, SQL query, and SQL response, write a natural language response: PromptTemplate.fromTemplate(`Based on the table schema below, question, SQL query, and SQL response, write a natural language response:
Optimize answers for KPI people. ${systemPrompt} Optimize answers for KPI people. ${systemPrompt}
------------ ------------