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 sql completions powered by LLM #1514

Merged
merged 4 commits into from
Nov 15, 2024

Conversation

jczhong84
Copy link
Collaborator

@jczhong84 jczhong84 commented Nov 14, 2024

Adding another AI assistant feature, SQL Complete, to help query authoring like the Github Copilot

Currently we're using this codemirror extension, we can reimplement it to meet our additional requrements in the future if needed.

The prompt and context still needs to be tuned for better quality.

Snip20241114_2

By default it is disabled, user can enable it in the user settings.
image

Comment on lines 7 to 12
/**
* Remove overlapping part with prefix from completion.
*
* e.g. removeOverlapPrefix('sel', 'elect *') => 'ect *'
*/
const removeOverlapPrefix = (completion: string, prefix: string) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

just curious why is this needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is a hack workaround. found sometimes it will have overlap with the prefix. I'll add some comments there.

Copy link
Contributor

@zhangvi7 zhangvi7 left a comment

Choose a reason for hiding this comment

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

Looks good! Does the code mirror support showing multi line suggestions back to user?

@jczhong84
Copy link
Collaborator Author

Looks good! Does the code mirror support showing multi line suggestions back to user?

yes, it supports multiple lines.
image

@jczhong84 jczhong84 merged commit 94d4702 into pinterest:master Nov 15, 2024
4 checks passed
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.

3 participants