-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Edit: Improve response consistency (#1892)
closes #1790 ## Description This PR improves edit consistency by: - "Putting words into the LLM's mouth". As we're using Claude we can start the transcript with the expected tag so we're more likely to get a valid output. - For "Add" intents, we also include the preceding code as part of the injected transcript - Using non-HTML related XML tags. Using XML tags to declare different parts of the prompt does show strong improvements (I tried removing them all apart from the main one), but the problem I think is that the LLM can become confused as to if this is HTML code - especially when making JS/TS edits. We now add numbers to the tags, which would be invalid for a HTML tag. This seems to help steer the response a lot. - Various small prompt tweaks ## Test plan Create fixups: - Edits from selection - Adding code from no selection - Fixing error diagnostics - Doc command. Code action commands to document symbols <!-- Required. See https://docs.sourcegraph.com/dev/background-information/testing_principles. -->
- Loading branch information
Showing
10 changed files
with
170 additions
and
148 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
Oops, something went wrong.