mirror of
https://github.com/carlrobertoh/ProxyAI.git
synced 2026-05-18 14:49:24 +00:00
refactor: change proxai default autocomplete model
This commit is contained in:
parent
c177f32606
commit
ac4200bd0c
6 changed files with 17 additions and 32 deletions
|
|
@ -51,8 +51,6 @@ class FileWatcher : Disposable {
|
|||
Thread.currentThread().interrupt()
|
||||
} catch (e: Exception) {
|
||||
logger.error("Error in file watcher for path: $pathString", e)
|
||||
} finally {
|
||||
logger.error("File watch monitor thread stopped for path: $pathString")
|
||||
}
|
||||
}
|
||||
fileMonitors.add(monitor)
|
||||
|
|
|
|||
|
|
@ -141,8 +141,8 @@ class ModelRegistry {
|
|||
),
|
||||
FeatureType.CODE_COMPLETION to ModelSelection(
|
||||
ServiceType.PROXYAI,
|
||||
QWEN_2_5_32B_CODE,
|
||||
"Qwen 2.5 32B Code"
|
||||
MERCURY_CODER,
|
||||
"Mercury Coder"
|
||||
),
|
||||
FeatureType.NEXT_EDIT to ModelSelection(
|
||||
ServiceType.PROXYAI,
|
||||
|
|
@ -170,8 +170,8 @@ class ModelRegistry {
|
|||
FeatureType.LOOKUP to ModelSelection(ServiceType.PROXYAI, QWEN3_CODER, "Qwen3 Coder"),
|
||||
FeatureType.CODE_COMPLETION to ModelSelection(
|
||||
ServiceType.PROXYAI,
|
||||
QWEN_2_5_32B_CODE,
|
||||
"Qwen 2.5 32B Code"
|
||||
MERCURY_CODER,
|
||||
"Mercury Coder"
|
||||
),
|
||||
FeatureType.NEXT_EDIT to ModelSelection(
|
||||
ServiceType.PROXYAI,
|
||||
|
|
@ -199,8 +199,8 @@ class ModelRegistry {
|
|||
FeatureType.LOOKUP to ModelSelection(ServiceType.PROXYAI, GPT_5, "GPT-5"),
|
||||
FeatureType.CODE_COMPLETION to ModelSelection(
|
||||
ServiceType.PROXYAI,
|
||||
QWEN_2_5_32B_CODE,
|
||||
"Qwen 2.5 32B Code"
|
||||
MERCURY_CODER,
|
||||
"Mercury Coder"
|
||||
),
|
||||
FeatureType.NEXT_EDIT to ModelSelection(
|
||||
ServiceType.PROXYAI,
|
||||
|
|
@ -234,8 +234,8 @@ class ModelRegistry {
|
|||
FeatureType.LOOKUP to ModelSelection(ServiceType.PROXYAI, GPT_5_MINI, "GPT-5 Mini"),
|
||||
FeatureType.CODE_COMPLETION to ModelSelection(
|
||||
ServiceType.PROXYAI,
|
||||
QWEN_2_5_32B_CODE,
|
||||
"Qwen 2.5 32B Code"
|
||||
MERCURY_CODER,
|
||||
"Mercury Coder"
|
||||
),
|
||||
FeatureType.NEXT_EDIT to ModelSelection(ServiceType.PROXYAI, MERCURY_CODER, "Mercury Coder")
|
||||
)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import com.intellij.openapi.application.ApplicationManager
|
|||
import com.intellij.openapi.components.*
|
||||
import ee.carlrobert.codegpt.settings.service.FeatureType
|
||||
import ee.carlrobert.codegpt.settings.service.ModelChangeNotifier
|
||||
import ee.carlrobert.codegpt.settings.service.ModelSelectionService
|
||||
import ee.carlrobert.codegpt.settings.service.ServiceType
|
||||
import ee.carlrobert.codegpt.settings.service.ServiceType.PROXYAI
|
||||
import ee.carlrobert.codegpt.settings.service.custom.CustomServicesSettings
|
||||
|
|
@ -63,8 +62,7 @@ class ModelSettings : SimplePersistentStateComponent<ModelSettingsState>(ModelSe
|
|||
migrateCustomOpenAIModelCodesToIds()
|
||||
migrateMissingProviderInformation()
|
||||
migrateEditCodeModel()
|
||||
migrateProxyAIApplyModel()
|
||||
migrateProxyAIAutocompleteAndNextEditModels()
|
||||
migrateProxyAIModels()
|
||||
notifyIfChanged(oldState, this.state)
|
||||
}
|
||||
|
||||
|
|
@ -148,21 +146,10 @@ class ModelSettings : SimplePersistentStateComponent<ModelSettingsState>(ModelSe
|
|||
}
|
||||
}
|
||||
|
||||
private fun migrateProxyAIApplyModel() {
|
||||
val modelSelection =
|
||||
service<ModelSelectionService>().getModelSelectionForFeature(FeatureType.AUTO_APPLY)
|
||||
if (modelSelection.provider == PROXYAI
|
||||
&& service<ModelRegistry>().getProxyAIApplyModels().none { it == modelSelection }
|
||||
) {
|
||||
setModelWithProvider(FeatureType.AUTO_APPLY, ModelRegistry.MERCURY_CODER, PROXYAI)
|
||||
}
|
||||
}
|
||||
|
||||
private fun migrateProxyAIAutocompleteAndNextEditModels() {
|
||||
val modelService = service<ModelSelectionService>()
|
||||
listOf(FeatureType.CODE_COMPLETION, FeatureType.NEXT_EDIT).forEach {
|
||||
val modelSelection = modelService.getModelSelectionForFeature(it)
|
||||
if (modelSelection.provider == PROXYAI && modelSelection.model != ModelRegistry.MERCURY_CODER) {
|
||||
private fun migrateProxyAIModels() {
|
||||
listOf(FeatureType.AUTO_APPLY, FeatureType.CODE_COMPLETION, FeatureType.NEXT_EDIT).forEach {
|
||||
val modelSelection = state.getModelSelection(it)
|
||||
if (modelSelection?.provider == PROXYAI && modelSelection.model != ModelRegistry.MERCURY_CODER) {
|
||||
setModelWithProvider(it, ModelRegistry.MERCURY_CODER, PROXYAI)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,5 +23,5 @@ class CodeGPTServiceChatCompletionSettingsState : BaseState() {
|
|||
|
||||
class CodeGPTServiceCodeCompletionSettingsState : BaseState() {
|
||||
var codeCompletionsEnabled by property(true)
|
||||
var model by string(ModelRegistry.QWEN_2_5_32B_CODE)
|
||||
var model by string(ModelRegistry.MERCURY_CODER)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,8 +51,8 @@ class ModelRegistryTest : IntegrationTest() {
|
|||
val result = modelRegistry.getDefaultModelForFeature(FeatureType.CODE_COMPLETION, PricingPlan.INDIVIDUAL)
|
||||
|
||||
assertThat(result.provider).isEqualTo(ServiceType.PROXYAI)
|
||||
assertThat(result.model).isEqualTo("qwen-2.5-32b-code")
|
||||
assertThat(result.displayName).isEqualTo("Qwen 2.5 32B Code")
|
||||
assertThat(result.model).isEqualTo("mercury-coder")
|
||||
assertThat(result.displayName).isEqualTo("Mercury Coder")
|
||||
}
|
||||
|
||||
fun `test getDefaultModelForFeature with next edit returns zeta model`() {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ interface ShortcutsTestMixin {
|
|||
setCredential(CodeGptApiKey, "TEST_API_KEY")
|
||||
val modelSettings = service<ModelSettings>()
|
||||
modelSettings.setModel(FeatureType.CHAT, "gpt-5-mini", ServiceType.PROXYAI)
|
||||
modelSettings.setModel(FeatureType.CODE_COMPLETION, "qwen-2.5-32b-code", ServiceType.PROXYAI)
|
||||
modelSettings.setModel(FeatureType.CODE_COMPLETION, "mercury-coder", ServiceType.PROXYAI)
|
||||
service<CodeGPTServiceSettings>().state.run {
|
||||
codeCompletionSettings.codeCompletionsEnabled = true
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue