ROUNDCUBE PLUS AI PLUGIN
========================

This plugin provides AI services for email generation and summarization. It allows the users to quickly and easily
generate high-quality text with personalized messaging tailored to their needs.

DISCLAIMER
----------
Please note that this plugin leverages third-party AI technology, which may produce inaccurate or inappropriate outputs.
Use the plugin at your own risk. The plugin authors cannot be held responsible for the AI-generated content or the
consequences of its use. Users are strongly advised to review and verify any AI-generated content before relying on it
for any purpose.

REQUIREMENTS
------------
- Roundcube: 1.5, 1.6
- PHP: 7.4 or higher
- PHP cURL extension

INSTALLATION
------------
1. Copy the directories xai and xframework included in this package to the 'plugins' directory of your Roundcube
installation.

2. Rename the file <roundcube>/plugins/xai/config.inc.php.dist to config.inc.php.

3. Edit the file <roundcube>/plugins/xai/config.inc.php, specify the AI provider, model, API key (if needed), and
configure the remaining options according to your needs.

4. Edit the file <roundcube>/config/config.inc.php, add xai to the plugins array and specify your license key.

For more information on installing Roundcube Plus plugins see:
https://roundcubeplus.com/helpdesk/knowledgebase.php?article=29

COMPATIBILITY
-------------
This plugin has been created for the standard version of Roundcube as provided on the Roundcube website:
https://roundcube.net. It might not work properly with customized versions of Roundcube. Please note that we cannot
provide any technical support for the plugin deployed on a non-standard version of Roundcube.

CUSTOMIZING PROMPTS
-------------------
In order to provide the user with AI-generated content, the plugin uses predefined prompts that are sent as requests to
the AI provider specified in the config file. The default prompts may or may not work properly with your selected
provider and model. The plugin gives you the option to modify the prompts in the config files.

1. Compose prompt

This prompt can be overridden by using the xai_compose_prompt config option. The prompt string must include the
following variables, which will be replaced with their corresponding values:

- $from and $to: the names specified in the AI Assistant compose dialog. If not specified, these variables default to
the text: "[The name is unknown]."

- $style: contains the English word representing the selected style (e.g., "assertive," "casual," "enthusiastic").

- $length: contains the English word representing the selected length (e.g., "short," "medium," or "long").

- $language: contains the name of the selected language (e.g., "English (US)", "Spanish (ES)").

- $instructions: contains the instructions entered by the user.

Prompt example:

Write a $style email without a subject or preamble. From: $from. To: $to. Email length: $length. Email language:
$language. Email content: $instructions.

2. Summary prompt

This prompt can be overridden by using the xai_summary_prompt config option. The prompt string must include the
following variables, which will be replaced with their corresponding values:

- $language: contains the name of the selected language (e.g., "English (US)", "Spanish (ES)").

- $email: contains the body of the email to summarize.

Prompt example:

Extract important facts from this email and use them to write a very short, one-sentence summary in $language, using
active or passive voice depending on the context. Do not include any preamble or introduction. If a summary cannot be
created, state the reason using passive voice, without saying you are sorry or requesting user action. Here is the
email: $email

LICENSE
-------
This plugin is distributed under a commercial license. In order to use the plugin, you must purchase the license
from Tecorama LLC. See the LICENSE file for details.

COPYRIGHT
---------
Copyright (c) 2025, Tecorama LLC
