Feat: Add configurable Gemini AI model for summarization

This commit enhances the previously added Gemini summarization feature by making the specific Gemini model configurable via `config.toml`.

Key changes:
- Added `model_name` option to the `[gemini]` section in `utils/.config.template.toml`, defaulting to `gemini-1.5-pro-latest`.
- `utils/gemini_client.py` now reads `model_name` from the configuration when initializing the `genai.GenerativeModel`.
- Ensured `utils/settings.py` correctly loads this new optional setting.
- Updated logging and comments to reflect the use of `gemini-1.5-pro-latest` as the default and the configurability of the model name.

This allows users to adapt to newer Gemini models as they become available or choose different models based on their needs, while defaulting to a powerful current version.
pull/2364/head
google-labs-jules[bot] 2 months ago
parent 1cb4be234a
commit bc5e011d3b

@ -60,4 +60,5 @@ no_emojis = { optional = false, type = "bool", default = false, example = false,
[gemini] # New section for Gemini AI settings
api_key = { optional = true, default = "", type = "str", explanation = "Your Google Gemini API Key. Required if enable_summary is true.", example = "AIzaxxxxxxxxxxxxxxxxxxxxxxx" } # Ensure type is str
enable_summary = { optional = true, type = "bool", default = false, example = false, options = [true, false,], explanation = "Enable summarizing Reddit thread selftext using Gemini AI." }
# Future Gemini settings could go here, e.g., model_name, specific prompts, etc.
model_name = { optional = true, type = "str", default = "gemini-1.5-pro-latest", example = "gemini-1.5-pro-latest", explanation = "The Gemini model to use for summarization (e.g., 'gemini-1.5-pro-latest', 'gemini-1.0-pro')."}
# Future Gemini settings could go here, e.g., specific prompts, etc.

Loading…
Cancel
Save