new(whatsapp.gblib): LLM SQL.

This commit is contained in:
Rodrigo Rodriguez 2024-08-13 20:26:40 -03:00
parent 9d82774544
commit fa6fe752cc

View file

@ -506,6 +506,7 @@ export class ChatServices {
const prompt =
PromptTemplate.fromTemplate(`Based on the provided SQL table schema below, write a SQL query that would answer the user's question.
VERY IMPORTANT: Return just the generated SQL command, nothing else.
------------
SCHEMA: {schema}
------------
@ -525,7 +526,7 @@ export class ChatServices {
question: (input: { question: string }) => input.question
},
prompt,
model.bind({ stop: ['\nSQLResult:'] }),
model,
new StringOutputParser()
]);