# A2uiFunctionDefinition

Artifact: [androidx.a2ui:a2ui-model](https://developer.android.com/jetpack/androidx/releases/a2ui) [View Source](https://cs.android.com/search?q=file:androidx/a2ui/model/catalog/A2uiFunctionDefinition.kt+class:androidx.a2ui.model.catalog.A2uiFunctionDefinition) Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

*** ** * ** ***


```
interface A2uiFunctionDefinition
```

<br />

*** ** * ** ***

Represents the definition and schema of a function supported by A2UI.

## Summary

| ### Public properties |
|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/catalog/A2uiFunctionDefinition#acceptsUnresolvedArguments()` Indicates if this function should execute even if some of its data-bound arguments cannot be resolved (e.g., data is not yet available for a dynamic property). |
| `https://developer.android.com/reference/kotlin/androidx/a2ui/model/schema/A2uiSchema` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/catalog/A2uiFunctionDefinition#argumentSchema()` The schema of the arguments expected by the component. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/catalog/A2uiFunctionDefinition#description()` Describes the function behavior so the AI agent knows when to use it. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/catalog/A2uiFunctionDefinition#name()` Function name that would be provided to the AI agent. |
| `https://developer.android.com/reference/kotlin/androidx/a2ui/model/catalog/A2uiFunctionReturnType` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/catalog/A2uiFunctionDefinition#returnType()` The type of the value returned by the function. |

| ### Extension functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/a2ui/model/schema/A2uiSchema` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/catalog/A2uiFunctionDefinition.https://developer.android.com/reference/kotlin/androidx/a2ui/model/catalog/A2uiFunctionDefinition#(androidx.a2ui.model.catalog.A2uiFunctionDefinition).toSchema()()` Converts this function definition into an `https://developer.android.com/reference/kotlin/androidx/a2ui/model/schema/A2uiSchema`. |

## Public properties

### acceptsUnresolvedArguments

Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

```
open val acceptsUnresolvedArguments: Boolean
```

Indicates if this function should execute even if some of its data-bound arguments cannot be resolved (e.g., data is not yet available for a dynamic property).

When false (default), if any argument cannot be resolved, evaluation halts and returns null indicating to the component that it should wait in a loading state.

When true, arguments whose data bindings cannot be resolved are omitted from the arguments map passed to `https://developer.android.com/reference/kotlin/androidx/a2ui/model/catalog/A2uiFunction#execute(kotlin.collections.Map,androidx.a2ui.model.protocol.A2uiExecutionContext)`, allowing the function to execute with the remaining resolved arguments.

### argumentSchema

Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

```
val argumentSchema: A2uiSchema
```

The schema of the arguments expected by the component.

### description

Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

```
val description: String
```

Describes the function behavior so the AI agent knows when to use it.

### name

Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

```
val name: String
```

Function name that would be provided to the AI agent.

### returnType

Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

```
val returnType: A2uiFunctionReturnType
```

The type of the value returned by the function.

## Extension functions

### A2uiFunctionDefinition.toSchema

Artifact: [androidx.a2ui:a2ui-model](https://developer.android.com/jetpack/androidx/releases/a2ui) [View Source](https://cs.android.com/search?q=file:androidx/a2ui/model/catalog/A2uiFunctionDefinition.kt+function:toSchema)

```
fun A2uiFunctionDefinition.toSchema(): A2uiSchema
```

Converts this function definition into an `https://developer.android.com/reference/kotlin/androidx/a2ui/model/schema/A2uiSchema`.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/a2ui/model/schema/A2uiSchema` | the `https://developer.android.com/reference/kotlin/androidx/a2ui/model/schema/A2uiSchema` representation of this function definition |