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

Commit cff84a0

Browse files
authored
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. -->
1 parent b574300 commit cff84a0

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • cmd/frontend/internal/httpapi/completions

cmd/frontend/internal/httpapi/completions/chat.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ func isAllowedCustomChatModel(model string, isProUser bool) bool {
8686
"openai/gpt-4o",
8787
"openai/gpt-4-turbo",
8888
"openai/gpt-4-turbo-preview",
89-
"google" + google.Gemini15FlashLatest,
90-
"google" + google.Gemini15ProLatest,
91-
"google" + google.GeminiProLatest,
89+
"google/" + google.Gemini15FlashLatest,
90+
"google/" + google.Gemini15ProLatest,
91+
"google/" + google.GeminiProLatest,
9292

9393
// Remove after the Claude 3 rollout is complete
9494
"anthropic/claude-2",

0 commit comments

Comments
 (0)