diff --git a/cmd/cody-gateway/shared/config/config.go b/cmd/cody-gateway/shared/config/config.go index 544252370a7..08ea5614970 100644 --- a/cmd/cody-gateway/shared/config/config.go +++ b/cmd/cody-gateway/shared/config/config.go @@ -311,6 +311,8 @@ func (c *Config) Load() { google.Gemini15FlashLatest, google.Gemini15ProLatest, google.GeminiProLatest, + google.Gemini15Flash001, + google.Gemini15Pro001, google.Gemini15Flash, google.Gemini15Pro, google.GeminiPro, diff --git a/cmd/frontend/internal/dotcom/productsubscription/codygateway_dotcom_user.go b/cmd/frontend/internal/dotcom/productsubscription/codygateway_dotcom_user.go index daf356b3b1c..bfa9f41196a 100644 --- a/cmd/frontend/internal/dotcom/productsubscription/codygateway_dotcom_user.go +++ b/cmd/frontend/internal/dotcom/productsubscription/codygateway_dotcom_user.go @@ -335,6 +335,7 @@ var allCodeCompletionModels = slices.Concat([]string{"anthropic/" + anthropic.Cl "anthropic/claude-instant-1.2", "google/" + google.Gemini15Flash, "google/" + google.Gemini15FlashLatest, + "google/" + google.Gemini15Flash001, "google/" + google.GeminiPro, "google/" + google.GeminiProLatest, "fireworks/starcoder", @@ -377,6 +378,8 @@ func allowedModels(scope types.CompletionsFeature, isProUser bool) []string { "google/" + google.Gemini15FlashLatest, "google/" + google.Gemini15ProLatest, "google/" + google.GeminiProLatest, + "google/" + google.Gemini15Flash001, + "google/" + google.Gemini15Pro001, "google/" + google.Gemini15Flash, "google/" + google.Gemini15Pro, "google/" + google.GeminiPro, diff --git a/cmd/frontend/internal/httpapi/completions/get_model.go b/cmd/frontend/internal/httpapi/completions/get_model.go index 5fa94eb51b0..259637894cd 100644 --- a/cmd/frontend/internal/httpapi/completions/get_model.go +++ b/cmd/frontend/internal/httpapi/completions/get_model.go @@ -100,6 +100,7 @@ func isAllowedCodeCompletionModel(model string) bool { "anthropic/claude-instant-1.2-cyan", "google/" + google.Gemini15Flash, "google/" + google.Gemini15FlashLatest, + "google/" + google.Gemini15Flash001, "google/" + google.GeminiPro, "google/" + google.GeminiProLatest, "fireworks/accounts/sourcegraph/models/starcoder-7b", @@ -132,6 +133,8 @@ func isAllowedCustomChatModel(model string, isProUser bool) bool { "google/" + google.Gemini15FlashLatest, "google/" + google.Gemini15ProLatest, "google/" + google.GeminiProLatest, + "google/" + google.Gemini15Flash001, + "google/" + google.Gemini15Pro001, "google/" + google.Gemini15Flash, "google/" + google.Gemini15Pro, "google/" + google.GeminiPro, diff --git a/internal/completions/client/google/models.go b/internal/completions/client/google/models.go index e1ab40c9a51..d3a474511be 100644 --- a/internal/completions/client/google/models.go +++ b/internal/completions/client/google/models.go @@ -19,3 +19,9 @@ const GeminiPro = "gemini-pro" const Gemini15FlashLatest = "gemini-1.5-flash-latest" const Gemini15ProLatest = "gemini-1.5-pro-latest" const GeminiProLatest = "gemini-pro-latest" + +// Fixed stable versions +// NOTE: Only the fixed stable versions support context caching. +// Ref: https://ai.google.dev/gemini-api/docs/caching?lang=node +const Gemini15Flash001 = "gemini-1.5-flash-001" +const Gemini15Pro001 = "gemini-1.5-pro-001"