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

custom command: update get context for current file #683

Merged
merged 2 commits into from
Aug 15, 2023

Conversation

abeatrix
Copy link
Contributor

@abeatrix abeatrix commented Aug 15, 2023

Currently, we are using getContextMessagesFromSelection to generate context message for the current file, which is incorrect as that includes context from other files as well.

This PR adds getCurrentFileContextFromEditorSelection that generates context message for the current file using the current editor selection / visible content to replace getContextMessagesFromSelection, which generate context message using embeddings search result returned from the selection.

Test plan

Run the /explain or /smell command that uses the current file as context. You should only see that it reads 1 file.

After

image Screenshot 2023-08-14 at 9 13 08 PM

Before

image

@abeatrix abeatrix changed the title custom command: add get context for current file custom command: update get context for current file Aug 15, 2023
@abeatrix abeatrix requested a review from a team August 15, 2023 04:14
Copy link
Contributor

@taras-yemets taras-yemets left a comment

Choose a reason for hiding this comment

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

Approving to unblock 🚢

@abeatrix abeatrix merged commit 7c05943 into main Aug 15, 2023
9 checks passed
@abeatrix abeatrix deleted the bee/current-file-context branch August 15, 2023 14:40
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