Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Azure OpenAI - experimental autocomplete support #56063

Merged
chwarwick merged 7 commits into
mainfrom
cw/azure-autocomplete
Aug 31, 2023
Merged

Azure OpenAI - experimental autocomplete support #56063
chwarwick merged 7 commits into
mainfrom
cw/azure-autocomplete

Conversation

@chwarwick

@chwarwick chwarwick commented Aug 21, 2023

Copy link
Copy Markdown
Contributor

Adds autocomplete support for Azure OpenAI using the same mechanism that is used by the fireworks provider. It assumes the prompt is the one and only message.

Test plan

Tested against https://github.com/sourcegraph/cody/pull/875
Configure VS Code extension to use unstable-openai
Configured local instance to use azure-openai with gpt turbo 3.5 for completions
Ensure autocomplete & chat continue to work

@cla-bot cla-bot Bot added the cla-signed label Aug 21, 2023
@chwarwick chwarwick requested review from a team and eseliger August 21, 2023 16:00
eseliger
eseliger previously approved these changes Aug 21, 2023

@eseliger eseliger left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nice! would be cool to see that be backported to OAI at some point as well :)

Comment thread internal/completions/client/azureopenai/openai.go Outdated
Comment thread internal/completions/client/azureopenai/openai.go
Comment thread internal/completions/client/azureopenai/openai.go
Comment thread internal/completions/client/azureopenai/openai.go Outdated
@chwarwick chwarwick marked this pull request as draft August 23, 2023 15:37
@chwarwick chwarwick requested a review from eseliger August 31, 2023 16:18
@chwarwick chwarwick marked this pull request as ready for review August 31, 2023 16:18
@chwarwick chwarwick linked an issue Aug 31, 2023 that may be closed by this pull request
@chwarwick

Copy link
Copy Markdown
Contributor Author

Thanks @eseliger once we prove this out for Azure I'll bring the changes across for OAI + gateway.

@chwarwick chwarwick merged commit 888be7b into main Aug 31, 2023
@chwarwick chwarwick deleted the cw/azure-autocomplete branch August 31, 2023 20:44
@github-actions

Copy link
Copy Markdown
Contributor

The backport to 5.1 failed:

Validation Failed: "Could not resolve to a node with the global id of 'T_kwDOADy5QM4AWdx9'."

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-5.1 5.1
# Navigate to the new working tree
cd .worktrees/backport-5.1
# Create a new branch
git switch --create backport-56063-to-5.1
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 888be7bacdde329f653ae7c592826602466e4279
# Push it to GitHub
git push --set-upstream origin backport-56063-to-5.1
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-5.1

Then, create a pull request where the base branch is 5.1 and the compare/head branch is backport-56063-to-5.1.
See https://github.com/sourcegraph/sourcegraph/actions/runs/6042277246/jobs/14798 for more information.
Make sure to tag @sourcegraph/release-guild in the pull request description.
Once the backport pull request is created, kindly remove the release-blocker from this pull request.

@github-actions github-actions Bot added the release-blocker Prevents us from releasing: https://about.sourcegraph.com/handbook/engineering/releases label Aug 31, 2023
github-actions Bot pushed a commit that referenced this pull request Aug 31, 2023
* spike: Make completions work with Azure

* remove response printing

* lint fixes

* Update internal/completions/client/azureopenai/openai.go

Co-authored-by: Erik Seliger <erikseliger@me.com>

* update azure autocomplete to look for prompt in first message

* clean up some comments

---------

Co-authored-by: Erik Seliger <erikseliger@me.com>
(cherry picked from commit 888be7b)
chwarwick referenced this pull request in sourcegraph/cody-public-snapshot Aug 31, 2023
Adds a new openai provider that routes requests though the sourcegraph
instance. Currently this reuses the prompt logic from the
unstabl-azure-openai provider. This should enable working though the sg
backend and then any prompt updates can be handled separately.

## Test plan
ran locally with https://github.com/sourcegraph/sourcegraph/pull/56063
<!-- Required. See
https://docs.sourcegraph.com/dev/background-information/testing_principles.
-->
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

backports cla-signed release-blocker Prevents us from releasing: https://about.sourcegraph.com/handbook/engineering/releases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Azure OpenAI on the back-end

3 participants