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

feat: add LLM powered text2sql support #1276

Merged
merged 3 commits into from
Jun 23, 2023

Conversation

jczhong84
Copy link
Collaborator

  • For new query generation, it will ask for selecting tables first.
  • For query editing, it will parse the tables from the query.
text2sql.mp4


@register("/ai/generate_query/", custom_response=True)
def generate_sql_query(
query_engine_id: int, tables: list[str], question: str, data_cell_id: int = None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of data cell, use original_query so it is not limited to data doc?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is I realized that for GET http request, it has length limit on the query string. So it may not be safe to pass along the whole query.

Can reconsider the EventSource solution in future and change it back to use POST method. For this specific case, I can move the get query from the data cell into this api endpoint and make ai_assistant to accept the original query.

querybook/webapp/components/AIAssistant/AIModeSelector.tsx Outdated Show resolved Hide resolved
@jczhong84 jczhong84 merged commit 8659fb7 into pinterest:master Jun 23, 2023
@jczhong84 jczhong84 deleted the feat/text2sql branch June 28, 2023 06:34
aidenprice pushed a commit to arrowtail-precision/querybook that referenced this pull request Jan 3, 2024
* feat: add LLM powered text2sql support

* comments

* comments
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.

2 participants