Claude 3 support and /messages API for Enterprise#60953
Conversation
|
@sourcegraph/wg-cody-gateway-eng pinging you for some early feedback. There's quite a few branches so one open question is if we want to support customers that hard-set the upstream anthropic API to be the old The rest of this PR is a version to map the existing completion APIs to the new |
|
@chwarwick / @thenamankumar The only open question to conclude this is how do we feature test on the client wether the new API style is supported on the backend? Should we expose this as a flag somewhere or rely on version numbers? I do want to test this on PLG as well before we release it for enterprises. The idea is that chat messages on PLG all go through the dotcom instance again. This should give us some confidence that it works well. WDYT? |
Making sure I'm remembering the issue correctly. The open question is that client side needs to prepare the prompt messages differently because:
|
|
@chwarwick Exactly the |
|
Quick summary of the next steps to land this PR:
Does that seem reasonable? |
I think it's ok to remove as long as we add a reasonable error will end up displaying in the clients. |
…rcegraph/sourcegraph into ps/anthropic-messages-for-enterprise
There was a problem hiding this comment.
Tested against existing models claude-2 and instant-1.2 against anthropic directly & gateway all looked good. Also tried claude-3 direct to Anthropic and was successful for autocomplete, chat, commands. Did leave 2 minor edits on https://github.com/sourcegraph/sourcegraph/pull/61336
Closes #61166
This PR adds support for Claude 3 and the
/messagesAPI to the existinganthropicprovider in the Sourcegraph instance.To ensure a smooth experience, there are a couple of edge cases that we need to handle.
/complete. We need to error properly in this case./messagesformat. We introduce cody API versioning for this case./completestyle prompt (with trailingassistant, "holes" of no response, system prompt in messages) when a legacy client connectsTest plan
BOYLLM
With legacy request
streaming ✅
non-streaming ✅
code-completions ✅
With V1 request
streaming ✅
non-streaming ✅
code-completions ✅
With hard-configured /complete API ✅
Cody Gateway
With legacy request
streaming ✅
non-streaming ✅
code-completions ✅
With V1 request
streaming ✅
non-streaming ✅
code-completions ✅
I also did an E2E test with Cody VS Code. Chat works and so do code completions. The prompt could use some tweaking (which we will do on the client) but at least it doesn't seem like a regression so far 👍