Chat Methods
A chat method is a named group of settings for managing a TrainMyAI chat. When a user starts a new chat via the TrainMyAI website, they can select which chat method to use.
TrainMyAI comes with the following built-in methods:
- For ChatGPT (remote language model): Faster chat (GPT-3.5, sends 5 reference paragraphs per interaction), Deeper chat (GPT-3.5, 10 references), Faster (GPT-4) (GPT-4, 5 refs) and Deeper (GPT-4) (10 refs).
- For Llama 2 (local language model): Faster chat (Llama 2) (5 references), Deeper chat (Llama 2) (10 references).
As well as specifying the language model and number of reference paragraphs, each method sets the prompts to use and the level of variation between answers to the same question.
Chat methods can easily be added, removed and customized by following these steps:
- Log in to your server and use
cd
to navigate to thetrainmyai
directory. - Use
mkdir settings
to create a newsettings
directory alongsidesettings-default
. - Use
cp settings-default/methods.ini settings/methods.ini
to make a copy of the methods file. - Use your favorite text editor to read the
settings/methods.ini
file and start editing.
methods.ini
file in the settings
directory, it will completely override methods.ini
in settings-default
.
Web Pages and Styles
Every web page generated by TrainMyAI can be easily customized in terms of HTML content and CSS styles.
In order to start modifying web pages, follow these steps:
- Log in to your server and use
cd
to navigate to thetrainmyai
directory. - Use
mkdir templates
to create a newtemplates
directory alongsidetemplates-default
. - To change the HTML/PHP template for a page, use
ls templates-default
to see a list of page templates and choose which<page>
to start with (see explanation below). Usecp templates-default/<page>.php templates/<page>.php
to make a copy of that page's template and then start editing the copied template intemplates/<page>.php
. - To change the CSS styles for your site, use
cp -R templates-default/css templates
to make a copy of the CSS directory and then start editing the copied CSS intemplates/css/trainmyai.css
.
Any file in the templates
directory will completely override the file in templates-default
with the same path.
In most cases, the HTML/PHP template file for a TrainMyAI web page is obvious from its name. Below are less obvious ones:
- Files with a
-
hyphen in their name generate a page section which is dynamically loaded using JavaScript. For example,chat-meta.php
is the template for the meta information panel inchat.php
. - The
standard.php
template sets the overall structure for all HTML web pages except the chat iframe. - The
history.php
template is used to show the chat history for both users and knowledge bases. - The
titles.php
andmessages.php
files contain lists of strings and are not HTML templates. They allow the localization and customization of HTML web page titles and status messages respectively.
Other Settings
There are many additional settings available in TrainMyAI, e.g. to limit the size of content files or set the number of items displayed per page in each type of list. In order to view and modify these settings, follow these steps:
- Log in to your server and use
cd
to navigate to thetrainmyai
directory. - Use
cat settings-default/constants.ini
to view the full list of settings. - Use
mkdir settings
to create a newsettings
directory alongsidesettings-default
. - Use your favorite text editor to create and edit a file
constants.ini
in thissettings
directory. - Add a single line
[constants]
followed by the individual settings to modify.
Any setting in settings/constants.ini
will override the corresponding default in settings-default/constants.ini
. Your constants.ini
file should only contain the settings you wish to modify.
Getting help
If you encounter any problems with customizing TrainMyAI, please contact us and we'll be happy to help.