Skip to content

implementation of issue #257 - support for user-selectable Gemini AI models and customizable system prompts#258

Merged
theovilardo merged 5 commits intotheovilardo:masterfrom
Natour-Mazen:master
Oct 15, 2025
Merged

implementation of issue #257 - support for user-selectable Gemini AI models and customizable system prompts#258
theovilardo merged 5 commits intotheovilardo:masterfrom
Natour-Mazen:master

Conversation

@Natour-Mazen
Copy link
Copy Markdown
Contributor

@Natour-Mazen Natour-Mazen commented Oct 14, 2025

This pull request introduces support for user-selectable Gemini AI models and customizable system prompts in the app's AI-powered playlist and metadata generation features. Link to the issue It also adds a new service for fetching available Gemini models using the user's API key, updates user preferences to store model and prompt selections, and enhances the settings UI to allow users to choose their preferred model and system prompt.

AI Model Selection and Customization:

  • Added GeminiModelService to fetch available Gemini models from the Gemini API using the user's API key, with fallback to default models if the fetch fails. (app/src/main/java/com/theveloper/pixelplay/data/ai/GeminiModelService.kt)
  • Updated UserPreferencesRepository to store and retrieve the selected Gemini model and custom system prompt, including methods for setting, getting, and resetting these preferences. (app/src/main/java/com/theveloper/pixelplay/data/preferences/UserPreferencesRepository.kt)

Integration with AI Generators:

  • Modified AiPlaylistGenerator and AiMetadataGenerator to use the selected Gemini model from user preferences instead of hardcoding the model name, and to incorporate the custom system prompt into the playlist creation prompt. (app/src/main/java/com/theveloper/pixelplay/data/ai/AiPlaylistGenerator.kt, app/src/main/java/com/theveloper/pixelplay/data/ai/AiMetadataGenerator.kt)

Settings Screen Enhancements:

  • Updated the settings screen UI to display available Gemini models in a dropdown menu, allow selection and persistence of the chosen model, and trigger model fetching when a valid API key is entered. (app/src/main/java/com/theveloper/pixelplay/presentation/screens/SettingsScreen.kt)

Expanded the SystemPromptDialog bottom sheet to full height in SettingsScreen. Refactored SettingsViewModel to observe playerThemePreference changes and added methods for setting nav bar and carousel styles. Cleaned up code formatting and removed redundant closing brackets.
Added immediate reset of the edited prompt to the default value when 'Reset' is clicked. Enhanced save action to show a toast notification and smoothly dismiss the dialog using coroutine scope for better user experience.
Introduces a floating clear button to the system prompt text field in SettingsScreen, allowing users to quickly clear the prompt. Also refactors prompt construction order in AiPlaylistGenerator for improved clarity.
@Natour-Mazen Natour-Mazen changed the title implementation of https://github.com/theovilardo/PixelPlay/issues/257 implementation of issue #257 Oct 14, 2025
@Natour-Mazen Natour-Mazen changed the title implementation of issue #257 implementation of issue #257 - support for user-selectable Gemini AI models and customizable system prompts Oct 14, 2025
@theovilardo theovilardo merged commit 8294a55 into theovilardo:master Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants