AppFunctionSchemaDefinition


@Retention(value = AnnotationRetention.BINARY)
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation AppFunctionSchemaDefinition


Marks an interface as a pre-defined schema for an App Function.

The provided metadata will be stored in AppSearch when indexing App Functions. Agents can then retrieve this metadata as an AppFunctionSchemaMetadata object by calling AppFunctionManagerCompat.observeAppFunctions. Agent developers can define and share these annotated App Function schemas as an SDK with app developers.

A pre-defined schema outlines an App Function's capabilities, including its parameters and return type. Knowing the schema in advance allows agents to perform tasks like model fine-tuning for more accurate function calling.

For example, here's how you might define a findNotes function schema:

@AppFunctionSchemaDefinition(name = "findNotes", version = 1, category = "Notes")
interface FindNotesSchema {
suspend fun findNotes(
appFunctionContext: AppFunctionContext,
params: FindNotesParams,
):
List<Note>
}

Summary

Public constructors

AppFunctionSchemaDefinition(name: String, version: Int, category: String)

Public properties

String

The category of the schema.

String

The name of the schema.

Int

The version of the schema.

Public constructors

AppFunctionSchemaDefinition

AppFunctionSchemaDefinition(name: String, version: Int, category: String)

Public properties

category

val categoryString

The category of the schema.

name

val nameString

The name of the schema.

version

val versionInt

The version of the schema.