You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/components/db-query/nodes/get-tables.node.ts
+9-4Lines changed: 9 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -32,8 +32,10 @@ export class GetTablesNode implements IGraphNode<DbQueryState> {
32
32
prompt=PromptTemplate.fromTemplate(`
33
33
<instructions>
34
34
You are an AI assistant that extracts table names that are relevant to the users query that will be used to generate an SQL query later.
35
-
- Ensure that table names are exact and match the names in the input including schema if given.
36
-
- Use only and only the tables that are relevant to the query.
35
+
36
+
- Consider not just the user query but also the context and the table descriptions while selecting the tables.
37
+
- Carefully consider each and every table before including or excluding it.
38
+
- If doubtful about a table's relevance, include it anyway to give the SQL generation step more options to choose from.
37
39
- Assume that the table would have appropriate columns for relating them to any other table even if the description does not mention it.
38
40
- If you are not sure about the tables to select from the given schema, just return your doubt asking the user for more details or to rephrase the question in the following format -
39
41
failed attempt: reason for failure
@@ -53,6 +55,7 @@ failed attempt: reason for failure
53
55
54
56
<output-format>
55
57
The output should be just a comma separated list of table names with no other text, comments or formatting.
58
+
Ensure that table names are exact and match the names in the input including schema if given.
56
59
<example-output>
57
60
public.employees, public.departments
58
61
</example-output>
@@ -111,8 +114,10 @@ Use these if they are relevant to the table selection, otherwise ignore them, th
0 commit comments