feat: openai model loading & selection - #8
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds user-selectable OpenAI model support by persisting a chosen model in settings and using it when creating the chat client, aligning with Issue #6’s request to control summary quality/cost.
Changes:
- Add an AI model combobox (plus loading indicator) to Settings UI and load models from OpenAI.
- Persist the selected model in settings/config and use it when initializing the
ChatClient. - Set a default model (
gpt-5.6-luna) when creating a new settings file.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Views/SettingsView.axaml | Adds model selection UI (ComboBox + ProgressBar) to the settings page. |
| ViewModels/SettingsViewModel.cs | Loads available models asynchronously and saves the selected model to settings. |
| Program.cs | Ensures new settings files include default AiModel. |
| Models/Services/SettingsService.cs | Adds AiModel to settings load/save flow. |
| Models/Services/AIService.cs | Uses selected model for ChatClient and adds API call to fetch model list. |
| Models/Configuration/ClientSettings.cs | Extends persisted settings schema with AiModel. |
Suppressed comments (1)
ViewModels/SettingsViewModel.cs:46
DraftAiModelwird inLoadSettings()nicht initialisiert. Wenn der Nutzer speichert, bevorLoadModelsAsync()fertig ist, wirdSettings.AiModelals null/leer gespeichert. Initialisiere das Draft-Feld direkt zusammen mit den übrigen Settings.
DraftOpenaiKey = Settings.OpenaiKey;
DraftProfileName = Settings.ProfileName;
DraftProfileMail = Settings.ProfileMail;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+101
to
+106
| catch (Exception e) | ||
| { | ||
| Console.WriteLine(e.Message); | ||
| collection.Add("Modelle konten nicht geladen werden"); | ||
| return collection; | ||
| } |
Comment on lines
62
to
66
| OpenaiKey = (string.IsNullOrEmpty(s.OpenaiKey)) ? "" : App.Instance.Protector.Unprotect(s.OpenaiKey); | ||
| ProfileName = s.ProfileName; | ||
| ProfileMail = s.ProfileMail; | ||
| AiModel = s.AiModel; | ||
|
|
Comment on lines
8
to
10
| public string ProfileMail { get; set; } | ||
| public string AiModel { get; set; } | ||
|
|
001Sarper
added a commit
that referenced
this pull request
Aug 3, 2026
* feat: OpenAI Key encryption in config file (#7) * feat: openai model loading & selection (#6) (#8) * feat: loading bar is shown when user creates learnsheet (#10) * feat: Multi Language Support (#13) * feat: add localization scaffolding (DE/EN JSON Files) Not yet wired into views — follow-up commits pending. * feat: - english & german language officially supported - real time switch between languages in settings - new languages can be easily imported by creating a new language config file & editing the language converters * fix: - file picker multi-language support * fix: - multi-language support implemented into model loading error - DataProtection aliases adjusted * fix: - updated README.md with new pics & details - language fixed at pdf page counter - set default language to english
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously the code was hard coded to use
gpt-5.6-lunafor the summaries and chat with the AI Bot. With this feature update every AI model is loaded into the combo box and the user can freely select which model he wants to use.This helps the user to fine tune his summaries quality or save up more money by using a cheaper model.
The default model is still
gpt-5.6-lunawhen the settings file is created.Closes #6