mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 18:11:48 +00:00
fix(gateway): update Google model names in allowed custom chat models (#63109)
Fix: Add missing `/` to provider name for google models in Cody Gateway
allowlist.
I was getting the following error from Cody Gateway:
```
event: error
data: {"error":"Sourcegraph Cody Gateway: unexpected status code 400: {\"error\":\"model \\\"google/\\\" is not allowed, allowed: [google/gemini-1.5-pro-latest, google/gemini-1.5-flash-latest]\"}\n"}
```
Changes:
- prepend "google/" to the Google model names to match the expected
format
<!-- 💡 To write a useful PR description, make sure that your description
covers:
- WHAT this PR is changing:
- How was it PREVIOUSLY.
- How it will be from NOW on.
- WHY this PR is needed.
- CONTEXT, i.e. to which initiative, project or RFC it belongs.
The structure of the description doesn't matter as much as covering
these points, so use
your best judgement based on your context.
Learn how to write good pull request description:
https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e?pvs=4
-->
## Test plan
<!-- All pull requests REQUIRE a test plan:
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->
The issue doesn't affect instances that set `google` as the `provider`,
and their requests should work as expected.
This change only affect Cody Gateway users with the following setting:
```
"completions": {
"provider": "sourcegraph"
"chatModel": "google/gemini-1.5-pro-latest",
"fastChatModel": "google/gemini-1.5-flash-latest",
},
```
## Changelog
<!--
1. Ensure your pull request title is formatted as: $type($domain): $what
2. Add bullet list items for each additional detail you want to cover
(see example below)
3. You can edit this after the pull request was merged, as long as
release shipping it hasn't been promoted to the public.
4. For more information, please see this how-to
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c?
Audience: TS/CSE > Customers > Teammates (in that order).
Cheat sheet: $type = chore|fix|feat $domain:
source|search|ci|release|plg|cody|local|...
-->
<!--
Example:
Title: fix(search): parse quotes with the appropriate context
Changelog section:
## Changelog
- When a quote is used with regexp pattern type, then ...
- Refactored underlying code.
-->
This commit is contained in:
parent
b574300714
commit
cff84a0a99
@ -86,9 +86,9 @@ func isAllowedCustomChatModel(model string, isProUser bool) bool {
|
||||
"openai/gpt-4o",
|
||||
"openai/gpt-4-turbo",
|
||||
"openai/gpt-4-turbo-preview",
|
||||
"google" + google.Gemini15FlashLatest,
|
||||
"google" + google.Gemini15ProLatest,
|
||||
"google" + google.GeminiProLatest,
|
||||
"google/" + google.Gemini15FlashLatest,
|
||||
"google/" + google.Gemini15ProLatest,
|
||||
"google/" + google.GeminiProLatest,
|
||||
|
||||
// Remove after the Claude 3 rollout is complete
|
||||
"anthropic/claude-2",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user