Skip to content

Commit

Permalink
Bump cody commit and fix enterprise model selection
Browse files Browse the repository at this point in the history
  • Loading branch information
pkukielka committed Aug 6, 2024
1 parent 8c50dfd commit 3596dfb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ kotlin.stdlib.default.dependency=false
nodeBinaries.commit=8755ae4c05fd476cd23f2972049111ba436c86d4
nodeBinaries.version=v20.12.2
cody.autocomplete.enableFormatting=true
cody.commit=066d9c6ff48beb96a834f17021affc4e62094415
cody.commit=35035303eacf7a5a570b40ecddeb590b56a7fb40
14 changes: 6 additions & 8 deletions src/main/kotlin/com/sourcegraph/cody/chat/ui/LlmDropdown.kt
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,14 @@ class LlmDropdown(
val availableModels = models.filterNot { it.isDeprecated() }
availableModels.sortedBy { it.isCodyProOnly() }.forEach(::addItem)

val selectedFromState = chatModelProviderFromState
val selectedFromChatState = chatModelProviderFromState
val selectedFromHistory = HistoryService.getInstance(project).getDefaultLlm()
val selectedModel =
availableModels.find { it.model == selectedFromState?.model || it.model == model }
?: availableModels.find { it.model == selectedFromHistory?.model }

selectedItem =
if (selectedModel?.isCodyProOnly() == true && isCurrentUserFree())
availableModels.getOrNull(0)
else selectedModel
availableModels.find {
it.model == model ||
it.model == selectedFromChatState?.model ||
it.model == selectedFromHistory?.model
} ?: availableModels.getOrNull(0)

val isEnterpriseAccount =
CodyAuthenticationManager.getInstance(project).account?.isEnterpriseAccount() ?: false
Expand Down

0 comments on commit 3596dfb

Please sign in to comment.