Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return sql and dataframe if call is successful #208

Merged
merged 2 commits into from
Jan 31, 2024
Merged

Return sql and dataframe if call is successful #208

merged 2 commits into from
Jan 31, 2024

Conversation

danielcorin
Copy link
Contributor

The setup is a bit complicated to describe in full. In summary, I loaded the Chinook dataset into my database, then followed the guide for getting setup with OpenAI and Postgres quite closely.

Before the code change

vn.ask(question="which employee has the most customers?")
None

After

vn.ask(question="which employee has the most customers?")
('SELECT support_rep_id, COUNT(customer_id) AS customer_count\nFROM customer\nGROUP BY support_rep_id\nORDER BY customer_count DESC\nLIMIT 1;',
    support_rep_id  customer_count
 0               3              21,
 None)

@danielcorin
Copy link
Contributor Author

@zainhoda zainhoda merged commit 8c5e05a into vanna-ai:main Jan 31, 2024
1 check passed
@danielcorin danielcorin deleted the dc/return-results branch January 31, 2024 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants