Skip to content

Commit 750de80

Browse files
thisisnicgadenbuie
andauthored
Update prompt to account for when can't query data (#177)
Co-authored-by: Garrick Aden-Buie <[email protected]>
1 parent 091c0e2 commit 750de80

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

pkg-py/src/querychat/prompts/prompt.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ Response: "The average revenue is $X."
7878

7979
This simple response is sufficient, as the user can see the SQL query used.
8080

81+
{{/has_tool_query}}
82+
{{^has_tool_query}}
83+
### Questions About Data
84+
85+
You cannot query or analyze the data. If users ask questions about data values, statistics, or calculations (e.g., "What is the average ____?" or "How many ____ are there?"), explain that you're not able to run queries on this data. Do not attempt to answer based on your own knowledge or assumptions about the data, even if the dataset seems familiar.
86+
8187
{{/has_tool_query}}
8288
### Providing Suggestions for Next Steps
8389

@@ -140,7 +146,7 @@ You might want to <span class="suggestion">explore the advanced features</span>
140146

141147
- **Ask for clarification** if any request is unclear or ambiguous
142148
- **Be concise** due to the constrained interface
143-
- **Never pretend** you have access to data you don't actually have
149+
- **Only answer data questions using your tools** - never use prior knowledge or assumptions about the data, even if the dataset seems familiar
144150
- **Use Markdown tables** for any tabular or structured data in your responses
145151

146152
{{#extra_instructions}}

pkg-r/inst/prompts/prompt.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ Response: "The average revenue is $X."
7878

7979
This simple response is sufficient, as the user can see the SQL query used.
8080

81+
{{/has_tool_query}}
82+
{{^has_tool_query}}
83+
### Questions About Data
84+
85+
You cannot query or analyze the data. If users ask questions about data values, statistics, or calculations (e.g., "What is the average ____?" or "How many ____ are there?"), explain that you're not able to run queries on this data. Do not attempt to answer based on your own knowledge or assumptions about the data, even if the dataset seems familiar.
86+
8187
{{/has_tool_query}}
8288
### Providing Suggestions for Next Steps
8389

@@ -140,7 +146,7 @@ You might want to <span class="suggestion">explore the advanced features</span>
140146

141147
- **Ask for clarification** if any request is unclear or ambiguous
142148
- **Be concise** due to the constrained interface
143-
- **Never pretend** you have access to data you don't actually have
149+
- **Only answer data questions using your tools** - never use prior knowledge or assumptions about the data, even if the dataset seems familiar
144150
- **Use Markdown tables** for any tabular or structured data in your responses
145151

146152
{{#extra_instructions}}

0 commit comments

Comments
 (0)