透過集合功能整理內容
你可以依據偏好儲存及分類內容。
appfunctions
TODO
最近更新時間 |
穩定版 |
候選版 |
Beta 版 |
Alpha 版 |
2025 年 8 月 13 日 |
- |
- |
- |
1.0.0-alpha03 |
宣告依附元件
如要新增 appfunctions 的依附元件,必須將 Google Maven 存放區新增至專案。詳情請參閱 Google 的 Maven 存放區。
在應用程式或模組的 build.gradle
檔案中,新增所需構件的依附元件:
Groovy
dependencies {
implementation "androidx.appfunctions:appfunctions:1.0.0-alpha03"
implementation "androidx.appfunctions:appfunctions-service:1.0.0-alpha03"
implementation "androidx.appfunctions:appfunctions-compiler:1.0.0-alpha03"
}
Kotlin
dependencies {
implementation("androidx.appfunctions:appfunctions:1.0.0-alpha03")
implementation("androidx.appfunctions:appfunctions-service:1.0.0-alpha03")
implementation("androidx.appfunctions:appfunctions-compiler:1.0.0-alpha03")
}
如要進一步瞭解依附元件,請參閱「新增建構依附元件」一文。
意見回饋
您的意見可協助我們改善 Jetpack。如果您發現新問題,或是有改進這個程式庫的建議,請告訴我們。回報新問題前,請先查看這個程式庫的現有問題。只要按一下星號按鈕,即可投票給現有的問題。
建立新問題
詳情請參閱 Issue Tracker 文件。
這個構件沒有任何版本資訊。
1.0 版本
1.0.0-alpha03 版本
2025 年 8 月 13 日
發布 androidx.appfunctions:appfunctions-*:1.0.0-alpha03
。1.0.0-alpha03 版包含這些修訂項目。
新功能
- 使用 KDoc 做為
AppFunction
說明
- 使用
AppFunctionIntValueConstraint
和 AppFunctionStringValueConstraint
註解,分別限制 Int 和 String 類型的值。
- 為大型語言模型指定自然語言說明,以及在代理程式應用程式中顯示的使用者可見說明。
- 使用
AppFunctionUriGrant
類別,自動授予從應用程式函式傳回的 URI 權限。
- 使用
AppFunctionTestRule
編寫 Robolectric 測試,測試應用程式函式設定。
API 變更
- 新增
AppFunctionStringValueConstraint
(I10e3f)
- 新增
AppFunctionIntValueConstraint
(Ifda13)
- 將
AppFunctionPrimitiveTypeMetadata
重構為特定資料類型類別。(I1a3b2)
- 在
AppFunctionResponseMetadata
中新增說明欄位 (I2332b)
- 從
setAppFunctionEnabled
API 移除權限規定 (I1b92a)
- 在
AppFunctionParameterMetadata
中新增說明欄位 (I40a67)
- 新增
AppFunctionUriGrant
(I67ca9)
- 新增
resolveAppFunctionAppMetadata
API。(I17408)
- 在
@AppFunctionSerializable
註解中新增 isDescribedByKdoc
(Ie14e7)
- 在
AppFunctionDataTypeMetadata
中新增說明欄位 (I1bcac)
- 從
observeAppFunctions
API 傳回 AppPackageMetadata
。(I68c7e)
- 在
AppFunctionMetadata
(I060e2) 中新增說明欄位
- 新增
AppFunctionTestRule
(Id5ed0)
- 在
@AppFunction
註解中新增 isDescribedByKdoc
(Ia84d2)
修正錯誤
AppFunctionManagerCompat
僅支援 U+ 裝置 (Ifa8d0)
- 在
AppFunction
的中繼資料 XML (I2aab2) 中,新增共用可序列化型別的屬性說明
- 在產生的
AppFunction
中繼資料 XML (Ie5bf6) 中新增說明元素
1.0.0-alpha02 版
2025 年 6 月 4 日
發布 androidx.appfunctions:appfunctions:1.0.0-alpha02
、androidx.appfunctions:appfunctions-compiler:1.0.0-alpha02
和 androidx.appfunctions:appfunctions-service:1.0.0-alpha02
。1.0.0-alpha02 版包含這些修訂項目。
新功能
- 支援 Android 16 API。
- 在編譯期間更妥善地支援參數化
AppFunctionSerializable(s)
。
API 變更
- 推出
AppFunctionSchemaDefinition
API,讓代理程式定義自己的預先定義函式結構定義。
修正錯誤
- 處理
AppFunctions
缺少執行階段啟用狀態的錯誤。
- 修正
observeAppFunctions
API 中的小錯誤,以觀察 AppFunctionComponentMetadata
的變化。
- 其他錯誤記錄。
1.0.0-alpha01 版
2025 年 5 月 7 日
發布 androidx.appfunctions:appfunctions:1.0.0-alpha01
、androidx.appfunctions:appfunctions-compiler:1.0.0-alpha01
和 androidx.appfunctions:appfunctions-service:1.0.0-alpha01
。1.0.0-alpha01 版包含這些修訂項目。
新功能
AppFunctions
Jetpack 程式庫是以 android.app.appfunctions
平台 API 為基礎建構而成。這個程式庫可簡化向 Google 助理公開應用程式功能的方式,並允許 Google 助理與應用程式公開的功能互動。
androidx.appfunctions:appfunctions
:用於管理 (啟用/停用) 和與 AppFunctions
互動 (搜尋/執行) 的核心用戶端 API。
androidx.appfunctions:appfunctions-service
:服務端 API,可輕鬆將應用程式功能公開為 AppFunctions
。
androidx.appfunctions:appfunctions-compiler
:這是必要的 KSP 編譯器,可產生公開 AppFunctions
所需的程式碼。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-08-13 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-08-13 (世界標準時間)。"],[],[],null,["# appfunctions\n============\n\nAPI Reference \n[androidx.appfunctions](/reference/kotlin/androidx/appfunctions/package-summary) \nTODO \n\n| Latest Update | Stable Release | Release Candidate | Beta Release | Alpha Release |\n|-----------------|----------------|-------------------|--------------|------------------------------------------------------------------------|\n| August 13, 2025 | - | - | - | [1.0.0-alpha03](/jetpack/androidx/releases/appfunctions#1.0.0-alpha03) |\n\nDeclaring dependencies\n----------------------\n\nTo add a dependency on appfunctions, you must add the Google Maven repository to your\nproject. Read [Google's Maven repository](/studio/build/dependencies#google-maven)\nfor more information.\n\nAdd the dependencies for the artifacts you need in the `build.gradle` file for\nyour app or module: \n\n### Groovy\n\n```groovy\ndependencies {\n implementation \"androidx.appfunctions:appfunctions:1.0.0-alpha03\"\n implementation \"androidx.appfunctions:appfunctions-service:1.0.0-alpha03\"\n implementation \"androidx.appfunctions:appfunctions-compiler:1.0.0-alpha03\"\n}\n```\n\n### Kotlin\n\n```kotlin\ndependencies {\n implementation(\"androidx.appfunctions:appfunctions:1.0.0-alpha03\")\n implementation(\"androidx.appfunctions:appfunctions-service:1.0.0-alpha03\")\n implementation(\"androidx.appfunctions:appfunctions-compiler:1.0.0-alpha03\")\n}\n```\n\nFor more information about dependencies, see [Add build dependencies](/studio/build/dependencies).\n\nFeedback\n--------\n\nYour feedback helps make Jetpack better. Let us know if you discover new issues or have\nideas for improving this library. Please take a look at the\n[existing issues](https://issuetracker.google.com/issues?q=componentid:1709065%20status:open)\nin this library before you create a new one. You can add your vote to an existing issue by\nclicking the star button.\n\n[Create a new issue](https://issuetracker.google.com/issues/new?component=1709065&template=2081773)\n\nSee the [Issue Tracker documentation](https://developers.google.com/issue-tracker)\nfor more information.\n\nThere are no release notes for this artifact.\n\nVersion 1.0\n-----------\n\n### Version 1.0.0-alpha03\n\nAugust 13, 2025\n\n`androidx.appfunctions:appfunctions-*:1.0.0-alpha03` is released. Version 1.0.0-alpha03 contains [these commits](https://android.googlesource.com/platform/frameworks/support/+log/0fc7aad34811cf94484effd29bc2696bb001758f/appfunctions).\n\n**New Features**\n\n- Use KDoc(s) as `AppFunction` descriptions\n- Restrict values for Int and String types using `AppFunctionIntValueConstraint` and `AppFunctionStringValueConstraint` annotations, respectively.\n- Specify a natural language description for large language models and a user visible description displayed within agent apps.\n- Automatically grant permissions to URI(s) returned from an app function using `AppFunctionUriGrant` class.\n- Write Robolectric tests using `AppFunctionTestRule` for testing your app function setup.\n\n**API Changes**\n\n- Add `AppFunctionStringValueConstraint` ([I10e3f](https://android-review.googlesource.com/#/q/I10e3fdff4693e4bf2088d170c0ac654457e8411c))\n- Add `AppFunctionIntValueConstraint` ([Ifda13](https://android-review.googlesource.com/#/q/Ifda13b0c50b2caa57de6bd7844b987ce72e70379))\n- Refactor `AppFunctionPrimitiveTypeMetadata` to specific data type classes. ([I1a3b2](https://android-review.googlesource.com/#/q/I1a3b2e308411bf070c485d90fbe70e399a92642e))\n- Add description field in `AppFunctionResponseMetadata` ([I2332b](https://android-review.googlesource.com/#/q/I2332bb9f5cd75c6269c3b1d671a38e0cb3b20d3d))\n- Remove permission requirement from `setAppFunctionEnabled` API ([I1b92a](https://android-review.googlesource.com/#/q/I1b92a6627801c98aa5fd0e49445092467b9120b9))\n- Add description field in `AppFunctionParameterMetadata` ([I40a67](https://android-review.googlesource.com/#/q/I40a67b95d3f6616e0d747f1be317bb758e1697e6))\n- Add `AppFunctionUriGrant` ([I67ca9](https://android-review.googlesource.com/#/q/I67ca988737fbe065ce8874f5b9b233c218a2f85b))\n- Add `resolveAppFunctionAppMetadata` API. ([I17408](https://android-review.googlesource.com/#/q/I174089a944187498e16190cb931197cf1b763fc4))\n- Add `isDescribedByKdoc` in `@AppFunctionSerializable` annotation ([Ie14e7](https://android-review.googlesource.com/#/q/Ie14e74525a708d7d775c1c0ef579f2349b06e5e8))\n- Add description field in `AppFunctionDataTypeMetadata` ([I1bcac](https://android-review.googlesource.com/#/q/I1bcacafddd42cd5190655d3d6b343c5058384e5e))\n- Return `AppPackageMetadata` from `observeAppFunctions` API. ([I68c7e](https://android-review.googlesource.com/#/q/I68c7e47ea7f2dfc7094ae5c19978fbb3263a6868))\n- Add description field in `AppFunctionMetadata` ([I060e2](https://android-review.googlesource.com/#/q/I060e22469b217a09008ca291d6d76b9d76cf268a))\n- Add `AppFunctionTestRule` ([Id5ed0](https://android-review.googlesource.com/#/q/Id5ed0992d87e1587fb9e3c4a96a6d9f6b3c33724))\n- Add `isDescribedByKdoc` in `@AppFunction` annotation ([Ia84d2](https://android-review.googlesource.com/#/q/Ia84d2a381fce668eec266c3555779be61b419315))\n\n**Bug Fixes**\n\n- `AppFunctionManagerCompat` only supports U+ devices ([Ifa8d0](https://android-review.googlesource.com/#/q/Ifa8d06581a37fabcd8f68b1ab6c89ae889ed57ae))\n- Add property descriptions of shared serializable types in `AppFunction`'s metadata xml ([I2aab2](https://android-review.googlesource.com/#/q/I2aab2c3148393e6177c20963dd5a274d38defce2))\n- Add a description element in generated `AppFunction`'s metadata xml ([Ie5bf6](https://android-review.googlesource.com/#/q/Ie5bf6e021da58c3779a8e463a1e3366637e27c08))\n\n### Version 1.0.0-alpha02\n\nJune 4, 2025\n\n`androidx.appfunctions:appfunctions:1.0.0-alpha02`, `androidx.appfunctions:appfunctions-compiler:1.0.0-alpha02`, and `androidx.appfunctions:appfunctions-service:1.0.0-alpha02` are released. Version 1.0.0-alpha02 contains [these commits](https://android.googlesource.com/platform/frameworks/support/+log/b6c541571b9fb5471f965fc52612cb280713e5e4..786176dc2284c87a0e620477608e0aca9adeff15/appfunctions).\n\n**New Features**\n\n- Support Android 16 API(s).\n- Better support for parameterized `AppFunctionSerializable(s)` at compile time.\n\n**API Changes**\n\n- Introduced `AppFunctionSchemaDefinition` API, enabling agents to define their own predefined function schemas.\n\n**Bug Fixes**\n\n- Error handling for missing runtime enabled state of `AppFunctions`.\n- Minor bugfix in `observeAppFunctions` API to observe changes in `AppFunctionComponentMetadata`.\n- Additional error logs.\n\n### Version 1.0.0-alpha01\n\nMay 7, 2025\n\n`androidx.appfunctions:appfunctions:1.0.0-alpha01`, `androidx.appfunctions:appfunctions-compiler:1.0.0-alpha01`, and `androidx.appfunctions:appfunctions-service:1.0.0-alpha01` are released. Version 1.0.0-alpha01 contains [these commits](https://android.googlesource.com/platform/frameworks/support/+log/b6c541571b9fb5471f965fc52612cb280713e5e4/appfunctions).\n\n**New Features**\n\nThe `AppFunctions` Jetpack library is built on top of `android.app.appfunctions` platform APIs. This library simplifies exposing your app's functionality to the Assistant and allows the Assistant to interact with the app's exposed functions.\n\n- **`androidx.appfunctions:appfunctions`** : Core client APIs for managing (enable/disable) and interacting with (search/execute) `AppFunctions`.\n- **`androidx.appfunctions:appfunctions-service`** : Service-side APIs to easily expose your app's functionalities as `AppFunctions`.\n- **`androidx.appfunctions:appfunctions-compiler`** : Required KSP compiler to generate necessary code for exposing `AppFunctions`."]]