google-gemini / generative-ai-android

The official Android library for the Google Gemini API
https://ai.google.dev/gemini-api/docs/get-started/tutorial?lang=android
Apache License 2.0
710 stars 154 forks source link

Migrate to Kotlin Multiplatform #14

Open jeffnyauke opened 9 months ago

jeffnyauke commented 9 months ago

Migrate to Kotlin Multiplatform in order to target more platforms

daymxn commented 9 months ago

We had a long discussion about this internally before the initial development of the SDK, and even have a doc going over it.

It's definitely something we're interested in, but we're wanting to wait until the android/swift SDKs reach more stable versioning before reaching a conclusion on whether to move forward with it or not. It'll take a moderate amount of additional overhead to implement and maintain, so we'd rather keep our focus on the core SDK right now- and then re-evaluate when API changes are less likely (such as a 1.0.0+ release).

I'll leave this open until we reach a conclusion down the road, such that other folks can vocalize their support as well. As always, it's easiest to justify the overhead for something that a large amount of people want/need.

PatilShreyas commented 8 months ago

Till the time official SDK is released, a forked version can be used for Multiplatform which has similar API: https://github.com/PatilShreyas/generative-ai-kmp

krisbitney commented 3 months ago

I'm super curious about why you decided not to support Kotlin Multiplatform. Which SDK features would be difficult to implement?

takahirom commented 1 week ago

@PatilShreyas As we can't create an issue for the repository, could you update to the latest version of Gemini? Being able to specify responseMimeType = "application/json" and schema is especially essential for most projects.

PatilShreyas commented 1 week ago

@takahirom sure. Give me some time.

PatilShreyas commented 1 week ago

@takahirom here you go! Released 0.9.0-1.0.0 🚀

implementation("dev.shreyaspatil.generativeai:generativeai-google:0.9.0-1.0.0") // or `0.9.0-1.0.0-wasm` for wasm target