You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can use GPT-3.5 (and obviously GPT-4) to write API plugins for TypingMind !
With the right character and the right documentation used by GPT, it can write your plugin in a few seconds, you just have to use copy/paste. Here is an example
API Documentation for TypingMind Plugin Development
Introduction
TypingMind plugins allow you to extend the capabilities of the AI assistant by providing external tools. Plugins are JavaScript code executed locally in the user's browser.
This documentation (especially the raw file, ~700 tokens) can be given to GPT to ask for a plugin.
Plugin Development
To create a plugin, you need to provide an OpenAI Function Spec and the JavaScript implementation.
Mandatory parts are:
Code for the JavaScript implementation.
OpenAI Function Spec
Optional parts are:
User Settings
Custom Output
OpenAI Function Spec
Must be in the correct JSON format.
Format is a kind of JSON Schema but specific to OpenAI.
The name field must be unique among all your plugins.
Include meaningful names and descriptions to facilitate understanding and usage by the AI.
Example JSON specification:
{
"name": "generate_random_number_in_range",
"description": "Generates a random integer between 'a' and 'b'.",
"parameters": {
"type": "object",
"properties": {
"a": {
"type": "number",
"description": "The number a (the smallest)"
},
"b": {
"type": "number",
"description": "The number b (the largest)"
}
},
"required": ["a", "b"]
}
}
Code Implementation
The code must be valid JavaScript.
The function name must match the one specified in the JSON.
The function accepts two parameters: params (AI parameters) and userSettings (user parameters).
Use custom output to directly display the result to users.
Example of custom output:
return{_TM_CUSTOM_OUTPUT: true,type: 'markdown',data: markdownText,response: "The images have been rendered and displayed to the user."};
Plugin Testing
After saving the information, enable your plugin and test it by interacting with the AI.
Plugin Examples
Community-created plugin examples are available for reference.
Known Issues
Hallucination issue: the AI may attempt to call your function with incorrect parameters. Use "Regenerate" to retry.
Update
Last updated: June 29, 2023
This documentation is a summary of the essential information for creating a plugin for TypingMind. For complete details, please refer to the official documentation.