View Single Post
Old 11-04-2025, 07:13 AM   #1
sheldonrrr
A self-taught developer
sheldonrrr reads for the sheer pleasure of reading.sheldonrrr reads for the sheer pleasure of reading.sheldonrrr reads for the sheer pleasure of reading.sheldonrrr reads for the sheer pleasure of reading.sheldonrrr reads for the sheer pleasure of reading.sheldonrrr reads for the sheer pleasure of reading.sheldonrrr reads for the sheer pleasure of reading.sheldonrrr reads for the sheer pleasure of reading.sheldonrrr reads for the sheer pleasure of reading.sheldonrrr reads for the sheer pleasure of reading.sheldonrrr reads for the sheer pleasure of reading.
 
Posts: 47
Karma: 125496
Join Date: Feb 2025
Location: Shanghai
Device: Kindle Paperwhite 2, iPad mini 5
Lightbulb [GUI Plugin] Ask AI Plugin

Ask AI Plugin - A calibre Plugin to Ask Questions About Books

A versatile plugin that lets you ask questions about books directly in calibre using a wide range of AI models, including OpenAI, Anthropic, Nvidia AI, OpenRouter, Grok, Google Gemini, Ollama (Local AI), and DeepSeek.

Why Use This Plugin?
  • This plugin supports extracting book metadata (such as title, author, or publisher) from your calibre library page and submitting it to mainstream AI services for querying, eliminating the need for manual copy-pasting.
  • While calibre officially supports AI features, especially within the Viewer for text selection, querying from the main book list page remains a high-frequency scenario with great potential for product innovation, which this plugin addresses.
  • Beyond current user needs,I am preparing more advanced exploratory features. Stay tuned for updates.
Just select one or more books, choose your preferred AI model, ask your question, and get answers seamlessly.

——

Improvements (v1.4.4)
  • Nvidia Default Model - Nvidia AI (Free) now default to a stronger model(gpt-oss-120b) for better answers. Better AI Search and free Ask.

----

Bug Fixes (v1.4.3)
  • Windows Compatibility Fix - Fixed module import error that prevented the plugin from loading on Windows
  • Improved Error Handling - When opening books with problematic file paths (e.g., invalid characters or locked files), the plugin now gracefully skips those books instead of failing completely

Improvements
  • Keyboard Shortcut Change - Changed Random Question shortcut from Ctrl+R to Ctrl+Shift+R to avoid conflict with Calibre's built-in Restart shortcut
  • Better Error Messages - Error dialogs now display in the user's selected language instead of hardcoded Chinese

----

New Features (v1.4.2)
  • AI Search - Search your entire library using natural language. Open via menu, Ctrl+Shift+L shortcut, or simply open Ask dialog without selecting any books. Ask questions like "Do you have any books about Python?" and AI will recommend relevant books from your library.
  • Statistics Page - Added a simple statistics page showing usage overview, weekly trends chart, and monthly heatmap.

----

New Features (v1.4.1)
  • Markdown Copy Support - Copy AI responses with Markdown formatting preserved via the copy dropdown menu.
  • Reddit Community Update - Plugin updates and discussions moved to r/AskAIPlugin_calibre (previously r/AskGrokPlugin).

Improvements
  • Enhanced Default Prompts - Improved AI understanding of calibre-related questions with updated prompt templates.

Bug Fixes
  • Configuration Tab Layout - Standardized padding and margins across all configuration tabs for consistent appearance.
  • Button Hover Effects - Fixed incorrect hover states for Random Question and Send buttons across different themes and platforms.

----

New Features (v1.4.0)
  • Free Tier Channel (Nvidia AI Free) - Added a completely free AI channel that works out of the box without any configuration. New users can start asking questions immediately using Nvidia AI Free, which is now the default AI provider.
  • Zero Configuration Setup - Implemented "configuration equals minimum viable product" logic. The plugin is now fully functional immediately after installation with no setup required.

Bug Fixes (v1.4.0)
  • Fixed AI Deletion Bug - Resolved issues that occurred when users deleted configured AI providers.

----

Improvements (v1.3.9)
  • Refactored AI Management - Refactored the logic for adding and managing configured AI providers to improve reliability and consistency across the plugin.

----

New Features & Improvements (v1.3.8)
  • Persona Prompt - Define your research background and goals to help AI provide more relevant responses. The persona text is prepended to all prompts (single-book, multi-book, and random questions).
  • Debug Logging Toggle - New option in General Tab to enable/disable debug logging to file. Thanks to Comfy.n for the feedback (MobileRead thread).
  • Prompts Tab Reorganization - Prompts configuration is now a separate tab for better organization and easier management.

----

Bug Fixes & Improvements (New in v1.3.7)
  • Perplexity (Sonar) support
  • Hardcoded Sonar models (no model list fetch)
  • Citations URLs appended for easy copy/paste

----

Bug Fixes & Improvements (New in v1.3.6)
  • Customizable Keyboard Shortcuts: All main actions are now visible in calibre's shortcut manager, so you can customize the plugin shortcuts via Preferences -> Shortcuts.
  • Language Follows calibre UI: The plugin language will now follow your calibre interface language by default (you can still choose a different language in the plugin settings).
  • Better Language Switching Experience: Fixed UI issues when switching languages, so text updates cleanly without overlapping.

----

Bug Fixes & Improvements (New in v1.3.5)
  • Consistent Language for Export Metadata: Resolved an issue where export file metadata, such as publication dates and "Multiple Books Prompts" content, incorrectly defaulted to Chinese. These elements now consistently fall back to English for broader compatibility and readability.
  • Reliable Reset All Data: Fixed a critical bug preventing the "Reset All Data" function from working correctly on macOS and Windows platforms. Users can now reliably reset their configurations as intended.
  • Cleaned Up Shortcut Placeholders: Removed the redundant {model} field from shortcut configurations, ensuring cleaner and more functional keyboard shortcuts.
  • Visible Reset Button in Settings: Addressed an issue where the "Reset" button on the configuration page was obscured due to minimum width constraints. The button is now always fully visible and accessible.
  • Streamlined "Ask" Dialog Logic: Eliminated an unnecessary check that appeared in the "Ask" dialog after a reset, providing a smoother user experience.
  • Improved Random Question Control: Implemented a fix for random questions that would not stop. The "Stop" logic is now correctly linked to the send button for better control.
  • Expanded Language Support: We now officially support English, French, German, Japanese, Simplified Chinese, and Traditional Chinese(I know some users are using). If you use another language, please contact me to request support!

----

Improvements (New in v1.3.4)
  • New About & Tutorial in config dialogue: Now users can read tutorial in local.

Bug Fixes & Improvements (New in v1.3.3)
  • User-Friendly PDF Filenames: Redesigned PDF export filenames for better readability and organization. Now includes AI provider name with proper capitalization, book title, and human-readable timestamps (e.g., "OpenAI_QA_BookTitle_2025-11-20_09-47.pdf").
  • Default Export Folder Support: Added ability to configure a default folder for PDF exports. Enable in settings, select your preferred folder, and all future exports will save there automatically.
  • Copy Button Improvements: Enhanced copy functionality in the Ask dialog with unified content formatting and consistent metadata inclusion.
  • Parallel AI Display Fix: Fixed issue where multiple AI responses weren't displayed side-by-side correctly. Parallel AI panels now properly show responses for easy comparison.
  • Language Switching Fix: Fixed bug where export configuration labels didn't update when switching interface language. All UI elements now translate immediately.

Bug Fixes & Improvements (New in v1.3.2)
  • Optimized Multi-AI Provider: Enhanced the integration and performance of multiple AI providers for better response accuracy.
  • Dynamic Model List Loading: Improved efficiency in loading AI models dynamically, reducing wait times.
  • AI Switcher in Response Panel: Streamlined the AI switcher feature within the response panel for easier access to different AI options.
  • PDF Export Features: Upgraded PDF export capabilities to support more complex layouts and formats.
  • Multiple Books Support: Implemented support for handling multiple books simultaneously, enhancing user workflow.
  • Parallel AI Requests: Enabled parallel processing for AI requests, improving response time.
  • Responsive Font Sizing: Adjusted font sizes to ensure readability across different devices and screen sizes.
  • Compact Layout: Redesigned the UI layout for a more compact and user-friendly experience.
  • Loading States: Added visual indicators for loading processes to keep users informed of ongoing tasks.
  • Button Styling: Updated button styles to improve aesthetics and usability.

Bug Fixes & Improvements (New in v1.3.1)
  • Fixed Plugin Enable/Disable Error: Resolved AttributeError when clicking Enable/disable plugin button in calibre's plugin manager (Windows users reported this issue).
  • Dependency Isolation: Implemented namespace isolation for all third-party libraries to prevent conflicts with other calibre plugins. All dependencies now live in ask_ai_plugin_vendor namespace.
  • Removed Duplicate Dependencies: Removed webencodings (already included in calibre).
  • Enhanced Stability: Zero conflict with other plugins - each plugin now uses its own isolated library versions.
  • Updated Dependencies: Synchronized all vendor library versions in requirements.txt for better maintainability.
  • Improved Documentation: Added comprehensive version update guide and dependency conflict analysis documentation.

✨ Features (New in v1.3.0)
  • Ask questions about books with AI directly in calibre
  • Configurable API key for various AI models: OpenAI, Anthropic, Nvidia AI, OpenRouter, Grok, Google Gemini, and DeepSeek
  • Enhanced Ollama Support: Dedicated settings for Ollama (Local AI) for private and local AI interactions.
  • New! Load Models: Add AI services by selecting from a list, replacing manual input for greater convenience.
  • New! Multi-Book Query: Select multiple books and include all of their metadata in your question.
  • New! Parallel Requests: Send your question to up to 2 AI services simultaneously to compare answers.
  • New! Max Request Time: Configure a maximum time limit for AI requests.
  • New! Reset All Data: Quickly delete all plugin configuration and history data.
  • Enhanced Compatibility: Custom AI service configuration is now compatible with OpenAI's request format, supporting most mainstream AI services (not just Ollama’s).
  • Automatically includes the current book's metadata (title, author, publisher) - no copy-paste needed
  • Simple single input-output dialog interface
  • Customizable prompt template
  • Preview-able interface shortcuts
  • New! Edit Random Question Prompts: Customize the AI-generated question ideas.
  • New! Enable Streaming Config for every AI: Choose whether to receive AI responses as they are generated for a more interactive experience.
  • Enhanced Internationalization: Further improved multi-language support.

---

Installation

Install via calibre Official Plugin Market
  1. Open calibre’s Preferences
  2. Go to Plugins
  3. Click Get new plugins
  4. Search for Ask AI in the Filter by name field
  5. Select the plugin and install
  6. Restart calibre

---

How to Get Your API Key(s)
  1. OpenAI, Anthropic, Nvidia AI, OpenRouter, Grok, Google Gemini, DeepSeek: Obtain your API key from the respective official provider's website or console.
  2. For Ollama (Local AI): No API key is strictly needed, as it runs locally. Ensure Ollama is installed and a model is running on your system.

---

⚙️ Configure AI Services in calibre
  1. In calibre, click the Ask AI Plugin dropdown menu in the toolbar, then select Configure.
  2. Select your desired AI Model (e.g., OpenAI, Gemini ) or use the new Load Models feature.
  3. Paste your API Key (if applicable) into the relevant input box.
  4. For Ollama, configure the local server endpoint in its dedicated section.
  5. Click Save.
  6. You’ll see a Save successful message.

---

How to Use the Plugin
  1. Select one or more books in your calibre library.
  2. Click the Ask AI Plugin button in the toolbar.
  3. Select your preferred AI model(s) from the dropdown and configure any parallel requests.
  4. Enter your question in the popup dialog.
  5. Click Send to get the AI’s answer(s).
  6. Click Suggestion? to see AI-generated question ideas.
  7. Utilize the Edit Random Question Prompts option in configurations to customize these suggestions.

---

Supported Languages
  • Danish (da), German (de), English (en), Spanish (es), Finnish (fi), French (fr), Japanese (ja), Dutch (nl), Norwegian (no), Portuguese (pt), Russian (ru), Swedish (sv), Simplified Chinese (zh), Traditional Chinese (zht), Cantonese (yue)

---

⚠️ Requirements
  • calibre 6.0.0 or higher (The current minimum version requirement is more compatible with some older devices.)
  • External Python modules: requests, bleach, markdown2

Note: The plugin uses built-in calibre modules like PyQt5 for the GUI and standard Python libraries (os, sys, json, etc.).

---

AI Model API Key Notes
  • API call limits and pricing depend on your selected AI service provider and your account permissions.
  • For Ollama, performance depends on your local hardware and the downloaded model.

----

Recent Updates (v1.3.0 Highlights)
  • v1.3.0 New Features:
    • AI: OpenAI, Anthropic, Nvidia AI, OpenRouter Supported.
    • AI: Dedicated Ollama Entrance (enhanced from Custom).
    • Config: Load Models for easy AI service addition.
    • Config: Max Request Time setting.
    • Config: Parallel AI Requests (up to 2).
    • Feature: Multi-Book Query support.
    • Tool: Reset All Data option.
  • v1.3.0 Enhancements:
    • Compatibility: Custom AI configuration now compatible with OpenAI's request format.
    • i18n: Further improved Internationalization support.
  • v1.2.x Updates: Included support for Google Gemini, Ollama, DeepSeek, streaming config, and various fixes.

---

Privacy Handling
  • The plugin sends book metadata (title, author, publisher, publish time, language) to the selected AI model but excludes user-defined data like Tags or Comments.
  • Your AI API Key is stored locally in a JSON file and isn’t sent to any third-party server.
  • Uses Python’s requests module for external API calls; no third-party servers are involved in data processing by the plugin itself beyond direct API calls to your chosen AI provider.
  • The privacy policy of each AI model regarding data usage for model training may vary. Please consult their respective official statements.

---

Important Note on Plugin Name Update
As the original plugin name no longer suits the broad range of scenarios the plugin now supports, we are adjusting the name to Ask AI Plugin. I plan to introduce this as a new plugin and update the old plugin (Ask Grok) with a minor version that displays a popup, prompting users to upgrade.

Please Note: This update is a breaking change and no longer supports the plugin's original data format. Therefore, legacy users are strongly advised to back up or transfer their data, such as API Keys.

Feedback Welcome!
Let me know if you have any questions or suggestions for the plugin. I’ll update this thread with any new features or changes.

GitHub Repository
https://github.com/sheldonrrr/ask_grok
Attached Thumbnails
Click image for larger version

Name:	Screenshot From 2025-12-21 15-22-38.png
Views:	1034
Size:	422.0 KB
ID:	219818   Click image for larger version

Name:	Screenshot From 2025-12-21 15-23-03.png
Views:	1029
Size:	250.8 KB
ID:	219819   Click image for larger version

Name:	Screenshot From 2025-12-21 15-23-13.png
Views:	1009
Size:	200.3 KB
ID:	219820   Click image for larger version

Name:	Screenshot From 2025-12-21 15-23-18.png
Views:	1014
Size:	309.7 KB
ID:	219821  
Attached Files
File Type: zip Ask_AI_Plugin_v1.4.4.zip (2.77 MB, 1229 views)

Last edited by sheldonrrr; 03-27-2026 at 07:42 PM. Reason: Improve version update
sheldonrrr is offline   Reply With Quote