Skip to content

Function Calling

Function Calling is a feature that allows you to call external APIs from your Voker deployments.

  1. Start by creating a new function.
    • Specify the API Endpoint
      • Enter the full URL of the API
      • Choose the correct HTTP method (GET, POST)
    • Define the inputs
      • Define all required inputs for the API, including
        • Query parameters
        • Headers
        • Body
      • For each input, specify:
        • Name
        • Input type (static, input, function parameter)
          • For any input marked as a function parameter, be sure to add a clear description — this is what the LLM sees when deciding how to fill in values.
          • If it’s a body field, also specify the type (e.g., text, whole number, etc.)
Function calling config Function calling config
  1. Run a Test Execute to validate the function.
    • Make sure the LLM is collecting the correct information from the conversation (e.g., query parameters, headers, or body fields) needed to make the API call.
    • Note: This works alongside other functions such as Internet Search.
Function calling in action Function calling in action
  1. Verify that the function is called successfully.
    • Once the function is triggered, a collapsed section will appear in the chat showing the function call details.
    • In the input section, you should see the function name and all provided inputs.
    • In the output section, you should see the API response.
Function calling conversation Function calling conversation

Our UI allows you to configure HTTP requests for LLM powered function calling with the following structures:

Function calling UI Function calling UI
  • HTTP Method: Select from GET, POST, PUT, or PATCH.
  • URL and Path Parameters: Enter the base URL (e.g., https://api.example.com). Add path parameters using the “Add Path Param” button, which inserts placeholders like {param_name} into the URL. These can be static values, bound to inputs, or function parameters filled by the LLM.
  • Query Parameters: Add key-value pairs that will be appended to the URL as query strings (e.g., ?key=value). Each can be:
    • Static: A fixed key and value. (e.g. API token)
    • Input Binding: Bound to a specified Voker agent input.
    • Function Parameter: A key with a value provided by the LLM, including a description for the LLM to understand its purpose.
  • Headers: Similar to query parameters, add key-value pairs for headers.
  • Body Parameters: Configure the request body as either an object {} or an array [] of objects (toggle via the “Array” button).
    • Each body item is a flat key-value pair, with the same options as headers and query params (static, input binding, or function parameter).
    • For function parameters in the body, specify the data type: Text (string), Whole Number (integer), Decimal Number (number), or True/False (boolean).
    • Note: Nested objects or arrays within the body are not currently supported. The body is limited to a flat structure or an array of flat objects.

Example HTTP Requests for Function Calling

a11y.sectionLink Example HTTP Requests for Function Calling

✅ Supported: Flat Object in Body

a11y.sectionLink ✅ Supported: Flat Object in Body

This example shows a valid POST request with a flat object in the body, including static headers/ path parameters.

Terminal window
curl -X POST \
'https://api.example.com?filter=active' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer abc123' \
-d '{
"name": "John Doe",
"age": 30,
"is_active": true
}'

This example shows a valid POST request with an array of flat objects in the body, including static headers and a query parameter.

Terminal window
curl -X POST \
'https://api.example.com/users?status=active' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer xyz789' \
-d '[
{
"id": 1,
"name": "Jane Smith",
"role": "developer"
}
]'

❌ Not Supported: Nested Object in Body

a11y.sectionLink ❌ Not Supported: Nested Object in Body

This example shows a POST request with a nested object in the body, which is not supported on out platform.

Terminal window
curl -X POST \
'https://api.example.com/users/12345' \
-H 'Content-Type: application/json' \
-d '{
"name": "John Doe",
"details": {
"age": 30,
"address": {
"street": "123 Main St",
"city": "Anytown"
}
},
"is_active": true
}'