# FunctionSchema


```
class FunctionSchema
```

<br />

*** ** * ** ***

Defines the schema of parameters or responses for a tool.

## Summary

| ### Public constructors |
|---|
| `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionSchema#FunctionSchema(kotlin.Int,kotlin.String,kotlin.collections.Map,kotlin.collections.List,kotlin.collections.List,kotlin.String,kotlin.Boolean,com.google.mlkit.genai.schema.tools.FunctionSchema,kotlin.Long,kotlin.Long,kotlin.Double,kotlin.Double,kotlin.Long,kotlin.Long,kotlin.String,kotlin.collections.List,kotlin.String,kotlin.Long,kotlin.Long)( @https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionType type: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html, description: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?, properties: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionSchema>?, required: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html>?, enum: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html>?, format: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?, nullable: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html?, items: https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionSchema?, minItems: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html?, maxItems: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html?, minimum: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html?, maximum: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html?, minLength: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html?, maxLength: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html?, pattern: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?, anyOf: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionSchema>?, title: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?, minProperties: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html?, maxProperties: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html? )` |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionSchema#equals(kotlin.Any)(other: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionSchema#hashCode()()` |
| `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionSchema#toString()()` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionSchema>?` | `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionSchema#anyOf()` optional list of subschemas that the value must validate against at least one of |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?` | `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionSchema#description()` optional human-readable description of the schema used by the model |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html>?` | `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionSchema#enum()` optional list of allowed values for `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionType#STRING()` or numeric types |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?` | `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionSchema#format()` optional format of the data type (e.g., "float", "double", "int32", "int64") |
| `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionSchema?` | `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionSchema#items()` optional schema of items in an array for `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionType#ARRAY()` type |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html?` | `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionSchema#maxItems()` optional maximum number of items for `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionType#ARRAY()` type |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html?` | `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionSchema#maxLength()` optional maximum length for `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionType#STRING()` type |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html?` | `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionSchema#maxProperties()` optional maximum number of properties for `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionType#OBJECT()` type |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html?` | `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionSchema#maximum()` optional maximum value for numeric types |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html?` | `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionSchema#minItems()` optional minimum number of items for `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionType#ARRAY()` type |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html?` | `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionSchema#minLength()` optional minimum length for `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionType#STRING()` type |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html?` | `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionSchema#minProperties()` optional minimum number of properties for `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionType#OBJECT()` type |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html?` | `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionSchema#minimum()` optional minimum value for numeric types |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html?` | `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionSchema#nullable()` optional boolean indicating whether the value may be null |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?` | `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionSchema#pattern()` optional regex pattern that string values must match |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionSchema>?` | `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionSchema#properties()` optional map of property names to their respective `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionSchema` definitions for `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionType#OBJECT()` type |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html>?` | `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionSchema#required()` optional list of property names that must be present for `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionType#OBJECT()` type |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?` | `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionSchema#title()` optional title for the schema |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionSchema#type()` the data type of the schema, must be one of the constants defined in `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionType` |

## Public constructors

### FunctionSchema

```
FunctionSchema(
    @FunctionType type: Int,
    description: String? = null,
    properties: Map<String, FunctionSchema>? = null,
    required: List<String>? = null,
    enum: List<String>? = null,
    format: String? = null,
    nullable: Boolean? = null,
    items: FunctionSchema? = null,
    minItems: Long? = null,
    maxItems: Long? = null,
    minimum: Double? = null,
    maximum: Double? = null,
    minLength: Long? = null,
    maxLength: Long? = null,
    pattern: String? = null,
    anyOf: List<FunctionSchema>? = null,
    title: String? = null,
    minProperties: Long? = null,
    maxProperties: Long? = null
)
```

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

```
open fun hashCode(): Int
```

### toString

```
open fun toString(): String
```

## Public properties

### anyOf

```
val anyOf: List<FunctionSchema>?
```

optional list of subschemas that the value must validate against at least one of

### description

```
val description: String?
```

optional human-readable description of the schema used by the model

### enum

```
val enum: List<String>?
```

optional list of allowed values for `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionType#STRING()` or numeric types

### format

```
val format: String?
```

optional format of the data type (e.g., "float", "double", "int32", "int64")

### items

```
val items: FunctionSchema?
```

optional schema of items in an array for `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionType#ARRAY()` type

### maxItems

```
val maxItems: Long?
```

optional maximum number of items for `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionType#ARRAY()` type

### maxLength

```
val maxLength: Long?
```

optional maximum length for `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionType#STRING()` type

### maxProperties

```
val maxProperties: Long?
```

optional maximum number of properties for `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionType#OBJECT()` type

### maximum

```
val maximum: Double?
```

optional maximum value for numeric types

### minItems

```
val minItems: Long?
```

optional minimum number of items for `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionType#ARRAY()` type

### minLength

```
val minLength: Long?
```

optional minimum length for `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionType#STRING()` type

### minProperties

```
val minProperties: Long?
```

optional minimum number of properties for `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionType#OBJECT()` type

### minimum

```
val minimum: Double?
```

optional minimum value for numeric types

### nullable

```
val nullable: Boolean?
```

optional boolean indicating whether the value may be null

### pattern

```
val pattern: String?
```

optional regex pattern that string values must match

### properties

```
val properties: Map<String, FunctionSchema>?
```

optional map of property names to their respective `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionSchema` definitions for `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionType#OBJECT()` type

### required

```
val required: List<String>?
```

optional list of property names that must be present for `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionType#OBJECT()` type

### title

```
val title: String?
```

optional title for the schema

### type

```
val type: Int
```

the data type of the schema, must be one of the constants defined in `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/schema/tools/FunctionType`