Implement Public API Utilities and Helper Functions

Status Fixed / completed
Maintainer reply None cached
Activity 3 comments · opened Oct 20, 2025 · closed Oct 20, 2025

Priority

LOW

Context

The iOS SDK has various public utility functions and helpers for common operations. The Kotlin SDK is missing these convenience APIs.

Current State

  • Status: Limited public utilities
  • Impact: Developers need to write boilerplate code
  • iOS Has: Comprehensive public utilities

iOS Reference Implementation

  • Utilities: sdk/runanywhere-swift/Sources/RunAnywhere/Public/

Implementation Plan

1. Common Utilities (commonMain)

// commonMain/kotlin/com/runanywhere/sdk/public/ModelUtils.kt
object ModelUtils {
    fun getSuggestedModels(task: AITask): List<String> {
        return when (task) {
            AITask.TRANSCRIPTION -> listOf("whisper-base", "whisper-small")
            AITask.GENERATION -> listOf("llama-3.2-1b", "llama-3.2-3b")
            AITask.TTS -> listOf("coqui-tts", "piper-tts")
        }
    }
}

enum class AITask {
    TRANSCRIPTION, GENERATION, TTS, VISION
}

// commonMain/kotlin/com/runanywhere/sdk/public/AudioUtils.kt
object AudioUtils {
    fun convertSampleRate(
        audioData: ByteArray,
        fromRate: Int,
        toRate: Int
    ): ByteArray {
        // Sample rate conversion
        return audioData
    }
    
    fun normalizeAudio(audioData: ByteArray): ByteArray {
        // Audio normalization
        return audioData
    }
}

Files to Create/Modify

New Files (commonMain)

  • [ ] public/ModelUtils.kt
  • [ ] public/AudioUtils.kt
  • [ ] public/ConfigurationUtils.kt

Success Criteria

  • [ ] Utilities are easy to use
  • [ ] Good documentation
  • [ ] Comprehensive test coverage

Estimated Effort

3-5 days

🤖 Generated with Claude Code

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗