Skip to content

v1.8.13#240

Merged
TiTidom-RC merged 9 commits into
betafrom
dev
May 14, 2026
Merged

v1.8.13#240
TiTidom-RC merged 9 commits into
betafrom
dev

Conversation

@TiTidom-RC
Copy link
Copy Markdown
Owner

This pull request introduces several improvements and new features for the TTS Cast plugin, focusing on enhancing AI model selection, improving the AI prompt system, and refining user interface and error handling. The main highlights are the addition of a feature to display the default system prompt, updates to available AI models and their descriptions, and improvements to logging and error reporting.

AI Model Selection and Prompt System:

  • Updated the available AI models in the configuration UI, added Gemini 3.1 models, and clarified pricing/tooltips. The default selected model is now gemini-3.1-flash-lite instead of gemini-2.5-flash-lite.
  • Improved the default system prompt text in Config.aiSysPrompt to be more detailed, with clearer instructions and formatting for AI-generated responses. The default tone is now lowercase ("enthousiaste et humoristique"). [1] [2]

New Feature: Display Default System Prompt

  • Added a new "Afficher" button and textarea in the configuration UI to display the current default system prompt, with supporting AJAX and backend handlers. This allows users to see the system prompt used by the AI when no custom prompt is set. [1] [2] [3] [4] [5] [6]

Logging and Error Handling:

  • Enhanced logging in the AI generation daemon to use repr() for more precise debug output, and added logs for the cleaned AI response after Markdown removal. [1] [2]
  • Improved exception handling in the AJAX controller to display only the exception message, making error messages clearer to users.

Dependency and Version Updates:

  • Updated the google-genai Python package from version 1.72.0 to 2.2.0.
  • Bumped the plugin version to 1.8.13.

Refresh available TTS AI models and pricing tooltip: set default to gemini-3.1-flash-lite, add Gemini 3.1 options, mark "Latest" models with a warning, adjust Preview entries and remove older Generation 2.0 entries. Also bump plugin version to 1.8.13 and upgrade google-genai dependency from 1.72.0 to 2.2.0.
Replace the single-line French system prompt with a structured, multi-line prompt to improve clarity and readability. The new prompt explicitly instructs the assistant to reformulate announcements and answer questions, preserve numeric values, verify temporal information and factual/current data via web search, allow line breaks for readability, and never use emojis or Markdown. Tone selection via aiDefaultTone (or aiCustomTone) is preserved.
Use repr() when logging the system instruction and raw Gemini response to make control characters and whitespace visible. Introduce intermediate variables (raw_text, clean_text), log the cleaned Markdown-stripped output, and return the sanitized text. This improves debug visibility of AI prompts/responses and clarifies the post-processing step in TTSCast (resources/ttscastd/ttscastd.py).
Expose the AI system default prompt so users can view it from the plugin settings. Added an AJAX action (getDefaultPrompt) in core/ajax/ttscast.ajax.php, a button and readonly textarea in plugin_info/configuration.php plus client-side JS to request and display the prompt, and a synchronous daemon handler TTSCast.handleGetDefaultPrompt in resources/ttscastd/ttscastd.py (registered with the socket handlers). The AJAX call surfaces an error if the daemon is not running; the daemon handler returns the prompt via myConfig.aiSysPrompt().
Replace thrown Exception with ajax::error in getDefaultPrompt handling so the endpoint returns a proper AJAX error response when the TTS daemon is not running. This ensures clients receive a structured error instead of an exception.
Replace direct ajax::error call with throwing an Exception when the TTS daemon is not started (getDefaultPrompt path), so the catch block can handle errors consistently. Also simplify the catch to return the exception message ($e->getMessage()) instead of displayException($e). This centralizes error handling and avoids sending formatted exception details directly.
Change Bootstrap column class from col-lg-3 to col-lg-9 for the Default System Prompt section so the 'Afficher' button and result textarea have more horizontal space, improving layout and readability.
Lowercase the default AI tone string for consistency between UI and backend (resources/ttscastd/utils.py) and update the configuration form (plugin_info/configuration.php): adjust the placeholder casing and reduce the prompt display column from col-lg-9 to col-lg-6 to better fit the "Afficher" button and textarea. These changes keep wording consistent and improve the prompt display layout.
Clarify and simplify French assistant guidelines: remove the explicit "confirmer" phrasing for temporal checks, shorten the instruction about verifying dates/weekdays via online search, and replace formatting bullets with explicit guidance to use short, fluid sentences suitable for vocalization and plain text without emojis or Markdown.
@TiTidom-RC TiTidom-RC merged commit e63eeb4 into beta May 14, 2026
1 check passed
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.

1 participant