=== TWX-Chat ===
Contributors: twxlabs
Tags: chatbot, talking avatar, knowledge base, site crawler, chat logs
Requires at least: 5.8
Tested up to: 6.8
Stable tag: 1.8.5
Requires PHP: 8.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

AI-powered chatbot for WordPress, including Talking Avatars with no usage or time limits. Understand your visitors in a new, deeper way.

== Description ==

TWX-Chat is a powerful and flexible AI chatbot plugin for WordPress, designed to enhance user engagement and provide intelligent, automated support. Powered by OpenAI, this plugin allows you to add a customizable chatbot to your website that can answer questions, provide information, and guide users.

**Key Features:**

*   **AI-Powered Chatbot:** Utilizes OpenAI's models (like GPT-4o-mini) to provide natural and intelligent conversations.
*   **3D Talking Avatars:** Select from available 3D Avatars to add extra engagement for all of your visitors. No time limits!
*   **Knowledge Base Integration:** Automatically builds a searchable knowledge base from your website's pages, posts, or even a sitemap (paid plan). The chatbot uses this "context" to provide relevant and accurate answers based on your content.
*   **Site Crawler:** Includes a built-in site crawler to automatically keep your knowledge base up-to-date with the latest content from your site.
*   **Customizable:** Customize the chatbot's appearance, greeting messages, common questions, flashcards and more. Supports both embedded and floating chat styles.
*   **Streaming Support:** Provides fast, streaming responses for a smoother user experience.
*   **Shortcode Builder:** Easily create multiple chatbots with different styles and knowledge, and simply add the id to any page or post using a simple shortcode. 

Whether you want to provide 24/7 customer support, create an interactive FAQ, or simply offer a more engaging way for users to explore your site, TWX-Chat provides the tools you need.

== Installation ==

1.  Upload the `twx-chat` folder to the `/wp-content/plugins/` directory, OR use Wordress.org Plugins search tool.
2.  Activate the plugin through the 'Plugins' menu in WordPress.
3.  Goto Settings > TWX-Chat
4.  Update 'General Settings'
5.  Select 'Site Crawler' options, Save and and 'Run Now'
6.  After Site Crawler has completed, create a Chatbot
7.  Add the Chatbot shortcode to any page or post where you want the chatbot to appear. Use the Frontpage Shortcode setting (Customize tab) to show the chatbot on your Theme's front page.
8.  Ready! More help at https://twxchat.twxlabs.au/docs

== Frequently Asked Questions ==

= Do I need an OpenAI API key? =

Yes, this plugin requires an OpenAI API key to function. You can get a key by signing up on the [OpenAI website](https://openai.com/).

= Do I need any other Keys? =

Yes. If you want to use the 3D Avatar chatbots, you will need an AWS Cognito Pool Identity Key in order to allow the chatbot to speak. Instructions at [AWS Cognito Pool Identity Key](https://github.com/aws-samples/amazon-sumerian-hosts/blob/mainline2.0/AWS-Infrastructure-Setup.md).
Also if you want to crawl your Google Drive folder (paid plan option), this will need to be entered in the General settings.

= How does the Knowledge Base work? =

The plugin's Site Crawler can read your posts, pages, images, Google Drive folder, or even a custom Sitemap (paid plans only), to create a Knowledge Base. When a user asks a question, the chatbot searches this knowledge base to find the most relevant information and uses it to form an answer. This ensures the responses are based on your site's content.

= Can I fine-tune my knowledge base? =

Yes absolutely! Use the Knowledge Base manager in the Admin settings to create new, edit existing, delete KB entries. You can even Filter and Query the Knowledge Base to see what entries (aka Sources) are relevant and would be used in the Chatbot during User queries.

= Is there time limits like with other Avatar chatbots? =

No. You can test and practise with your Avatars as long as you like, and Users can interact with them as long as you like. There are no time limts like other 3D Avatar providers. This is something we thought was very annoying with other providers and inspired us to create this unlimited feature.

= Can I view and analyze my visitor's chat conversations? =

Not with the Free version of the plugin, but definitely with any of the paid plans.

== External Service Usage ==

= OpenAI =
This plugin connects to the OpenAI API (https://api.openai.com) in order to provide AI-powered responses and functionality. This includes streaming and non-streaming responses to the Chatbot, and also OpenAI Assistant integration (Chat Threads, Responses, Files etc).

OpenAI API Terms of Service: https://openai.com/policies/terms-of-use  
OpenAI API Privacy Policy: https://openai.com/policies/privacy-policy

= Amazon AWS =
This plugin also connects to Amazon Polly and S3 APIs (*.amazonaws.com) in order to provide Text-To-Speech audio during Avatar Chatbot conversations.

AWS Customer Agreement (Terms of Service): https://aws.amazon.com/service-terms/
AWS Privacy Notice: https://aws.amazon.com/privacy/

== Account Requirements ==
To use API features, an account with OpenAI and optionally Amazon AWS may be required. API keys are entered by the user in the plugin settings.

== Remote Resources ==
The plugin connects to our external server (twxchat.twxlabs.au) in order to download 3D avatar assets. This occurs once per Avatar Character selection only. This helps keep the ZIP distributable to a manageable size rather than having all the Character GLTF 3D models in the package. 
It also allows us to release new Avatar Characters in future which can simply be downloaded as needed.

If you are on a paid plan, calls to the remote server are also made to verifiy your Customer Key.

== Directly Accessible Files ==
The following scripts are directly accessible by design for the followig reasons:

* stream_handler.php - is intentionally accessed directly via javascript EventSource for streaming responses from OpenAI. This file includes the proper WordPress bootstrap and nonce checks within it to prevent unauthorized access.

== Screenshots ==

1. Chatbot in action - Talking Avatar Floating
2. Chatbot in action - Talking Avatar Expanded with Conversation Panel and Flashcards
3. Chatbot in action - Embedded Chatbot with Sources and Feedback
4. Admin Settings - Chatbots list and Edit
5. Admin Settings - Site Crawler
6. Admin Settings - Knowledge Base
7. Admin Settings - Chat Log (available in paid plans)

== Changelog ==

= 1.8.5 =
* Version approved by Wordpress.org

= 1.7.7 =
* Version re-submitted to Wordpress.org with suggested fixes

= 1.7.0 =
* Version submitted to Wordpress.org for review

== Planned Improvements ==
* User field collection
* Internationalization
* More Avatar Characters
* MCP/Agent2Agent support


