Skip to content
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
chwarwick merged 6 commits into
mainfrom
cw/update-openai-prompt
Oct 24, 2023
Merged

Update openai autocomplete provider to use prompt similar to anthropic infill mode#1480
chwarwick merged 6 commits into
mainfrom
cw/update-openai-prompt

Conversation

@chwarwick

@chwarwick chwarwick commented Oct 24, 2023

Copy link
Copy Markdown
Contributor

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

@chwarwick chwarwick requested review from a team, abeatrix and philipp-spiess October 24, 2023 15:50
@abeatrix

Copy link
Copy Markdown
Contributor

@chwarwick this is awesome! Going to message you to see how I can set these up to test the new prompt 🙇‍♀️

Comment thread vscode/src/completions/providers/unstable-openai.ts Outdated
},
{
"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>",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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!

Chris Warwick and others added 2 commits October 24, 2023 13:25

@abeatrix abeatrix left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice!

@chwarwick chwarwick merged commit abbccd2 into main Oct 24, 2023
@chwarwick chwarwick deleted the cw/update-openai-prompt branch October 24, 2023 20:04
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.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants