Skip to main content
All CollectionsCustom Plugins
Creating a GET Route Custom Plugin in TeamAI
Creating a GET Route Custom Plugin in TeamAI

Enable your AI to retrieve data from external APIs using GET route custom plugins in TeamAI.

Moiz avatar
Written by Moiz
Updated over 6 months ago

The GET route custom plugin in TeamAI allows your AI model or assistant to communicate with external APIs using the HTTP GET method. By configuring this plugin, you can enable your AI to retrieve data from various sources, enhancing its capabilities and providing more accurate and up-to-date information to users.

Creating a GET Route Custom Plugin

To create a GET route custom plugin, follow these steps:

  1. Navigate to the "Custom plugins" section in the left sidebar of your TeamAI dashboard.

  2. Click on the "Create plugin" button.

  3. Name your plugin and click "Create."

  4. In the "Endpoint" field, enter the URL of the API endpoint you want to connect to.

  5. In the "Method" dropdown, select "GET."

Configuring Query Parameters and Headers

The GET route custom plugin supports both query parameters and headers. Query parameters are key-value pairs appended to the end of the API URL, while headers provide additional information about the request.

To add query parameters or headers:

  1. In the plugin configuration, locate the "Query Parameters" or "Headers" section.

  2. Click on the "Add Parameter" or "Add Header" button.

  3. Enter the key and value for the parameter or header.

  4. Click "Save" to apply the changes.

Using Dynamic Parameters (Variables)

Dynamic parameters, or variables, allow you to create flexible and reusable plugins. By defining variables, you can enable the AI model to input values based on the user's query when the plugin is toggled.

To create a new parameter:

  1. In the plugin configuration, click on the "Add property" button in the "Parameters" section.

  2. Enter a meaningful name and description for the parameter, as these will be used by the AI model.

  3. Select the appropriate type for the parameter (e.g., string, number, boolean).

  4. Click "Save" to add the parameter.

To use a dynamic parameter in query parameters or headers, simply reference the variable name wrapped in double curly braces, like this: {{variableName}}.

Example: Using a Dynamic Parameter

Let's say you've created a dynamic parameter called postId. To use this parameter in a query parameter, you would enter the following in the "Key" field: postId, and in the "Value" field: {{postId}}.

When the AI model processes a user's query with this plugin toggled, it will attempt to input a value for the postId parameter based on the context of the query.

Conclusion

The GET route custom plugin in TeamAI is a powerful tool for enabling your AI model or assistant to interact with external APIs. By configuring query parameters, headers, and dynamic parameters, you can create flexible and reusable plugins that enhance your AI's capabilities.

Feel free to experiment with different configurations and test your plugin with various user queries to ensure it functions as expected. With the GET route custom plugin, you can unlock new possibilities for your AI model and provide even more value to your users.

Did this answer your question?