Skip to main content
All CollectionsTools
Function Calling in Promptitude: What You Need to Know
Function Calling in Promptitude: What You Need to Know
Promptitude Team avatar
Written by Promptitude Team
Updated this week

In the world of B2B SaaS and AI, Promptitude Tools are your new best friend. These tools, also known as function calling, are designed to make your interactions with AI more efficient and effective. Whether you're looking to automate tasks, streamline processes, or simply make your life easier, understanding how to use these tools can be a game-changer.

In this article, we'll explore what Promptitude Tools are, how you can use function calling, important considerations, best practices for defining functions, and the concept of tokens. Let's dive in!

What Are Promptitude Tools?

Promptitude Tools are essentially a way to enhance your interaction with AI by allowing you to call specific functions or actions. Think of them as shortcuts that help you get the AI to perform tasks more efficiently. Instead of giving the AI a long list of instructions, you can use these tools to trigger specific actions directly. This not only saves time but also ensures that the AI performs tasks accurately and consistently.

How Can You Use Function Calling?

Using function calling with Promptitude tools is having a direct line to the AI's capabilities. Here's how you can make the most of it:

  1. Identify the Task: Start by identifying the task you want the AI to perform. This could be anything from generating a report to sending an email.

  2. Select the Appropriate Tool: Once you've identified the task, select the appropriate tool from the Promptitude tools. This tool will act as a command that tells the AI exactly what to do.

  3. Execute With the tool selected, execute it to see the AI perform the task. This process is quick and efficient, allowing you to focus on more important aspects of your work.

📌 Best Practices for Defining Functions

To get the most out of Promptitude tools, it's important to follow some best practices when defining functions:

  • Be Specific: Clearly define what you want the function to do. The more specific you are, the better the AI will perform the task.

  • Keep It Simple: Avoid overcomplicating tools. Simple, straightforward functions are easier for the AI to execute accurately.

  • Test and Iterate: Test your tools to ensure they work as expected. Don't be afraid to make adjustments and improvements as needed.

1️⃣ Write clear and detailed function names, parameter descriptions, and instructions.

  • Clearly Define Purpose and Parameters: Explicitly describe what the tool is designed to do.

Tool description

Tool description

🔹 Examples:

Good tool:

"name": "get_stock_price", "description": "Retrieves the current stock price for a given ticker symbol. The ticker symbol must be a valid symbol for a publicly traded company on a major US stock exchange like NYSE or NASDAQ. The tool will return the latest trade price in USD. It should be used when the user asks about the current or most recent price of a specific stock. It will not provide any other information about the stock or company.",

Parameters: "ticker": { "description": "The stock ticker symbol, e.g. AAPL for Apple Inc." }

Bad tool:

"name": "get_stock_price", "description": "Gets the stock price for a ticker.", "ticker": { description: “” }

  • Set Usage Guidelines in the System Prompt: Use the system prompt to outline when each function should (and shouldn’t) be used. Be as specific as possible, giving the model precise instructions on how to handle different scenarios.

  • Include Examples and Edge Cases: Provide practical examples that showcase typical use cases and any known edge cases. These examples help address recurring issues and guide the model toward better performance. (Note: For reasoning models, adding examples can sometimes impact performance negatively, so test thoroughly to find the right balance.)

2️⃣ Apply software engineering best practices.

  • Make Functions Obvious and Easy to Use: Functions should follow the "principle of least surprise." They should be self-explanatory, with clear naming conventions and straightforward usage, leaving no room for misinterpretation.

  • Define Allowed Values Clearly: Use options to specify acceptable values. This approach prevents invalid inputs and reduces the likelihood of the AI generating incorrect or "hallucinated" results.

  • Pass the Intern Test: Imagine giving your function to an intern or a new team member. Could they use it correctly based solely on the instructions you’ve provided? If they have questions, note them and incorporate the answers into the function description to ensure clarity.

3️⃣ Keep the number of functions small for higher accuracy.

  • Prioritize a Minimal Set of Functions: Reducing the number of tools helps the AI process instructions more effectively and minimizes potential confusion.

  • A Practical Guideline: While there’s no hard limit, aiming for fewer than 20 active functions at any time is a good starting point. This approach keeps the system streamlined without sacrificing flexibility.


How Do Tokens Affect Function Calling?

When you use tools in an AI system, they are embedded into the system message in a format the AI understands. Here’s what you need to know:

  • Context Limits: Every tool you call counts against the model's context limit, which is the maximum number of tokens the AI can process in a single interaction. Exceeding this limit can result in truncated responses or errors.

  • Billing: Tools are billed as input tokens, meaning their usage directly impacts your operational costs. The more tokens your tool consume, the higher the cost.

📌 Best Practices for Managing Token Usage

To get the most out of your AI interactions while staying within limits, consider these strategies:

  • Limit the Number of Tools: Using fewer tools reduces token usage. Prioritize essential functions and streamline your approach.

  • Simplify Descriptions: Keep your function parameter descriptions concise. Provide just enough detail for the AI to understand the task without overloading the context.

  • Monitor Usage: Regularly check your token consumption to identify inefficiencies and adjust your functions accordingly.

🔑 Key Considerations

When managing token usage, it’s important to keep the following in mind:

  1. Function Design: Well-structured and concise tools help the AI interpret your instructions accurately.

  2. Token Trade-Offs: Balancing detail and brevity is crucial. Avoid overloading the context while ensuring clarity.

Promptitude Tools are a powerful way to enhance your interaction with AI, making it easier to perform tasks and achieve your goals. By understanding how to use Tools, considering important factors, following best practices, and being mindful of tokens, you can unlock the full potential of these tools.

Remember, the key is to be clear, concise, and consistent in your approach. With a little practice, you'll be a pro at using Promptitude tools to streamline your work and boost productivity.

Happy prompting!

Did this answer your question?