generative-ai-android icon indicating copy to clipboard operation
generative-ai-android copied to clipboard

Migrate to Kotlin Multiplatform

Open jeffnyauke opened this issue 1 year ago • 10 comments

Migrate to Kotlin Multiplatform in order to target more platforms

jeffnyauke avatar Dec 14 '23 07:12 jeffnyauke

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.

daymxn avatar Dec 14 '23 19:12 daymxn

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

PatilShreyas avatar Jan 22 '24 01:01 PatilShreyas

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

krisbitney avatar Jun 20 '24 01:06 krisbitney

@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.

takahirom avatar Sep 21 '24 03:09 takahirom

@takahirom sure. Give me some time.

PatilShreyas avatar Sep 21 '24 04:09 PatilShreyas

@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

PatilShreyas avatar Sep 21 '24 09:09 PatilShreyas