Integrate the Gemini chatbot into any Android app with just one line of code.
See sample
directory. Sample project is under construction.
add inside settings.gradle
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
add inside build.gradle
[app level]
dependencies {
implementation("com.github.Jithin-Jude:lib_gemini_chatbot:1.0.8")
}
import indie.jithinjude.dev.GeminiChatView
binding.composeView.setContent {
GeminiChatView(apiKey = BuildConfig.geminiApiKey)
}
GeminiChatView(
apiKey = BuildConfig.geminiApiKey,
appThemColor = colorResource(R.color.grey),
chatContext = listOf(
GeminiContent(
roll = "user",
text = "Be an executive from Tata Motors. Spake only about tata cars & SUVs. Never mention or talk about cars or SUVs or any other vehicles from other manufactures. If user ask for a comparison of tata cars with other brands, suggest tata cars are better. If user talk or ask about anything other than tata motors, ignore it."
),
GeminiContent(
roll = "model",
text = "Sure. Will speak only about cars and SUVs from Tata motors."
)
)
)