> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# parameters

> The parameters object for the SWAIG function.

The `parameters` object is used to define the input data that will be passed to the function.

## **Properties**

An object that accepts the following properties.

Defines the top-level type of the parameters. Must be set to `"object"`

An object containing the [properties](#properties) definitions to be passed to the function

The `properties` object defines the input data that will be passed to the function. It supports different types of parameters, each with their own set of configuration options. The property name is a key in the `properties` object that is user-defined. An object with dynamic property names, where:<ul><li>**Keys:** User-defined strings, that set the property name.</li><li>**Values:** Must be one of the valid [schema types](#schema-types). Learn more about valid schema types from the [JSON Schema documentation](https://json-schema.org/understanding-json-schema/reference)</li></ul>

### Schema Types

Each property in the `properties` object must use one of the following schema types:

The type of property the AI is passing to the function. Must be set to `"string"`

A description of the property

An array of strings that are the possible values

The default string value

Regular expression pattern for the string value to match

Whether the property can be null

```yaml
parameters:
  type: object
  properties:
    property_name:
      type: string
      description: A string value
      pattern: ^[a-z]+$
```

```json
{
  "parameters": {
    "type": "object",
    "properties": {
      "property_name": {
        "type": "string",
        "description": "A string value",
        "pattern": "^[a-z]+$"
      }
    }
  }
}
```

The type of parameter the AI is passing to the function. Must be set to `"integer"`

A description of the property

An array of integers that are the possible values

The default integer value

Whether the property can be null

```yaml
parameters:
  type: object
  properties:
    property_name:
      type: integer
      description: An integer value
      default: 10
```

```json
{
  "parameters": {
    "type": "object",
    "properties": {
      "property_name": {
        "type": "integer",
        "description": "An integer value",
        "default": 10
      }
    }
  }
}
```

The type of parameter the AI is passing to the function. Must be set to `"number"`

A description of the property

An array of numbers that are the possible values

The default number value

Whether the property can be null

```yaml
parameters:
  type: object
  properties:
    property_name:
      type: number
      description: A number value
      default: 10.5
```

```json
{
  "parameters": {
    "type": "object",
    "properties": {
      "property_name": {
        "type": "number",
        "description": "A number value",
        "default": 10.5
      }
    }
  }
}
```

The type of parameter the AI is passing to the function. Must be set to `"boolean"`

A description of the property

The default boolean value

Whether the property can be null

```yaml
parameters:
  type: object
  properties:
    property_name:
      type: boolean
      description: A boolean value
```

```json
{
  "parameters": {
    "type": "object",
    "properties": {
      "property_name": {
        "type": "boolean",
        "description": "A boolean value"
      }
    }
  }
}
```

The type of parameter(s) the AI is passing to the function. Must be set to `"array"`

A description of the property

An array of items. These items must be one of the valid [schema types](#schema-types)

The default array value

Whether the property can be null

```yaml
parameters:
  type: object
  properties:
    property_name:
      type: array
      description: Array of strings and objects
      items:
        - type: string
          description: A single string value that must be one of the possible values
          default: "one"
          enum:
            - "one"
            - "two"
            - "three"
        - type: object
          description: An object with a required property, `desired_value`, that must be one of the possible values
          required:
            - desired_value
          properties:
            desired_value:
              type: string
              description: A single string value that must be one of the possible values
              enum:
                - "four"
                - "five"
                - "six"
```

```json
{
  "parameters": {
    "type": "object",
    "properties": {
      "property_name": {
        "type": "array",
        "description": "Array of strings and objects",
        "items": [
          {
            "type": "string",
            "description": "A single string value that must be one of the possible values",
            "default": "one",
            "enum": [
              "one",
              "two",
              "three"
            ]
          },
          {
            "type": "object",
            "description": "An object with a required property, `desired_value`, that must be one of the possible values",
            "required": [
              "desired_value"
            ],
            "properties": {
              "desired_value": {
                "type": "string",
                "description": "A single string value that must be one of the possible values",
                "enum": [
                  "four",
                  "five",
                  "six"
                ]
              }
            }
          }
        ]
      }
    }
  }
}
```

The type of parameter(s) the AI is passing to the function. Must be set to `"object"`

A description of the property

An object that contains the [properties](#properties) definitions to be passed to the function.

The property names that are required for the `properties` object

The default object value

Whether the property can be null

```yaml
parameters:
  type: object
  properties:
    name:
      type: string
      description: The user's name
    age:
      type: integer
      description: The user's age
    address:
      type: object
      description: The user's address
      properties:
        street:
          type: string
          description: The user's street address
        city:
          type: string
          description: The user's city
      required:
        - street
        - city
```

```json
{
  "parameters": {
    "type": "object",
    "properties": {
      "name": {
        "type": "string",
        "description": "The user's name"
      },
      "age": {
        "type": "integer",
        "description": "The user's age"
      },
      "address": {
        "type": "object",
        "description": "The user's address",
        "properties": {
          "street": {
            "type": "string",
            "description": "The user's street address"
          },
          "city": {
            "type": "string",
            "description": "The user's city"
          }
        },
        "required": [
          "street",
          "city"
        ]
      }
    }
  }
}
```

Specifies that the data must be valid against exactly one of the provided schemas.

An array of schemas where exactly one must be valid.

The value must be a valid [schema type](#schema-types)

```yaml
parameters:
  type: object
  properties:
    property_name:
      oneOf:
        - type: string
          description: A string value
        - type: integer
          description: An integer value
```

```json
{
  "parameters": {
    "type": "object",
    "properties": {
      "property_name": {
        "oneOf": [
          {
            "type": "string",
            "description": "A string value"
          },
          {
            "type": "integer",
            "description": "An integer value"
          }
        ]
      }
    }
  }
}
```

Specifies that the data must be valid against all of the provided schemas.

An array of schemas where all must be valid.

The value must be a valid [schema type](#schema-types)

```yaml
parameters:
  type: object
  properties:
    property_name:
      allOf:
        - type: string
          description: A string value
        - type: integer
          description: An integer value
```

```json
{
  "parameters": {
    "type": "object",
    "properties": {
      "property_name": {
        "allOf": [
          {
            "type": "string",
            "description": "A string value"
          },
          {
            "type": "integer",
            "description": "An integer value"
          }
        ]
      }
    }
  }
}
```

Specifies that the data must be valid against at least one of the provided schemas.

An array of schemas where at least one must be valid.

The value must be a valid [schema type](#schema-types)

```yaml
parameters:
  type: object
  properties:
    property_name:
      anyOf:
        - type: string
          description: A string value
        - type: integer
          description: An integer value
```

```json
{
  "parameters": {
    "type": "object",
    "properties": {
      "property_name": {
        "anyOf": [
          {
            "type": "string",
            "description": "A string value"
          },
          {
            "type": "integer",
            "description": "An integer value"
          }
        ]
      }
    }
  }
}
```

Specifies an exact value that the data must match.

The value that will be set as a constant value for the property

```yaml
parameters:
  type: object
  properties:
    property_name:
      const: "constant_value"
```

```json
{
  "parameters": {
    "type": "object",
    "properties": {
      "property_name": {
        "const": "constant_value"
      }
    }
  }
}
```

Array of required property names from the `properties` object