-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement edit/insert prompts (#5958)
closes: https://linear.app/sourcegraph/issue/SRCH-1172/prompts-can-output-into-3-places This PR integrates with the prompt mode (chat | edit | insert) from the SG API. Prompts with edit or insert mode are executed using the `executeEdit`, the same way the commands are executed. The prompt is used as the instruction text for `executeEdit`. First the chat transcript is created, context is fetched and then the `executeEdit` is called. The `FixupTask` from the execution is used to construct the response in chat. The response for now shows the diff only. In BG, the state for interactions mode is saved as intent. The dropdown and icon indicator for to allow users to manually change the mode and to see which mode is set, is only available behind the OneBox feature flag and will not be released yet. ![CleanShot 2024-10-21 at 18 28 08@2x](https://github.com/user-attachments/assets/5cb3e6b1-b53a-41b8-824b-a74f35d1a4b9) ## Test plan - create a edit/insert prompt - execute it from Cody - it should work as expected. ## Changelog - Add ability to execute prompts to perform edits or insert code.
- Loading branch information
1 parent
fdcc8a1
commit 07a44d3
Showing
15 changed files
with
316 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -354,6 +354,7 @@ query ViewerPrompts($query: String!) { | |
description | ||
draft | ||
autoSubmit | ||
mode | ||
definition { | ||
text | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.