new(whatsapp.gblib): LLM SQL.
This commit is contained in:
parent
9d82774544
commit
fa6fe752cc
1 changed files with 3 additions and 2 deletions
|
@ -506,7 +506,8 @@ export class ChatServices {
|
||||||
|
|
||||||
const prompt =
|
const prompt =
|
||||||
PromptTemplate.fromTemplate(`Based on the provided SQL table schema below, write a SQL query that would answer the user's question.
|
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}
|
SCHEMA: {schema}
|
||||||
------------
|
------------
|
||||||
QUESTION: {question}
|
QUESTION: {question}
|
||||||
|
@ -525,7 +526,7 @@ export class ChatServices {
|
||||||
question: (input: { question: string }) => input.question
|
question: (input: { question: string }) => input.question
|
||||||
},
|
},
|
||||||
prompt,
|
prompt,
|
||||||
model.bind({ stop: ['\nSQLResult:'] }),
|
model,
|
||||||
new StringOutputParser()
|
new StringOutputParser()
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue