ChatGPT Assistant Pro comes with a few pre-installed plugins to enhance your Assistant functionalities providing a deep Joomla and Joomla extension integration.

Any of the pre-installed plugins may be used as a template to write your own plugin.

 

Plugin Directory Structure

  • yourplugin
    • language
      • en-GB
        • plg_chatgptassistantpro_yourplugin.ini
        • plg_chatgptassistantpro_yourplugin.sys.ini
    • services
      • provider.php
    • src
      • Extension
        • Yourplugin.php
    • yourplugin.xml

 

Language Files (.ini)

plg_chatgptassistantpro_yourplugin.ini includes the definition of your tool names.

PLG_CHATGPTASSISTANTPRO_CHATGPTASSISTANTPRO_SEARCH_KNOWLEDGEBASE_FUNCTION_LBL="ChatGPT Assistant Pro - Search Knowledge Base"

plg_chatgptassistantpro_yourplugin.sys.ini includes the definition of any back-end options.

PLG_CHATGPTASSISTANTPRO_YOURPLUGIN_DEBUG_LBL="Enable Debug"
PLG_CHATGPTASSISTANTPRO_YOURPLUGIN_DEBUG_DESC="Whether or not to print debug information in the Javascript console."

 

Service Provider file

Sets up your plugin and assigns any required resources, like database access.

 

Extension Yourplugin.php file

This file extends the CMSPlugin class and implements the SubscriberInterface interface.

The onToolDeclare function defines your custom tools and the onToolCall calls your functions when an assistant decides they are useful.

You may even override existing functions, like the search_for_information tool and provide your own information depending on the user.

 

Yourplugin.xml

Finally, the Yourplugin.xml file defines your plugin and allows Joomla to install it.

 

Packing & Installing

After creating the above files, you may zip the whole directory and upload & install it to Joomla, at System > Install > Extensions.

 

Using your Custom Tool in your Assistant

After installing, go to System > Plugins and find your newly installed plugin. Enable it and go to your Assistants.

Your plugin tools should now appear in the Custom Tools tab of the Assistant edit page.

Enjoy! 🚀