Skip to main content

What is Function Calling?

Function calling enables your AI agents to execute real-time actions during conversations by calling external APIs and triggering workflows.

Capabilities

API Integration

Connect to external APIs and services

Function Examples

Ready-to-use function examples for common use cases

Best Practices

Tips for reliable and secure function calling

Testing Functions

How to test and debug custom functions

How It Works

1

AI Reads Function

The AI understands what the function does from its description
2

Detects Trigger

Based on conversation, AI decides when to call the function
3

Extracts Parameters

AI collects required parameters from the conversation
4

Executes API Call

Dialgen makes the HTTP request to your endpoint
5

Returns Response

API response feeds back to AI for natural continuation

Quick Example

{
  "name": "check_order_status",
  "description": "Checks the customer's order status. Call this when the customer asks about their order, delivery, or tracking.",
  "parameters": {
    "type": "object",
    "properties": {
      "order_id": {
        "type": "string",
        "description": "The order number"
      }
    },
    "required": ["order_id"]
  },
  "api_endpoint": "https://api.yourcompany.com/orders/status",
  "http_method": "POST"
}
The description is critical. The AI relies on it to know when to trigger the function.

Use Cases

CRM Integration

Update customer records, add notes, change lead status.

Appointment Booking

Check availability and book appointments in real-time.

Order Management

Check order status, process returns, track shipments.

Payment Processing

Process payments, check balances, send invoices.

Data Retrieval

Fetch customer data, account information, product details.

Next Steps

API Integration

Learn how to integrate external APIs

Examples

View ready-to-use function examples