Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions desktop-shared/src/main/resources/i18n/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,7 @@ settings.model.select.title=Select Model
settings.model.current=Current Model
settings.model.selected=Selected Model
settings.model.new=New Model
settings.model.use.default=Use default
settings.model.change.description=Choose a model from the list below:
settings.model.search=Search Models
settings.model.search.placeholder=Type to filter models...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,7 @@ settings.model.select.title=Modell auswählen
settings.model.current=Aktuelles Modell
settings.model.selected=Ausgewähltes Modell
settings.model.new=Neues Modell
settings.model.use.default=Standard verwenden
settings.model.change.description=Wählen Sie ein Modell aus der folgenden Liste aus:
settings.model.search=Modelle durchsuchen
settings.model.search.placeholder=Eingeben, um Modelle zu filtern...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,7 @@ settings.model.select.title=Seleccionar modelo
settings.model.current=Modelo actual
settings.model.selected=Modelo seleccionado
settings.model.new=Nuevo modelo
settings.model.use.default=Usar predeterminado
settings.model.change.description=Elige un modelo de la lista a continuación:
settings.model.search=Buscar modelos
settings.model.search.placeholder=Escribe para filtrar modelos...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,7 @@ settings.model.select.title=Sélection du modèle
settings.model.current=Modèle actuel
settings.model.selected=Modèle sélectionné
settings.model.new=Nouveau modèle
settings.model.use.default=Utiliser par défaut
settings.model.change.description=Choisissez un modèle dans la liste ci-dessous :
settings.model.search=Rechercher un modèle
settings.model.search.placeholder=Filtrer les modèles...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,7 @@ settings.model.select.title=モデルを選択
settings.model.current=現在のモデル
settings.model.selected=選択されたモデル
settings.model.new=新しいモデル
settings.model.use.default=デフォルトを使用
settings.model.change.description=以下のリストからモデルを選択してください:
settings.model.search=モデル検索
settings.model.search.placeholder=モデルの絞り込み...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,7 @@ settings.model.select.title=모델 선택
settings.model.current=현재 모델
settings.model.selected=선택된 모델
settings.model.new=새 모델
settings.model.use.default=기본값 사용
settings.model.change.description=아래 목록에서 모델을 선택하세요:
settings.model.search=모델 검색
settings.model.search.placeholder=모델 필터링 입력...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,7 @@ settings.model.select.title=Selecionar Modelo
settings.model.current=Modelo Atual
settings.model.selected=Modelo Selecionado
settings.model.new=Novo modelo
settings.model.use.default=Usar padrão
settings.model.change.description=Escolha um modelo na lista abaixo:
settings.model.search=Buscar Modelos
settings.model.search.placeholder=Digite para filtrar modelos...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,7 @@ settings.model.select.title=Chọn mô hình
settings.model.current=Mô hình hiện tại
settings.model.selected=Mô hình đã chọn
settings.model.new=Mô hình mới
settings.model.use.default=Sử dụng mặc định
settings.model.change.description=Chọn một mô hình từ danh sách dưới đây:
settings.model.search=Tìm mô hình
settings.model.search.placeholder=Nhập để lọc mô hình...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,7 @@ settings.model.select.title=选择模型
settings.model.current=当前模型
settings.model.selected=已选模型
settings.model.new=新模型
settings.model.use.default=使用默认值
settings.model.change.description=从下面的列表中选择一个模型:
settings.model.search=搜索模型
settings.model.search.placeholder=输入以筛选模型...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,7 @@ settings.model.select.title=選擇模型
settings.model.current=目前模型
settings.model.selected=已選取模型
settings.model.new=新模型
settings.model.use.default=使用預設值
settings.model.change.description=從下方列表中選擇一個模型:
settings.model.search=搜尋模型
settings.model.search.placeholder=輸入以篩選模型...
Expand Down
5 changes: 3 additions & 2 deletions desktop/src/main/kotlin/io/askimo/desktop/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1461,8 +1461,9 @@ fun app(frameWindowScope: FrameWindowScope? = null, windowState: WindowState? =
)
}

if (settingsViewModel.showProviderWizard) {
providerWizardDialog(viewModel = settingsViewModel)
val wizard = settingsViewModel.wizardViewModel
if (wizard != null) {
providerWizardDialog(viewModel = wizard)
}

// About Dialog
Expand Down
4 changes: 2 additions & 2 deletions desktop/src/main/kotlin/io/askimo/desktop/di/DesktopModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import io.askimo.core.providers.ProviderInstanceService
import io.askimo.core.tools.ToolProviderImpl
import io.askimo.desktop.project.ProjectViewModel
import io.askimo.desktop.project.ProjectsViewModel
import io.askimo.desktop.settings.SettingsViewModel
import io.askimo.desktop.settings.AIProviderViewModel
import io.askimo.ui.chat.ProjectIndexStateManager
import io.askimo.ui.common.monitoring.SystemResourceMonitor
import io.askimo.ui.discover.DiscoverViewModel
Expand Down Expand Up @@ -126,7 +126,7 @@ val desktopModule = module {
}

factory { (scope: CoroutineScope) ->
SettingsViewModel(scope = scope, appContext = get<AppContext>(), providerInstanceService = get<ProviderInstanceService>())
AIProviderViewModel(scope = scope, appContext = get<AppContext>(), providerInstanceService = get<ProviderInstanceService>())
}

// Commands
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ import java.awt.Desktop
import java.net.URI

@Composable
fun aiProviderSettingsSection(viewModel: SettingsViewModel) {
fun aiProviderSettingsSection(viewModel: AIProviderViewModel) {
val scrollState = rememberScrollState()

Box(modifier = Modifier.fillMaxSize()) {
Expand Down Expand Up @@ -169,7 +169,7 @@ fun aiProviderSettingsSection(viewModel: SettingsViewModel) {
}

@Composable
private fun providerModelConfigCard(instance: ProviderInstance, viewModel: SettingsViewModel) {
private fun providerModelConfigCard(instance: ProviderInstance, viewModel: AIProviderViewModel) {
val provider = instance.providerType
val isLocalProvider = provider in setOf(
ModelProvider.OLLAMA,
Expand Down Expand Up @@ -533,6 +533,13 @@ private fun providerModelTypePickerDialog(
null
},
actions = {
// "Use default" is only relevant when an override is already set
if (currentValue.isNotBlank()) {
secondaryButton(onClick = { onSelect("") }) {
Text(stringResource("settings.model.use.default"))
}
Spacer(modifier = Modifier.weight(1f))
}
secondaryButton(onClick = onDismiss) { Text(stringResource("action.cancel")) }
Spacer(modifier = Modifier.width(Spacing.small))
primaryButton(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import io.askimo.core.AppConstants.DOMAIN
import io.askimo.core.providers.ModelDTO
import io.askimo.core.providers.ModelProvider
import io.askimo.core.providers.ProviderConfigField
import io.askimo.core.providers.ProviderRegistry
import io.askimo.core.providers.filterChatModels
Expand All @@ -63,7 +62,7 @@ import java.net.URI
// ── Dialog: Provider wizard (add & edit) ──────────────────────────────────────────────────

@Composable
fun providerWizardDialog(viewModel: SettingsViewModel) {
fun providerWizardDialog(viewModel: ProviderWizardViewModel) {
val title = when (viewModel.wizardStep) {
WizardStep.MODEL -> stringResource("settings.model.select.title")

Expand Down Expand Up @@ -251,7 +250,7 @@ fun providerWizardDialog(viewModel: SettingsViewModel) {
// ── Screen 2: Provider type picker ────────────────────────────────────────────────────────

@Composable
private fun providerTypePickerScreen(viewModel: SettingsViewModel) {
private fun providerTypePickerScreen(viewModel: ProviderWizardViewModel) {
Column(
modifier = Modifier.fillMaxWidth(),
verticalArrangement = Arrangement.spacedBy(Spacing.small),
Expand Down Expand Up @@ -303,7 +302,7 @@ private fun providerTypePickerScreen(viewModel: SettingsViewModel) {
// ── Screen 3: Instance config form ────────────────────────────────────────────────────────

@Composable
private fun instanceConfigScreen(viewModel: SettingsViewModel) {
private fun instanceConfigScreen(viewModel: ProviderWizardViewModel) {
Column(
modifier = Modifier.fillMaxWidth(),
verticalArrangement = Arrangement.spacedBy(Spacing.large),
Expand Down Expand Up @@ -451,18 +450,6 @@ private fun instanceConfigScreen(viewModel: SettingsViewModel) {
Text(text = viewModel.embeddingModelWarning ?: "", style = MaterialTheme.typography.bodySmall, color = MaterialTheme.colorScheme.onTertiaryContainer.copy(alpha = 0.9f))
}
}
if (viewModel.canPullEmbeddingModel && viewModel.embeddingModelProvider == "OLLAMA") {
primaryButton(onClick = {
val baseUrl = viewModel.providerFieldValues["baseUrl"] ?: ""
if (baseUrl.isNotBlank()) viewModel.pullEmbeddingModel(ModelProvider.OLLAMA, baseUrl)
}, enabled = !viewModel.isCheckingEmbeddingModel) {
if (viewModel.isCheckingEmbeddingModel) {
CircularProgressIndicator(modifier = Modifier.size(16.dp), strokeWidth = 2.dp, color = MaterialTheme.colorScheme.onPrimary)
Spacer(Modifier.width(8.dp))
}
Text(stringResource("settings.embedding.download_model"))
}
}
}
}
}
Expand All @@ -474,7 +461,7 @@ private fun instanceConfigScreen(viewModel: SettingsViewModel) {

@Composable
private fun modelPickerScreen(
viewModel: SettingsViewModel,
viewModel: ProviderWizardViewModel,
filteredModels: List<ModelDTO>,
searchQuery: String,
isFiltered: Boolean,
Expand Down
Loading