tree: 2d40249560a0eafeb7fd0f95b0784df282bf732b [search]
  1. core/
  2. prompt/
  3. safeparcel-processor/
  4. tests/
  5. Android.bp
  6. AndroidManifest.xml
  7. build.gradle.kts
  8. OWNERS
  9. README.md
ondeviceintelligencelib/README.md

OnDeviceIntelligence Client Library

Overview

This library provides a lightweight, thin client for interfacing with the platform's OnDeviceIntelligenceManager directly. It serves as an alternative for accessing on-device AI capabilities without requiring strict external dependencies or heavy external AiCore SDK AARs.

It abstracts the custom wire-format serialization engine (SafeParcelable) and pure data models for prompt requests and responses (GenerateContentRequest, GenerateContentResponse, etc.).

How to include in your build target

Add the following to the static_libs section of your Android.bp:

android_app { // or android_library
    name: "your_module_name",
    ...
    static_libs: [
        "ondeviceintelligence-client",
    ],
    plugins: [
        "safeparcel-processor", // If you need to generate creators for custom SafeParcelables
    ],
}

[!NOTE] Since this library compiles against full platform APIs (platform_apis: true), your consuming module must also be allowed to access platform APIs (e.g., be a system app with platform_apis: true). It cannot be used by vendor modules that are restricted to system_current.