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

*** ** * ** ***


```
public interface A2uiFunctionDefinition
```

<br />

*** ** * ** ***

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

## Summary

| ### Public methods |
|---|---|
| `default boolean` | `https://developer.android.com/reference/androidx/a2ui/model/catalog/A2uiFunctionDefinition#getAcceptsUnresolvedArguments()()` 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). |
| `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/a2ui/model/schema/A2uiSchema` | `https://developer.android.com/reference/androidx/a2ui/model/catalog/A2uiFunctionDefinition#getArgumentSchema()()` The schema of the arguments expected by the component. |
| `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/a2ui/model/catalog/A2uiFunctionDefinition#getDescription()()` Describes the function behavior so the AI agent knows when to use it. |
| `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/a2ui/model/catalog/A2uiFunctionDefinition#getName()()` Function name that would be provided to the AI agent. |
| `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/a2ui/model/catalog/A2uiFunctionReturnType` | `https://developer.android.com/reference/androidx/a2ui/model/catalog/A2uiFunctionDefinition#getReturnType()()` The type of the value returned by the function. |

| ### Extension functions |
|---|---|
| `default final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/a2ui/model/schema/A2uiSchema` | `https://developer.android.com/reference/androidx/a2ui/model/catalog/A2uiFunctionDefinitionKt.https://developer.android.com/reference/androidx/a2ui/model/catalog/A2uiFunctionDefinition#(androidx.a2ui.model.catalog.A2uiFunctionDefinition).toSchema()( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/a2ui/model/catalog/A2uiFunctionDefinition receiver )` Converts this function definition into an `https://developer.android.com/reference/androidx/a2ui/model/schema/A2uiSchema`. |

## Public methods

### getAcceptsUnresolvedArguments

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

```
default boolean getAcceptsUnresolvedArguments()
```

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/androidx/a2ui/model/catalog/A2uiFunction#execute(kotlin.collections.Map,androidx.a2ui.model.protocol.A2uiExecutionContext)`, allowing the function to execute with the remaining resolved arguments.

### getArgumentSchema

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

```
abstract @NonNull A2uiSchema getArgumentSchema()
```

The schema of the arguments expected by the component.

### getDescription

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

```
abstract @NonNull String getDescription()
```

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

### getName

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

```
abstract @NonNull String getName()
```

Function name that would be provided to the AI agent.

### getReturnType

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

```
abstract @NonNull A2uiFunctionReturnType getReturnType()
```

The type of the value returned by the function.

## Extension functions

### A2uiFunctionDefinitionKt.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)

```
default final @NonNull A2uiSchema A2uiFunctionDefinitionKt.toSchema(
    @NonNull A2uiFunctionDefinition receiver
)
```

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

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