Skip to content

Commit 6e01e12

Browse files
authored
Merge pull request #761 from Flyfoxs/patch-1
Support the input of a large DataFrame when generating follow-up questions
2 parents 9388668 + 20b0668 commit 6e01e12

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/vanna/base/base.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ def generate_followup_questions(
306306

307307
message_log = [
308308
self.system_message(
309-
f"You are a helpful data assistant. The user asked the question: '{question}'\n\nThe SQL query for this question was: {sql}\n\nThe following is a pandas DataFrame with the results of the query: \n{df.to_markdown()}\n\n"
309+
f"You are a helpful data assistant. The user asked the question: '{question}'\n\nThe SQL query for this question was: {sql}\n\nThe following is a pandas DataFrame with the results of the query: \n{df.head(25).to_markdown()}\n\n"
310310
),
311311
self.user_message(
312312
f"Generate a list of {n_questions} followup questions that the user might ask about this data. Respond with a list of questions, one per line. Do not answer with any explanations -- just the questions. Remember that there should be an unambiguous SQL query that can be generated from the question. Prefer questions that are answerable outside of the context of this conversation. Prefer questions that are slight modifications of the SQL query that was generated that allow digging deeper into the data. Each question will be turned into a button that the user can click to generate a new SQL query so don't use 'example' type questions. Each question must have a one-to-one correspondence with an instantiated SQL query." +

0 commit comments

Comments
 (0)