How toPrompt Tools
Create a code-based Prompt Tool
Code-based Prompt Tools allow you to create custom functions directly within the editor. This guide will show you how to create and test these tools.
Creating a code-based tool
Go to the left navigation bar and click on the "Prompts Tools" tab.
On the Prompt Tools page, click the + button.
Select "Code" as the tool type and click "Create".
Write your custom function in JavaScript in the code editor.
Code editor interface
The interface provides:
- A code editor for writing your function
- An input panel on the right for testing
- A console at the bottom to view outputs
Example: Travel price calculator
Here's an example of a prompt tool that calculates travel fares between cities: