ToolJet
ToolJet is a low-code platform that lets you build apps by connecting APIs and data sources, with Portkey integration adding AI features like chat interfaces and automation.
This guide provides a streamlined process for integrating Portkey AI into ToolJet using the ToolJet Marketplace Plugin. Follow this guide to add AI-powered capabilities such as chat completions and automations into your ToolJet apps, helping developers create powerful, low-code applications backed by Portkey’s AI for chat-based interfaces and automated workflows.
Prerequisites
- Portkey API Key and Virtual Key from your Portkey dashboard.
- ToolJet Account with access to the Marketplace Plugin feature.
- Basic familiarity with ToolJet UI components.
Watch Demo
Watch this demo for a quick walkthrough on ToolJet’s UI components.
Before following this guide, ensure that you have completed the setup for using marketplace plugins in ToolJet.
Step-by-Step Onboarding
Install the Portkey Plugin from ToolJet Marketplace
- Go to ToolJet Dashboard > Plugins > Marketplace.
- Search for Portkey Plugin.
- Click Install to add the plugin to your project.
If Portkey has already been added to your marketplace, you can skip this step.
Configure the Portkey Plugin
- Navigate to Data Sources in your ToolJet workspace.
- Open Plugins.
- Click Add Portkey.
Add Portkey as a Datasource
- Enter the following details:
- Authorization: Your Portkey API Key
- Default Virtual Key: Your Portkey Virtual Key
- Test the connection to ensure the keys are configured correctly.
Use Portkey in Your ToolJet App
- Go to Queries > Add Datasource > Select Portkey Plugin.
- From the dropdown, Select an Operation (details in the next section).
- Run the query to verify it responds correctly.
Link the Query to UI Components (Example)
- Add Text Input and Button widgets to your app’s interface.
- Configure the Button’s onClick action to Execute Query using the Portkey API.
- Use a Text Box widget to display the query results.
Test and Deploy
- Use Preview Mode to test the interaction between your app’s UI and the Portkey API.
- Deploy the app from the ToolJet dashboard.
Supported Operations
Portkey supports the following operations within ToolJet:
Completion
Generates text completions based on a given prompt.
Parameters:
- Prompt: Input text to generate completions for.
- Model: The AI model to use.
- Max Tokens: Maximum number of tokens to generate.
- Temperature: Controls randomness.
- Stop Sequences: Sequences where the API stops generating further tokens.
- Metadata: Additional metadata for the request.
- Other Parameters: Additional request parameters.
For all operations, you can optionally specify:
- Config: Configuration options for the request.
- Virtual Key: Override the default virtual key with a specific one.
Troubleshooting
- Authentication Error
Double-check your API key and configuration.
- Slow Response
Adjust the temperature or max_tokens to optimize performance.
- CORS Issues
Ensure your API settings allow access from ToolJet’s domain.