diff --git a/examples/llama.android/app/src/main/AndroidManifest.xml b/examples/llama.android/app/src/main/AndroidManifest.xml index 37b5c94626..ecfdb8c347 100644 --- a/examples/llama.android/app/src/main/AndroidManifest.xml +++ b/examples/llama.android/app/src/main/AndroidManifest.xml @@ -5,6 +5,7 @@ - - diff --git a/examples/llama.android/app/src/main/java/com/example/llama/revamp/KleidiLlamaApplication.kt b/examples/llama.android/app/src/main/java/com/example/llama/revamp/KleidiLlamaApplication.kt new file mode 100644 index 0000000000..2d5568bae3 --- /dev/null +++ b/examples/llama.android/app/src/main/java/com/example/llama/revamp/KleidiLlamaApplication.kt @@ -0,0 +1,7 @@ +package com.example.llama.revamp + +import android.app.Application +import dagger.hilt.android.HiltAndroidApp + +@HiltAndroidApp +class KleidiLlamaApplication : Application() diff --git a/examples/llama.android/app/src/main/java/com/example/llama/revamp/di/AppModule.kt b/examples/llama.android/app/src/main/java/com/example/llama/revamp/di/AppModule.kt new file mode 100644 index 0000000000..e4c2a687b9 --- /dev/null +++ b/examples/llama.android/app/src/main/java/com/example/llama/revamp/di/AppModule.kt @@ -0,0 +1,33 @@ +package com.example.llama.revamp.di + +import android.content.Context +import com.example.llama.revamp.data.preferences.UserPreferences +import com.example.llama.revamp.data.repository.SystemPromptRepository +import com.example.llama.revamp.engine.InferenceEngine +import com.example.llama.revamp.monitoring.PerformanceMonitor +import dagger.Module +import dagger.Provides +import dagger.hilt.InstallIn +import dagger.hilt.android.qualifiers.ApplicationContext +import dagger.hilt.components.SingletonComponent +import javax.inject.Singleton + +@Module +@InstallIn(SingletonComponent::class) +object AppModule { + @Provides + @Singleton + fun provideInferenceEngine() = InferenceEngine() + + @Provides + @Singleton + fun providePerformanceMonitor(@ApplicationContext context: Context) = PerformanceMonitor(context) + + @Provides + @Singleton + fun provideUserPreferences(@ApplicationContext context: Context) = UserPreferences(context) + + @Provides + @Singleton + fun provideSystemPromptRepository(@ApplicationContext context: Context) = SystemPromptRepository(context) +}