Trueseek AI
  • Getting Started
    • Get started with Trueseek
    • Trueseek vs Other AI Platforms
  • AI Agents
    • AI Agents Overview
    • AI Agents Examples
    • Dynamic Context
    • Interactive blocks
    • OpenAPI
    • Integrations
  • Plugins
    • Build a Trueseek plugin
    • Server Plugin
    • Plugin Server Side vs Client Side
    • OAuth for Plugin
    • How to Use Trueseek Plugin
  • System Prompt
    • Set up System Instruction
  • Prompts
    • Prompt library
    • Prompt Examples
    • Automatic Prompt Caching
    • Message Syntax
  • Chat Management
    • Organize chats
    • Share/Export a Chat
    • Pin Chats
  • Upload and Chat with Files
    • Chat with Documents
    • Chat with Videos
  • Text-to-speech
    • Set up Text-to-speech
    • Create Custom voice
  • General Settings
    • General Settings
    • Customize app appearance
    • Keyboard shortcuts
  • Support
    • Frequently Asked Questions
    • Report Error/Bugs
Powered by GitBook
On this page
  1. Plugins

Build a Trueseek plugin

Trueseek Plugins: Extend Your AI's Capabilities

Trueseek Plugins enable you to expand the functionality of your AI assistant by integrating external tools. To get started, simply click the “Plugins” button from the main dashboard.

Note: Trueseek Plugins are currently in beta. More detailed documentation will be available soon.

Join Our Community

Join our Telegram community to discuss plugins and share ideas: Trueseek Telegram.

Developing Your Plugin

Trueseek Plugins allow you to introduce new capabilities to your AI models. Plugins function by following the OpenAI Function Calling API specifications, and Trueseek also supports running plugins for models like Gemini and Claude.

Plugins can be implemented using JavaScript or HTTP Actions.

Plugin Development Requirements:

  • Ability to write JavaScript (if using JavaScript implementation)

  • Basic understanding of HTTP requests (if using HTTP Actions)

  • Familiarity with the OpenAI Function Calling API

To get started, click “Create New Plugin” and begin building your plugin.

Note: Currently, you can only create new plugins manually. A plugins marketplace and GitHub import feature will be available soon.

Plugin Setup

To create a plugin, enter the following key information:

  • Plugin Name: The name that will be displayed to users.

  • Overview: A brief introduction about the plugin and its usage. (Markdown format supported)

The main components for plugin development are the OpenAI Function Spec and the Code Implementation.

OpenAI Function Spec:

  • Ensure correct JSON formatting: Follow OpenAI documentation for writing a valid JSON spec.

  • Unique Function Name: Each function should have a unique name to avoid confusion in calls.

  • Meaningful Names & Descriptions: Provide clear and meaningful names for functions and parameters to help the AI understand when to use the function.

Example of OpenAI Function Spec (JSON):

jsonCopy{
  "name": "generate_random_number_in_range",
  "description": "Generate a random integer between 'a' and 'b'.",
  "parameters": {
    "type": "object",
    "properties": {
      "a": {
        "type": "number",
        "description": "The minimum number."
      },
      "b": {
        "type": "number",
        "description": "The maximum number."
      }
    },
    "required": ["a", "b"]
  }
}

Plugin User Settings (JSON):

User settings define input fields that the plugin will ask users to fill out. These settings are passed in as JSON formatted strings.

Example of User Settings (JSON):

jsonCopy[
  {
    "name": "searchEngineID",
    "label": "Search Engine ID"
  },
  {
    "name": "searchEngineAPIKey",
    "label": "API Key",
    "type": "password"
  },
  {
    "name": "quality",
    "label": "Quality",
    "description": "Optional, default: 'standard'",
    "type": "enum",
    "values": ["standard", "hd"]
  }
]

The settings object will allow users to input data that will be used by the plugin during execution.

JavaScript Code Implementation:

  • Ensure valid JavaScript: Write your function implementation in JavaScript. You can use async functions if needed.

  • Function Name Matching: The function name in your code should match the name in the JSON spec.

Example of JavaScript Function:

javascriptCopyasync function generate_random_number_in_range({a, b}, userSettings) {
  var min = Math.ceil(a);
  var max = Math.floor(b);
  return Math.floor(Math.random() * (max - min + 1) + min);
}
  • Execution Environment: The plugin code runs in the user's browser within a sandboxed environment (using an <iframe> tag), ensuring security and privacy.

  • CORS Considerations: If your plugin interacts with external APIs, ensure that CORS settings are configured to allow requests from Trueseek.

Accessing User Settings:

User settings are available in your plugin's function as the second parameter, userSettings.

Example of Accessing User Settings:

javascriptCopyfunction search_images_via_google(params, userSettings) {
  const { searchEngineID, searchEngineAPIKey } = userSettings;
  // Plugin code here
}

Implementing HTTP Actions

Another way to implement plugins is through HTTP Actions. This involves sending requests from the user's browser to an external server.

You can customize the request by defining:

  • HTTP method

  • Endpoint URL

  • Headers (optional)

  • Request body (optional)

  • Post-processing actions (optional)

User settings and call parameters can be included in the HTTP request using template parameters like {param1}, {param2}, etc.

Post-Processing of HTTP Action Responses:

Trueseek supports two engines for processing HTTP responses:

  1. JMESPath Transform: Useful for filtering large JSON responses.

  2. Handlebars.js Templates: For transforming responses into formats like Markdown or HTML.

Example of Markdown Rendering in Post-Processing:

markdownCopy{{response.image_url}}

Output Options

Trueseek allows you to control how the plugin outputs its results:

  • Send Output to AI: The AI decides how to use the plugin’s result.

  • Render Output as Markdown: Present the output as markdown.

  • Render Output as Interactive HTML: Display the output in an interactive HTML format.

Server vs. Client Plugins

Server Plugins run on the server side and are hidden from users, while Client Plugins run in the user’s browser. Server Plugins can be used in the Team version of Trueseek and typically involve HTTP Actions. Client plugins, on the other hand, are typically developed for individual use in the browser.

Testing Your Plugin

Once you have configured your plugin, click “Save” to enable it. You can then test the plugin by interacting with the AI assistant. The AI will decide when to use the plugin based on context and the available function specs.

Limitations:

  • JavaScript Plugins: Run in a sandboxed environment, meaning some JavaScript features may be restricted.

  • CORS Issues: If your plugin sends requests to external services, ensure that the external servers allow CORS requests from Trueseek.

Example Plugins: Check out community-developed plugins for inspiration and to see working examples.

PreviousIntegrationsNextServer Plugin

Last updated 4 months ago