> This page is for SWML.

> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes.

# 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**

**`functions[].parameters`** `object`

An object that accepts the following properties.

---

**`parameters.type`** `string` — required

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

---

**`parameters.properties`** `object` — required

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

---

**`properties.{property_name}`** `object` — required

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:

* **Keys:** User-defined strings, that set the property name.
* **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)

---

### Schema Types

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

#### string

**`{property_name}.type`** `string` — required

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

---

**`{property_name}.description`** `string`

A description of the property

---

**`{property_name}.enum`** `string[]`

An array of strings that are the possible values

---

**`{property_name}.default`** `string`

The default string value

---

**`{property_name}.pattern`** `string`

Regular expression pattern for the string value to match

---

**`{property_name}.nullable`** `boolean` — default: false

Whether the property can be null

---

#### YAML

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

#### JSON

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

#### integer

**`{property_name}.type`** `string` — required

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

---

**`{property_name}.description`** `string`

A description of the property

---

**`{property_name}.enum`** `integer[]`

An array of integers that are the possible values

---

**`{property_name}.default`** `integer`

The default integer value

---

**`{property_name}.nullable`** `boolean` — default: false

Whether the property can be null

---

#### YAML

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

#### JSON

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

#### number

**`{property_name}.type`** `string` — required

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

---

**`{property_name}.description`** `string`

A description of the property

---

**`{property_name}.enum`** `number[]`

An array of numbers that are the possible values

---

**`{property_name}.default`** `number`

The default number value

---

**`{property_name}.nullable`** `boolean` — default: false

Whether the property can be null

---

#### YAML

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

#### JSON

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

#### boolean

**`{property_name}.type`** `string` — required

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

---

**`{property_name}.description`** `string`

A description of the property

---

**`{property_name}.default`** `boolean`

The default boolean value

---

**`{property_name}.nullable`** `boolean` — default: false

Whether the property can be null

---

#### YAML

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

#### JSON

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

#### array

**`{property_name}.type`** `string` — required

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

---

**`{property_name}.description`** `string`

A description of the property

---

**`{property_name}.items`** `object` — required

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

---

**`{property_name}.default`** `array`

The default array value

---

**`{property_name}.nullable`** `boolean` — default: false

Whether the property can be null

---

#### YAML

```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

```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"
                ]
              }
            }
          }
        ]
      }
    }
  }
}
```

#### object

**`{property_name}.type`** `string` — required

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

---

**`{property_name}.description`** `string`

A description of the property

---

**`{property_name}.properties`** `object`

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

---

**`{property_name}.required`** `string[]`

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

---

**`{property_name}.default`** `object`

The default object value

---

**`{property_name}.nullable`** `boolean` — default: false

Whether the property can be null

---

#### YAML

```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

```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"
        ]
      }
    }
  }
}
```

#### oneOf

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

**`{property_name}.oneOf`** `array` — required

An array of schemas where exactly one must be valid.

---

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

#### YAML

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

#### JSON

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

#### allOf

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

**`{property_name}.allOf`** `array` — required

An array of schemas where all must be valid.

---

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

#### YAML

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

#### JSON

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

#### anyOf

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

**`{property_name}.anyOf`** `array` — required

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

---

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

#### YAML

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

#### JSON

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

#### const

Specifies an exact value that the data must match.

**`{property_name}.const`** `any` — required

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

---

#### YAML

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

#### JSON

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

**`parameters.required`** `string[]`

Array of required property names from the `properties` object

---