diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 477e8ce5..63b6b6df 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -2,6 +2,8 @@ template: | ## 更改记录 / Changelog $CHANGES + + name-template: 'v$RESOLVED_VERSION 🌈' tag-template: 'v$RESOLVED_VERSION' categories: diff --git a/src/Core/RodelChat.Core/Providers/OllamaProvider.cs b/src/Core/RodelChat.Core/Providers/OllamaProvider.cs index 57a23e4d..04748121 100644 --- a/src/Core/RodelChat.Core/Providers/OllamaProvider.cs +++ b/src/Core/RodelChat.Core/Providers/OllamaProvider.cs @@ -15,7 +15,7 @@ public sealed class OllamaProvider : ProviderBase, IProvider /// Initializes a new instance of the class. /// public OllamaProvider(OllamaClientConfig config) - : base(config.Key, config.CustomModels) + : base("ollama", config.CustomModels) { SetBaseUri(ProviderConstants.OllamaApi, config.Endpoint); } diff --git a/src/Core/RodelChat.Models/Client/ChatClientConfiguration.cs b/src/Core/RodelChat.Models/Client/ChatClientConfiguration.cs index 4f26e258..214c38d8 100644 --- a/src/Core/RodelChat.Models/Client/ChatClientConfiguration.cs +++ b/src/Core/RodelChat.Models/Client/ChatClientConfiguration.cs @@ -309,9 +309,14 @@ public sealed class SiliconFlowClientConfig : ClientConfigBase /// public sealed class OllamaClientConfig : ClientEndpointConfigBase { + /// + /// Initializes a new instance of the class. + /// + public OllamaClientConfig() => Key = "ollama"; + /// public override bool IsValid() - => IsCustomModelNotEmpty() && !string.IsNullOrEmpty(Key) && !string.IsNullOrEmpty(Endpoint); + => IsCustomModelNotEmpty() && !string.IsNullOrEmpty(Endpoint); } /// diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/ModelClientEndpointConfigSettingSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Settings/ModelClientEndpointConfigSettingSection.xaml.cs index 8000f4a3..0271e6ed 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Settings/ModelClientEndpointConfigSettingSection.xaml.cs +++ b/src/Desktop/RodelAgent.UI/Controls/Settings/ModelClientEndpointConfigSettingSection.xaml.cs @@ -41,6 +41,11 @@ protected override void OnViewModelChanged(DependencyPropertyChangedEventArgs e) PredefinedCard.Description = string.Format(ResourceToolkit.GetLocalizedString(Models.Constants.StringNames.PredefinedModelsDescription), newVM.Name); newVM.Config ??= CreateCurrentConfig(); + if (newVM.Config is OllamaClientConfig) + { + KeyCard.Visibility = Visibility.Collapsed; + } + Debug.Assert(ViewModel.Config != null, "ViewModel.Config should not be null."); ViewModel.CheckCurrentConfig(); } @@ -85,7 +90,6 @@ private ClientConfigBase CreateCurrentConfig() else if (config is OllamaClientConfig) { config.Endpoint = ProviderConstants.OllamaApi; - config.Key = "ollama"; } return config; diff --git a/src/Desktop/RodelAgent.UI/Controls/Startup/Chat/ChatClientEndpointConfigSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Startup/Chat/ChatClientEndpointConfigSection.xaml.cs index 97b8e715..b6c23474 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Startup/Chat/ChatClientEndpointConfigSection.xaml.cs +++ b/src/Desktop/RodelAgent.UI/Controls/Startup/Chat/ChatClientEndpointConfigSection.xaml.cs @@ -31,6 +31,11 @@ protected override void OnViewModelChanged(DependencyPropertyChangedEventArgs e) } newVM.Config ??= CreateCurrentConfig(); + if (newVM.Config is OllamaClientConfig) + { + BaseSection.Visibility = Visibility.Collapsed; + } + Debug.Assert(ViewModel.Config != null, "ViewModel.Config should not be null."); ViewModel.CheckCurrentConfig(); } @@ -66,7 +71,6 @@ private ClientEndpointConfigBase CreateCurrentConfig() } else if (config is OllamaClientConfig) { - config.Key = "ollama"; config.Endpoint = ProviderConstants.OllamaApi; }