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 four built-in methods: 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).

As well as specifying the OpenAI 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 the trainmyai directory.
  • Use mkdir settings to create a new settings directory alongside settings-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.
If there is a methods.ini file in the settings directory, it will completely override methods.ini in settings-default.

HTML Templates

Every web page generated by TrainMyAI can be easily customized in terms of HTML content and styling. This is achieved by modifying that page's template using HTML and the popular PHP programming language.

In order to start modifying templates, follow these steps:

  • Log in to your server and use cd to navigate to the trainmyai directory.
  • Use mkdir templates to create a new templates directory alongside templates-default.
  • Use ls templates-default to see a list of templates and choose which <file>.php to start with (see below).
  • Use cp templates-default/<file>.php templates/<file>.php to make a copy of this template file.
  • Use your favorite text editor to read the templates/<file>.php file and start editing.

Any file in the templates directory will completely override the file in templates-default with the same name.

In most cases, the 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 in chat.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 and messages.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 the trainmyai directory.
  • Use cat settings-default/constants.ini to view the full list of settings.
  • Use mkdir settings to create a new settings directory alongside settings-default.
  • Use your favorite text editor to create and edit a file constants.ini in this settings 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.