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:
Evaluate your context
Learn how to evaluate the quality and effectiveness of your RAG context sources in Maxim for improved AI performance and accuracy.
Create an API-based Prompt Tool
Maxim allows you to expose external API endpoints as prompt tools. The platform automatically generates function schemas based on the API's query parameters and payload structure.