This repository was archived by the owner on Aug 1, 2025. It is now read-only.
Update openai autocomplete provider to use prompt similar to anthropic infill mode#1480
Merged
Conversation
Contributor
|
@chwarwick this is awesome! Going to message you to see how I can set these up to test the new prompt 🙇♀️ |
abeatrix
reviewed
Oct 24, 2023
abeatrix
reviewed
Oct 24, 2023
| }, | ||
| { | ||
| "completions": [ | ||
| " <br>\n if (typeof position === 'number') {<br>\n const line = this.lines[position]<br>\n if (line) {<br>\n return new TextLine(position, line)<br>\n }<br>\n } else {<br>\n const line = this.lines[position.line]<br>\n if (line) {<br>\n return new TextLine(position.line, line)<br>\n }<br>\n }<br>\n return new TextLine(this.lines.length - 1, '')<br>\n }<br>", |
Contributor
There was a problem hiding this comment.
we had a similar issue with one of the prompts we tried that caused the tags to leak, so we might need to update the prompt again later. The rest of the tests looks good tho!
Co-authored-by: Beatrix <68532117+abeatrix@users.noreply.github.com>
burmudar
pushed a commit
that referenced
this pull request
Nov 21, 2024
…ch don't support inlay models. (#1490) ImaginaryEditor does not support InlayModel and throws an UnsupportedOperationException; IntentionPreviewEditor throws an IntentionPreviewUnsupportedOperationException: UnsupportedOperationException, etc. Fixes #1488, #1486, #1485, #1480, #1466, #1462, #1435, #1363 ## Test plan ``` ./gradlew test --tests InlayModelUtilTest ``` Ran the IDE and clicked between editors, requesting autocompletes.
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously the unstable-openai provider was based on the original anthropic prompt, this updates it to be similar to the newer anthropic infill mode and accompanying context improvements.
part of https://github.com/sourcegraph/sourcegraph/issues/57724
Test plan
Ran completions tooling & benchmarks against Azure OpenAI (GPT 3.5-Turbo) and OpenAI (GPT-3.5-instruct)
Verified chat & autocomplete works with OpenAI and Azure OpenAI