Update SDK documentation for Kotlin Multiplatform, iOS v0.9.2, and add AI agent guides#56
Open
iamstuffed wants to merge 3 commits intomainfrom
Open
Update SDK documentation for Kotlin Multiplatform, iOS v0.9.2, and add AI agent guides#56iamstuffed wants to merge 3 commits intomainfrom
iamstuffed wants to merge 3 commits intomainfrom
Conversation
Collaborator
Author
|
c01e4e8 to
355b418
Compare
…uirements Updated Android SDK to reflect Kotlin Multiplatform architecture: - Platform support: Android, iOS, macOS, JVM - LeapModelDownloader for Android (WorkManager, notifications, background) - LeapDownloader for cross-platform use (iOS, macOS, JVM) - Added comprehensive Android permission setup documentation - Updated all code examples to use ViewModel architecture pattern Added detailed audio input format requirements: - WAV format only (no MP3, AAC, etc.) - 16 kHz sample rate recommended (automatic resampling supported) - Mono channel required (stereo rejected) - Supports Float32, Int16, Int24, Int32 PCM encodings - Audio output format: 24 kHz from generation models Version updates: - Android SDK: 0.9.7 - iOS SDK: 0.9.2 Files updated: - Android: quick-start, conversation-generation, messages-content, model-loading, utilities - iOS: messages-content (audio requirements)
Created detailed AI agent usage guides for both platforms: Android guide (ai-agent-usage-guide.mdx): - Complete SDK reference covering all platforms and features - Core architecture and installation instructions - LeapModelDownloader (Android) vs LeapDownloader (cross-platform) - Detailed Android permission setup - Model loading patterns: automatic load, download without loading - Model download management: status, info, removal, cancellation - All core classes, methods, and workflows - Generation patterns, error handling, best practices - Multimodal input/output (audio, vision) - Function calling and structured output examples - Complete ViewModel example with proper lifecycle management - TOML version catalog configuration - Troubleshooting section iOS guide (ai-agent-usage-guide.mdx): - Aligned structure with Android guide for consistency - iOS-specific implementation patterns - Swift examples and best practices Additional updates: - iOS quick start guide updated to version 0.9.2 - Added AI agent guides to navigation (docs.json)
… prevent ANRs Updated cloud-ai-comparison examples for Android and iOS: - Replaced legacy LeapClient.loadModel() with LeapModelDownloader/LeapDownloader - Updated to use model slug + quantization (modern API) - Fixed ChatMessage.Role.User to ChatMessage.Role.USER (correct enum case) - Updated examples to use ViewModel pattern with viewModelScope - Removed references to local bundle file paths (now downloads models) - Aligned with current best practices and SDK patterns Fixed critical ANR issue in all Android ViewModel examples: - Updated onCleared() to use async cleanup with CoroutineScope(Dispatchers.IO).launch - Prevents ANRs caused by blocking main thread during model unload (5+ seconds on some devices) - Added proper error handling during cleanup to prevent crashes - Applied fix consistently across all examples Files updated: - cloud-ai-comparison (Android and iOS) - leap-koog-agent example - recipe-generator example - vision-language-model example This matches the fixes applied in LeapSDK-Examples/Android/LeapAudioDemo and provides consistent guidance across all Android documentation.
355b418 to
508c5a5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Comprehensive documentation updates for LEAP Android SDK (v0.9.7) and iOS SDK (v0.9.2), including new AI agent usage guides for both platforms.
Android SDK Updates (v0.9.7)
Core SDK Changes
LeapModelDownloaderfor Android (WorkManager, notifications, background downloads)LeapDownloaderfor cross-platform (iOS, macOS, JVM)Audio Format Requirements
New: Android AI Agent Usage Guide
iOS SDK Updates (v0.9.2)
Version Update
New: iOS AI Agent Usage Guide
Updated Examples
Leap.load()API.User→.user)Files Modified
Android
leap/edge-sdk/android/android-quick-start-guide.mdxleap/edge-sdk/android/ai-agent-usage-guide.mdx(new)leap/edge-sdk/android/conversation-generation.mdxleap/edge-sdk/android/messages-content.mdxleap/edge-sdk/android/model-loading.mdxleap/edge-sdk/android/utilities.mdxleap/edge-sdk/android/cloud-ai-comparison.mdxiOS
leap/edge-sdk/ios/ios-quick-start-guide.mdxleap/edge-sdk/ios/ai-agent-usage-guide.mdx(new)leap/edge-sdk/ios/messages-content.mdxleap/edge-sdk/ios/cloud-ai-comparison.mdxNavigation
docs.json(added AI agent guides to navigation)Breaking Changes
None - all changes are documentation updates only.
Testing
Notes