Adding Tools

Adaline enables you to add tools to LLM that support function calling. Tools are part of the prompt and are sent to the LLM alongside your messages. You can add multiple tools in your prompt, each representing a unique external function and service that the LLM can invoke. To add tools, follow these steps:
1

Choose supported model

Select an appropriate model from dropdown that supports tool calling.Models Settings Pn
2

Access Tool Configuration

Navigate to the add tool button to open the tool editor.Models Settings Pn
3

Add your tool definition

Models Settings PnCreate your tool using the provided interface:
  • Enter the function name (e.g., get_windspeed)
  • Define variables with appropriate data types
  • Add descriptions for both the function and its parameters
  • Add optional request object to configure the tool’s HTTP request endpoint, headers, etc. When configured, the tool will be automatically invoked when the LLM generates a tool call in Playground.
4

Enable Tool Choice

Models Settings PnEnsure the ‘tool choice’ configuration parameter is properly set in your model settings to allow the LLM to generate tool calls effectively.Models Settings Pn
  • none instructs the LLM to not invoke any tools even though they’re available in the prompt
  • auto lets the LLM decide which tools to use and how many based on the conversation context
  • required forces the LLM to invoke at least one tool in its response.
For learning about “Tool Response” follow Tool Calling.

Tool Definition

Adaline supports tools with JSON schema format, giving you precise control over tool definitions and parameter validation.

JSON Schema Structure

Define your tool’s schema within the schema property of the tool definition. Refer to the OpenAI JSON schema for more examples.
JSON Schema Structure

{
  "type": "function",
  "definition": {
    "schema": {
      "name": "get_weather",
      "description": "Get the current weather in a given location",
      "parameters": {
        "type": "object",
        "properties": {
          "location": {
            "type": "string",
            "description": "The city and state, e.g. San Francisco, CA"
          },
          "unit": {
            "type": "string",
            "enum": [
              "celsius",
              "fahrenheit"
            ]
          }
        },
        "required": [
          "location"
        ]
      }
    }
  }
}

Schema Structure
  • Function Definition
    • type: Always set to “function” for tool definitions
    • schema: Contains the complete tool specification
  • Tool Metadata
    • name: The function name that the LLM will call
    • description: Clear explanation of what the tool does
  • Parameter Configuration
    • parameters.type: Defines the parameter structure (typically “object”)
    • properties: Individual parameter definitions with types and descriptions
    • required: Array of mandatory parameter names
    • additionalProperties: Set to false to restrict parameters to defined ones only
    • strict: Enables strict schema validation
This JSON approach provides more granular control over tool behavior and ensures precise parameter validation during execution.

Request Structure

Optionally, you can configure the tool’s HTTP request endpoint, headers, etc. When configured, the tool will be automatically invoked when the LLM generates a tool call in Playground. This automatically continues the conversation with the tool’s response in Playground until there are no more tool calls.
JSON Schema Structure
{
  "type": "function",
  "definition": {
    "schema": {
      "name": "get_weather",
      "description": "Get the current weather in a given location",
      "parameters": {
        "type": "object",
        "properties": {
          "location": {
            "type": "string",
            "description": "The city and state, e.g. San Francisco, CA"
          },
          "unit": {
            "type": "string",
            "enum": [
              "celsius",
              "fahrenheit"
            ]
          }
        },
        "required": [
          "location"
        ]
      }
    }
  },
  "request": {
    "type": "http",
    "method": "get",
    "url": "https://api.my-tool-backend.com/get_weather",
    "headers": {
      "Content-Type": "application/json",
      "Authorization": "Bearer <your-api-key>"
    },
    "retry": {
      "maxAttempts": 3,
      "initialDelay": 1000,
      "exponentialFactor": 2
    }
  }
}
Request Structure
  • Request Configuration
    • type: (required) ‘http’
    • method: (required) The HTTP method to use (GET or POST)
    • url: (required) The API endpoint to call
    • headers: (optional) The headers to send with the request
    • retry: (optional) The retry configuration
      • maxAttempts: (required if retry is enabled) The maximum number of retry attempts
      • initialDelay: (required if retry is enabled) The initial delay between retry attempts
      • exponentialFactor: (required if retry is enabled) The exponential factor for the retry delay