Skip to content

Commit

Permalink
Merge pull request #761 from Flyfoxs/patch-1
Browse files Browse the repository at this point in the history
Support the input of a large DataFrame when generating follow-up questions
  • Loading branch information
zainhoda authored Feb 8, 2025
2 parents 9388668 + 20b0668 commit 6e01e12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/vanna/base/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def generate_followup_questions(

message_log = [
self.system_message(
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"
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"
),
self.user_message(
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." +
Expand Down

0 comments on commit 6e01e12

Please sign in to comment.