@runanywhere/core 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/RunAnywhereCore.podspec +130 -0
- package/android/CMakeLists.txt +92 -0
- package/android/build.gradle +321 -0
- package/android/consumer-rules.pro +5 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/cpp/cpp-adapter.cpp +271 -0
- package/android/src/main/include/rac/backends/rac_llm_llamacpp.h +218 -0
- package/android/src/main/include/rac/backends/rac_stt_onnx.h +99 -0
- package/android/src/main/include/rac/backends/rac_stt_whispercpp.h +153 -0
- package/android/src/main/include/rac/backends/rac_tts_onnx.h +71 -0
- package/android/src/main/include/rac/backends/rac_vad_onnx.h +84 -0
- package/android/src/main/include/rac/core/capabilities/rac_lifecycle.h +290 -0
- package/android/src/main/include/rac/core/rac_analytics_events.h +610 -0
- package/android/src/main/include/rac/core/rac_audio_utils.h +88 -0
- package/android/src/main/include/rac/core/rac_component_types.h +160 -0
- package/android/src/main/include/rac/core/rac_core.h +331 -0
- package/android/src/main/include/rac/core/rac_error.h +469 -0
- package/android/src/main/include/rac/core/rac_events.h +334 -0
- package/android/src/main/include/rac/core/rac_logger.h +416 -0
- package/android/src/main/include/rac/core/rac_platform_adapter.h +340 -0
- package/android/src/main/include/rac/core/rac_sdk_state.h +292 -0
- package/android/src/main/include/rac/core/rac_structured_error.h +594 -0
- package/android/src/main/include/rac/core/rac_types.h +264 -0
- package/android/src/main/include/rac/features/llm/rac_llm.h +17 -0
- package/android/src/main/include/rac/features/llm/rac_llm_analytics.h +188 -0
- package/android/src/main/include/rac/features/llm/rac_llm_component.h +228 -0
- package/android/src/main/include/rac/features/llm/rac_llm_events.h +215 -0
- package/android/src/main/include/rac/features/llm/rac_llm_metrics.h +402 -0
- package/android/src/main/include/rac/features/llm/rac_llm_service.h +163 -0
- package/android/src/main/include/rac/features/llm/rac_llm_structured_output.h +141 -0
- package/android/src/main/include/rac/features/llm/rac_llm_types.h +384 -0
- package/android/src/main/include/rac/features/platform/rac_llm_platform.h +204 -0
- package/android/src/main/include/rac/features/platform/rac_tts_platform.h +197 -0
- package/android/src/main/include/rac/features/stt/rac_stt.h +17 -0
- package/android/src/main/include/rac/features/stt/rac_stt_analytics.h +204 -0
- package/android/src/main/include/rac/features/stt/rac_stt_component.h +162 -0
- package/android/src/main/include/rac/features/stt/rac_stt_events.h +62 -0
- package/android/src/main/include/rac/features/stt/rac_stt_service.h +154 -0
- package/android/src/main/include/rac/features/stt/rac_stt_types.h +389 -0
- package/android/src/main/include/rac/features/tts/rac_tts.h +17 -0
- package/android/src/main/include/rac/features/tts/rac_tts_analytics.h +181 -0
- package/android/src/main/include/rac/features/tts/rac_tts_component.h +158 -0
- package/android/src/main/include/rac/features/tts/rac_tts_events.h +54 -0
- package/android/src/main/include/rac/features/tts/rac_tts_service.h +162 -0
- package/android/src/main/include/rac/features/tts/rac_tts_types.h +374 -0
- package/android/src/main/include/rac/features/vad/rac_vad.h +17 -0
- package/android/src/main/include/rac/features/vad/rac_vad_analytics.h +236 -0
- package/android/src/main/include/rac/features/vad/rac_vad_component.h +185 -0
- package/android/src/main/include/rac/features/vad/rac_vad_energy.h +443 -0
- package/android/src/main/include/rac/features/vad/rac_vad_events.h +76 -0
- package/android/src/main/include/rac/features/vad/rac_vad_service.h +167 -0
- package/android/src/main/include/rac/features/vad/rac_vad_types.h +244 -0
- package/android/src/main/include/rac/features/voice_agent/rac_voice_agent.h +612 -0
- package/android/src/main/include/rac/infrastructure/device/rac_device_manager.h +176 -0
- package/android/src/main/include/rac/infrastructure/download/rac_download.h +418 -0
- package/android/src/main/include/rac/infrastructure/events/rac_events.h +177 -0
- package/android/src/main/include/rac/infrastructure/model_management/rac_model_assignment.h +169 -0
- package/android/src/main/include/rac/infrastructure/model_management/rac_model_paths.h +258 -0
- package/android/src/main/include/rac/infrastructure/model_management/rac_model_registry.h +357 -0
- package/android/src/main/include/rac/infrastructure/model_management/rac_model_strategy.h +374 -0
- package/android/src/main/include/rac/infrastructure/model_management/rac_model_types.h +613 -0
- package/android/src/main/include/rac/infrastructure/network/rac_api_types.h +335 -0
- package/android/src/main/include/rac/infrastructure/network/rac_auth_manager.h +252 -0
- package/android/src/main/include/rac/infrastructure/network/rac_dev_config.h +85 -0
- package/android/src/main/include/rac/infrastructure/network/rac_endpoints.h +102 -0
- package/android/src/main/include/rac/infrastructure/network/rac_environment.h +220 -0
- package/android/src/main/include/rac/infrastructure/network/rac_http_client.h +233 -0
- package/android/src/main/include/rac/infrastructure/storage/rac_storage_analyzer.h +286 -0
- package/android/src/main/include/rac/infrastructure/telemetry/rac_telemetry_manager.h +206 -0
- package/android/src/main/include/rac/infrastructure/telemetry/rac_telemetry_types.h +234 -0
- package/android/src/main/java/com/margelo/nitro/runanywhere/ArchiveUtility.kt +308 -0
- package/android/src/main/java/com/margelo/nitro/runanywhere/HybridRunAnywhereDeviceInfo.kt +229 -0
- package/android/src/main/java/com/margelo/nitro/runanywhere/PlatformAdapterBridge.kt +392 -0
- package/android/src/main/java/com/margelo/nitro/runanywhere/RunAnywhereCorePackage.kt +28 -0
- package/android/src/main/java/com/margelo/nitro/runanywhere/SDKLogger.kt +357 -0
- package/android/src/main/java/com/margelo/nitro/runanywhere/SecureStorageManager.kt +147 -0
- package/android/src/main/jniLibs/arm64-v8a/libc++_shared.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libomp.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/librac_commons.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/librunanywhere_jni.so +0 -0
- package/cpp/HybridRunAnywhereCore.cpp +2505 -0
- package/cpp/HybridRunAnywhereCore.hpp +271 -0
- package/cpp/bridges/AuthBridge.cpp +209 -0
- package/cpp/bridges/AuthBridge.hpp +157 -0
- package/cpp/bridges/DeviceBridge.cpp +257 -0
- package/cpp/bridges/DeviceBridge.hpp +155 -0
- package/cpp/bridges/DownloadBridge.cpp +299 -0
- package/cpp/bridges/DownloadBridge.hpp +197 -0
- package/cpp/bridges/EventBridge.cpp +125 -0
- package/cpp/bridges/EventBridge.hpp +139 -0
- package/cpp/bridges/HTTPBridge.cpp +96 -0
- package/cpp/bridges/HTTPBridge.hpp +144 -0
- package/cpp/bridges/InitBridge.cpp +1273 -0
- package/cpp/bridges/InitBridge.hpp +306 -0
- package/cpp/bridges/ModelRegistryBridge.cpp +394 -0
- package/cpp/bridges/ModelRegistryBridge.hpp +177 -0
- package/cpp/bridges/StorageBridge.cpp +269 -0
- package/cpp/bridges/StorageBridge.hpp +172 -0
- package/cpp/bridges/TelemetryBridge.cpp +352 -0
- package/cpp/bridges/TelemetryBridge.hpp +126 -0
- package/ios/.testlocal +0 -0
- package/ios/ArchiveUtility.swift +526 -0
- package/ios/ArchiveUtilityBridge.m +52 -0
- package/ios/AudioDecoder.h +38 -0
- package/ios/AudioDecoder.m +162 -0
- package/ios/Binaries/RACommons.xcframework/Info.plist +44 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/RACommons.h +67 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_analytics_events.h +610 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_api_types.h +335 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_audio_utils.h +88 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_auth_manager.h +252 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_component_types.h +160 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_core.h +331 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_dev_config.h +85 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_device_manager.h +176 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_download.h +418 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_endpoints.h +102 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_environment.h +220 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_error.h +469 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_events.h +177 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_http_client.h +233 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_lifecycle.h +290 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm.h +17 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_analytics.h +188 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_component.h +228 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_events.h +215 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_llamacpp.h +218 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_metrics.h +402 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_platform.h +204 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_service.h +163 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_structured_output.h +141 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_types.h +384 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_logger.h +416 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_model_assignment.h +169 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_model_paths.h +258 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_model_registry.h +357 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_model_strategy.h +374 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_model_types.h +613 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_platform_adapter.h +340 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_sdk_state.h +292 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_storage_analyzer.h +286 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_structured_error.h +594 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_stt.h +17 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_stt_analytics.h +204 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_stt_component.h +162 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_stt_events.h +62 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_stt_onnx.h +99 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_stt_service.h +154 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_stt_types.h +389 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_stt_whispercpp.h +153 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_telemetry_manager.h +206 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_telemetry_types.h +234 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_tts.h +17 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_tts_analytics.h +181 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_tts_component.h +158 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_tts_events.h +54 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_tts_onnx.h +71 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_tts_platform.h +197 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_tts_service.h +162 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_tts_types.h +374 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_types.h +264 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad.h +17 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad_analytics.h +236 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad_component.h +185 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad_energy.h +443 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad_events.h +76 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad_onnx.h +84 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad_service.h +167 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad_types.h +244 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_voice_agent.h +612 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Info.plist +11 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Modules/module.modulemap +5 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/RACommons +0 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/RACommons.h +67 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_analytics_events.h +610 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_api_types.h +335 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_audio_utils.h +88 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_auth_manager.h +252 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_component_types.h +160 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_core.h +331 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_dev_config.h +85 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_device_manager.h +176 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_download.h +418 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_endpoints.h +102 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_environment.h +220 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_error.h +469 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_events.h +177 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_http_client.h +233 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_lifecycle.h +290 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm.h +17 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_analytics.h +188 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_component.h +228 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_events.h +215 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_llamacpp.h +218 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_metrics.h +402 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_platform.h +204 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_service.h +163 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_structured_output.h +141 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_types.h +384 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_logger.h +416 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_model_assignment.h +169 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_model_paths.h +258 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_model_registry.h +357 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_model_strategy.h +374 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_model_types.h +613 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_platform_adapter.h +340 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_sdk_state.h +292 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_storage_analyzer.h +286 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_structured_error.h +594 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_stt.h +17 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_stt_analytics.h +204 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_stt_component.h +162 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_stt_events.h +62 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_stt_onnx.h +99 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_stt_service.h +154 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_stt_types.h +389 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_stt_whispercpp.h +153 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_telemetry_manager.h +206 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_telemetry_types.h +234 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_tts.h +17 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_tts_analytics.h +181 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_tts_component.h +158 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_tts_events.h +54 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_tts_onnx.h +71 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_tts_platform.h +197 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_tts_service.h +162 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_tts_types.h +374 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_types.h +264 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_vad.h +17 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_vad_analytics.h +236 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_vad_component.h +185 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_vad_energy.h +443 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_vad_events.h +76 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_vad_onnx.h +84 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_vad_service.h +167 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_vad_types.h +244 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_voice_agent.h +612 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Info.plist +11 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Modules/module.modulemap +5 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/RACommons +0 -0
- package/ios/HybridRunAnywhereDeviceInfo.swift +214 -0
- package/ios/KeychainManager.swift +116 -0
- package/ios/PlatformAdapter.swift +100 -0
- package/ios/PlatformAdapterBridge.h +152 -0
- package/ios/PlatformAdapterBridge.m +570 -0
- package/ios/RNSDKLoggerBridge.h +41 -0
- package/ios/RNSDKLoggerBridge.m +66 -0
- package/ios/SDKLogger.swift +329 -0
- package/nitro.json +20 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/c++/JHybridRunAnywhereDeviceInfoSpec.cpp +257 -0
- package/nitrogen/generated/android/c++/JHybridRunAnywhereDeviceInfoSpec.hpp +77 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/runanywhere/HybridRunAnywhereDeviceInfoSpec.kt +106 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/runanywhere/runanywherecoreOnLoad.kt +35 -0
- package/nitrogen/generated/android/runanywherecore+autolinking.cmake +82 -0
- package/nitrogen/generated/android/runanywherecore+autolinking.gradle +27 -0
- package/nitrogen/generated/android/runanywherecoreOnLoad.cpp +54 -0
- package/nitrogen/generated/android/runanywherecoreOnLoad.hpp +25 -0
- package/nitrogen/generated/ios/RunAnywhereCore+autolinking.rb +60 -0
- package/nitrogen/generated/ios/RunAnywhereCore-Swift-Cxx-Bridge.cpp +65 -0
- package/nitrogen/generated/ios/RunAnywhereCore-Swift-Cxx-Bridge.hpp +197 -0
- package/nitrogen/generated/ios/RunAnywhereCore-Swift-Cxx-Umbrella.hpp +45 -0
- package/nitrogen/generated/ios/RunAnywhereCoreAutolinking.mm +43 -0
- package/nitrogen/generated/ios/RunAnywhereCoreAutolinking.swift +25 -0
- package/nitrogen/generated/ios/c++/HybridRunAnywhereDeviceInfoSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridRunAnywhereDeviceInfoSpecSwift.hpp +173 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_double.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridRunAnywhereDeviceInfoSpec.swift +68 -0
- package/nitrogen/generated/ios/swift/HybridRunAnywhereDeviceInfoSpec_cxx.swift +366 -0
- package/nitrogen/generated/shared/c++/HybridRunAnywhereCoreSpec.cpp +92 -0
- package/nitrogen/generated/shared/c++/HybridRunAnywhereCoreSpec.hpp +138 -0
- package/nitrogen/generated/shared/c++/HybridRunAnywhereDeviceInfoSpec.cpp +33 -0
- package/nitrogen/generated/shared/c++/HybridRunAnywhereDeviceInfoSpec.hpp +75 -0
- package/package.json +76 -0
- package/react-native.config.js +14 -0
- package/src/Features/VoiceSession/AudioCaptureManager.ts +286 -0
- package/src/Features/VoiceSession/AudioPlaybackManager.ts +300 -0
- package/src/Features/VoiceSession/VoiceSessionHandle.ts +530 -0
- package/src/Features/VoiceSession/index.ts +20 -0
- package/src/Features/index.ts +7 -0
- package/src/Foundation/Constants/SDKConstants.ts +47 -0
- package/src/Foundation/Constants/index.ts +8 -0
- package/src/Foundation/DependencyInjection/ServiceContainer.ts +154 -0
- package/src/Foundation/DependencyInjection/ServiceRegistry.ts +51 -0
- package/src/Foundation/DependencyInjection/index.ts +6 -0
- package/src/Foundation/ErrorTypes/ErrorCategory.ts +184 -0
- package/src/Foundation/ErrorTypes/ErrorCodes.ts +151 -0
- package/src/Foundation/ErrorTypes/ErrorContext.ts +201 -0
- package/src/Foundation/ErrorTypes/SDKError.ts +507 -0
- package/src/Foundation/ErrorTypes/index.ts +57 -0
- package/src/Foundation/Initialization/InitializationPhase.ts +85 -0
- package/src/Foundation/Initialization/InitializationState.ts +168 -0
- package/src/Foundation/Initialization/index.ts +26 -0
- package/src/Foundation/Logging/Destinations/NativeLogBridge.ts +147 -0
- package/src/Foundation/Logging/Destinations/SentryDestination.ts +209 -0
- package/src/Foundation/Logging/Logger/SDKLogger.ts +232 -0
- package/src/Foundation/Logging/Models/LogLevel.ts +36 -0
- package/src/Foundation/Logging/Models/LoggingConfiguration.ts +117 -0
- package/src/Foundation/Logging/Services/LoggingManager.ts +407 -0
- package/src/Foundation/Logging/index.ts +59 -0
- package/src/Foundation/Security/DeviceIdentity.ts +92 -0
- package/src/Foundation/Security/SecureStorageError.ts +132 -0
- package/src/Foundation/Security/SecureStorageKeys.ts +35 -0
- package/src/Foundation/Security/SecureStorageService.ts +449 -0
- package/src/Foundation/Security/index.ts +17 -0
- package/src/Foundation/index.ts +26 -0
- package/src/Infrastructure/Events/EventPublisher.ts +165 -0
- package/src/Infrastructure/Events/SDKEvent.ts +214 -0
- package/src/Infrastructure/Events/index.ts +15 -0
- package/src/Infrastructure/index.ts +9 -0
- package/src/Public/Events/EventBus.ts +488 -0
- package/src/Public/Events/index.ts +8 -0
- package/src/Public/Extensions/RunAnywhere+Logging.ts +51 -0
- package/src/Public/Extensions/RunAnywhere+Models.ts +392 -0
- package/src/Public/Extensions/RunAnywhere+STT.ts +424 -0
- package/src/Public/Extensions/RunAnywhere+Storage.ts +151 -0
- package/src/Public/Extensions/RunAnywhere+StructuredOutput.ts +316 -0
- package/src/Public/Extensions/RunAnywhere+TTS.ts +430 -0
- package/src/Public/Extensions/RunAnywhere+TextGeneration.ts +320 -0
- package/src/Public/Extensions/RunAnywhere+VAD.ts +359 -0
- package/src/Public/Extensions/RunAnywhere+VoiceAgent.ts +225 -0
- package/src/Public/Extensions/RunAnywhere+VoiceSession.ts +155 -0
- package/src/Public/Extensions/index.ts +126 -0
- package/src/Public/RunAnywhere.ts +695 -0
- package/src/index.ts +238 -0
- package/src/native/NativeRunAnywhereCore.ts +291 -0
- package/src/native/NativeRunAnywhereModule.ts +32 -0
- package/src/native/index.ts +21 -0
- package/src/services/DownloadService.ts +282 -0
- package/src/services/FileSystem.ts +810 -0
- package/src/services/ModelRegistry.ts +246 -0
- package/src/services/Network/APIEndpoints.ts +84 -0
- package/src/services/Network/HTTPService.ts +479 -0
- package/src/services/Network/NetworkConfiguration.ts +130 -0
- package/src/services/Network/TelemetryService.ts +318 -0
- package/src/services/Network/index.ts +29 -0
- package/src/services/SystemTTSService.ts +130 -0
- package/src/services/index.ts +66 -0
- package/src/specs/RunAnywhereCore.nitro.ts +627 -0
- package/src/specs/RunAnywhereDeviceInfo.nitro.ts +73 -0
- package/src/types/LLMTypes.ts +127 -0
- package/src/types/STTTypes.ts +124 -0
- package/src/types/StructuredOutputTypes.ts +156 -0
- package/src/types/TTSTypes.ts +126 -0
- package/src/types/VADTypes.ts +70 -0
- package/src/types/VoiceAgentTypes.ts +182 -0
- package/src/types/enums.ts +258 -0
- package/src/types/events.ts +337 -0
- package/src/types/external.d.ts +142 -0
- package/src/types/index.ts +146 -0
- package/src/types/models.ts +579 -0
package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_types.h
ADDED
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_llm_types.h
|
|
3
|
+
* @brief RunAnywhere Commons - LLM Types and Data Structures
|
|
4
|
+
*
|
|
5
|
+
* C port of Swift's LLM Models from:
|
|
6
|
+
* Sources/RunAnywhere/Features/LLM/Models/LLMGenerationOptions.swift
|
|
7
|
+
* Sources/RunAnywhere/Features/LLM/Models/LLMGenerationResult.swift
|
|
8
|
+
*
|
|
9
|
+
* This header defines data structures only. For the service interface,
|
|
10
|
+
* see rac_llm_service.h.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
#ifndef RAC_LLM_TYPES_H
|
|
14
|
+
#define RAC_LLM_TYPES_H
|
|
15
|
+
|
|
16
|
+
#include <RACommons/rac_types.h>
|
|
17
|
+
|
|
18
|
+
#ifdef __cplusplus
|
|
19
|
+
extern "C" {
|
|
20
|
+
#endif
|
|
21
|
+
|
|
22
|
+
// =============================================================================
|
|
23
|
+
// CONFIGURATION - Mirrors Swift's LLMConfiguration
|
|
24
|
+
// =============================================================================
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @brief LLM component configuration
|
|
28
|
+
*
|
|
29
|
+
* Mirrors Swift's LLMConfiguration struct exactly.
|
|
30
|
+
* See: Sources/RunAnywhere/Features/LLM/Models/LLMConfiguration.swift
|
|
31
|
+
*/
|
|
32
|
+
typedef struct rac_llm_config {
|
|
33
|
+
/** Model ID (optional - uses default if NULL) */
|
|
34
|
+
const char* model_id;
|
|
35
|
+
|
|
36
|
+
/** Preferred framework for generation (use RAC_FRAMEWORK_UNKNOWN for auto) */
|
|
37
|
+
int32_t preferred_framework;
|
|
38
|
+
|
|
39
|
+
/** Context length - max tokens the model can handle (default: 2048) */
|
|
40
|
+
int32_t context_length;
|
|
41
|
+
|
|
42
|
+
/** Temperature for sampling (0.0 - 2.0, default: 0.7) */
|
|
43
|
+
float temperature;
|
|
44
|
+
|
|
45
|
+
/** Maximum tokens to generate (default: 100) */
|
|
46
|
+
int32_t max_tokens;
|
|
47
|
+
|
|
48
|
+
/** System prompt for generation (can be NULL) */
|
|
49
|
+
const char* system_prompt;
|
|
50
|
+
|
|
51
|
+
/** Enable streaming mode (default: true) */
|
|
52
|
+
rac_bool_t streaming_enabled;
|
|
53
|
+
} rac_llm_config_t;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @brief Default LLM configuration
|
|
57
|
+
*/
|
|
58
|
+
static const rac_llm_config_t RAC_LLM_CONFIG_DEFAULT = {.model_id = RAC_NULL,
|
|
59
|
+
.preferred_framework =
|
|
60
|
+
99, // RAC_FRAMEWORK_UNKNOWN
|
|
61
|
+
.context_length = 2048,
|
|
62
|
+
.temperature = 0.7f,
|
|
63
|
+
.max_tokens = 100,
|
|
64
|
+
.system_prompt = RAC_NULL,
|
|
65
|
+
.streaming_enabled = RAC_TRUE};
|
|
66
|
+
|
|
67
|
+
// =============================================================================
|
|
68
|
+
// OPTIONS - Mirrors Swift's LLMGenerationOptions
|
|
69
|
+
// =============================================================================
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @brief LLM generation options
|
|
73
|
+
*
|
|
74
|
+
* Mirrors Swift's LLMGenerationOptions struct exactly.
|
|
75
|
+
* See: Sources/RunAnywhere/Features/LLM/Models/LLMGenerationOptions.swift
|
|
76
|
+
*/
|
|
77
|
+
typedef struct rac_llm_options {
|
|
78
|
+
/** Maximum number of tokens to generate (default: 100) */
|
|
79
|
+
int32_t max_tokens;
|
|
80
|
+
|
|
81
|
+
/** Temperature for sampling (0.0 - 2.0, default: 0.8) */
|
|
82
|
+
float temperature;
|
|
83
|
+
|
|
84
|
+
/** Top-p sampling parameter (default: 1.0) */
|
|
85
|
+
float top_p;
|
|
86
|
+
|
|
87
|
+
/** Stop sequences (null-terminated array, can be NULL) */
|
|
88
|
+
const char* const* stop_sequences;
|
|
89
|
+
size_t num_stop_sequences;
|
|
90
|
+
|
|
91
|
+
/** Enable streaming mode (default: false) */
|
|
92
|
+
rac_bool_t streaming_enabled;
|
|
93
|
+
|
|
94
|
+
/** System prompt (can be NULL) */
|
|
95
|
+
const char* system_prompt;
|
|
96
|
+
} rac_llm_options_t;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* @brief Default LLM generation options
|
|
100
|
+
*/
|
|
101
|
+
static const rac_llm_options_t RAC_LLM_OPTIONS_DEFAULT = {.max_tokens = 100,
|
|
102
|
+
.temperature = 0.8f,
|
|
103
|
+
.top_p = 1.0f,
|
|
104
|
+
.stop_sequences = RAC_NULL,
|
|
105
|
+
.num_stop_sequences = 0,
|
|
106
|
+
.streaming_enabled = RAC_FALSE,
|
|
107
|
+
.system_prompt = RAC_NULL};
|
|
108
|
+
|
|
109
|
+
// =============================================================================
|
|
110
|
+
// RESULT - Mirrors Swift's LLMGenerationResult
|
|
111
|
+
// =============================================================================
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* @brief LLM generation result
|
|
115
|
+
*/
|
|
116
|
+
typedef struct rac_llm_result {
|
|
117
|
+
/** Generated text (owned, must be freed with rac_free) */
|
|
118
|
+
char* text;
|
|
119
|
+
|
|
120
|
+
/** Number of tokens in prompt */
|
|
121
|
+
int32_t prompt_tokens;
|
|
122
|
+
|
|
123
|
+
/** Number of tokens generated */
|
|
124
|
+
int32_t completion_tokens;
|
|
125
|
+
|
|
126
|
+
/** Total tokens (prompt + completion) */
|
|
127
|
+
int32_t total_tokens;
|
|
128
|
+
|
|
129
|
+
/** Time to first token in milliseconds */
|
|
130
|
+
int64_t time_to_first_token_ms;
|
|
131
|
+
|
|
132
|
+
/** Total generation time in milliseconds */
|
|
133
|
+
int64_t total_time_ms;
|
|
134
|
+
|
|
135
|
+
/** Tokens per second */
|
|
136
|
+
float tokens_per_second;
|
|
137
|
+
} rac_llm_result_t;
|
|
138
|
+
|
|
139
|
+
// =============================================================================
|
|
140
|
+
// INFO - Mirrors Swift's LLMService properties
|
|
141
|
+
// =============================================================================
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* @brief LLM service handle info
|
|
145
|
+
*
|
|
146
|
+
* Mirrors Swift's LLMService properties.
|
|
147
|
+
*/
|
|
148
|
+
typedef struct rac_llm_info {
|
|
149
|
+
/** Whether the service is ready for generation (isReady) */
|
|
150
|
+
rac_bool_t is_ready;
|
|
151
|
+
|
|
152
|
+
/** Current model identifier (currentModel, can be NULL) */
|
|
153
|
+
const char* current_model;
|
|
154
|
+
|
|
155
|
+
/** Context length (contextLength, 0 if unknown) */
|
|
156
|
+
int32_t context_length;
|
|
157
|
+
|
|
158
|
+
/** Whether streaming is supported (supportsStreaming) */
|
|
159
|
+
rac_bool_t supports_streaming;
|
|
160
|
+
} rac_llm_info_t;
|
|
161
|
+
|
|
162
|
+
// =============================================================================
|
|
163
|
+
// CALLBACKS
|
|
164
|
+
// =============================================================================
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* @brief LLM streaming callback
|
|
168
|
+
*
|
|
169
|
+
* Called for each generated token during streaming.
|
|
170
|
+
* Mirrors Swift's onToken callback pattern.
|
|
171
|
+
*
|
|
172
|
+
* @param token The generated token string
|
|
173
|
+
* @param user_data User-provided context
|
|
174
|
+
* @return RAC_TRUE to continue, RAC_FALSE to stop generation
|
|
175
|
+
*/
|
|
176
|
+
typedef rac_bool_t (*rac_llm_stream_callback_fn)(const char* token, void* user_data);
|
|
177
|
+
|
|
178
|
+
// =============================================================================
|
|
179
|
+
// THINKING TAG PATTERN - Mirrors Swift's ThinkingTagPattern
|
|
180
|
+
// =============================================================================
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* @brief Pattern for extracting thinking/reasoning content from model output
|
|
184
|
+
*
|
|
185
|
+
* Mirrors Swift's ThinkingTagPattern struct exactly.
|
|
186
|
+
* See: Sources/RunAnywhere/Features/LLM/Models/ThinkingTagPattern.swift
|
|
187
|
+
*/
|
|
188
|
+
typedef struct rac_thinking_tag_pattern {
|
|
189
|
+
/** Opening tag for thinking content (e.g., "<think>") */
|
|
190
|
+
const char* opening_tag;
|
|
191
|
+
|
|
192
|
+
/** Closing tag for thinking content (e.g., "</think>") */
|
|
193
|
+
const char* closing_tag;
|
|
194
|
+
} rac_thinking_tag_pattern_t;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* @brief Default thinking tag pattern (DeepSeek/Hermes style)
|
|
198
|
+
*/
|
|
199
|
+
static const rac_thinking_tag_pattern_t RAC_THINKING_TAG_DEFAULT = {.opening_tag = "<think>",
|
|
200
|
+
.closing_tag = "</think>"};
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* @brief Alternative thinking pattern with full word
|
|
204
|
+
*/
|
|
205
|
+
static const rac_thinking_tag_pattern_t RAC_THINKING_TAG_FULL = {.opening_tag = "<thinking>",
|
|
206
|
+
.closing_tag = "</thinking>"};
|
|
207
|
+
|
|
208
|
+
// =============================================================================
|
|
209
|
+
// STRUCTURED OUTPUT - Mirrors Swift's StructuredOutputConfig
|
|
210
|
+
// =============================================================================
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* @brief Structured output configuration
|
|
214
|
+
*
|
|
215
|
+
* Mirrors Swift's StructuredOutputConfig struct.
|
|
216
|
+
* See: Sources/RunAnywhere/Features/LLM/StructuredOutput/Generatable.swift
|
|
217
|
+
*
|
|
218
|
+
* Note: In C, we pass the JSON schema directly instead of using reflection.
|
|
219
|
+
*/
|
|
220
|
+
typedef struct rac_structured_output_config {
|
|
221
|
+
/** JSON schema for the expected output structure */
|
|
222
|
+
const char* json_schema;
|
|
223
|
+
|
|
224
|
+
/** Whether to include the schema in the prompt */
|
|
225
|
+
rac_bool_t include_schema_in_prompt;
|
|
226
|
+
} rac_structured_output_config_t;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* @brief Default structured output configuration
|
|
230
|
+
*/
|
|
231
|
+
static const rac_structured_output_config_t RAC_STRUCTURED_OUTPUT_DEFAULT = {
|
|
232
|
+
.json_schema = RAC_NULL, .include_schema_in_prompt = RAC_TRUE};
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* @brief Structured output validation result
|
|
236
|
+
*
|
|
237
|
+
* Mirrors Swift's StructuredOutputValidation struct.
|
|
238
|
+
*/
|
|
239
|
+
typedef struct rac_structured_output_validation {
|
|
240
|
+
/** Whether the output is valid according to the schema */
|
|
241
|
+
rac_bool_t is_valid;
|
|
242
|
+
|
|
243
|
+
/** Error message if validation failed (can be NULL) */
|
|
244
|
+
const char* error_message;
|
|
245
|
+
|
|
246
|
+
/** Extracted JSON string (can be NULL) */
|
|
247
|
+
char* extracted_json;
|
|
248
|
+
} rac_structured_output_validation_t;
|
|
249
|
+
|
|
250
|
+
// =============================================================================
|
|
251
|
+
// STREAMING RESULT - Mirrors Swift's LLMStreamingResult
|
|
252
|
+
// =============================================================================
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* @brief Token event during streaming
|
|
256
|
+
*
|
|
257
|
+
* Provides detailed information about each token during streaming generation.
|
|
258
|
+
*/
|
|
259
|
+
typedef struct rac_llm_token_event {
|
|
260
|
+
/** The generated token text */
|
|
261
|
+
const char* token;
|
|
262
|
+
|
|
263
|
+
/** Token index in the sequence */
|
|
264
|
+
int32_t token_index;
|
|
265
|
+
|
|
266
|
+
/** Is this the final token? */
|
|
267
|
+
rac_bool_t is_final;
|
|
268
|
+
|
|
269
|
+
/** Tokens generated per second so far */
|
|
270
|
+
float tokens_per_second;
|
|
271
|
+
} rac_llm_token_event_t;
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* @brief Extended streaming callback with token event details
|
|
275
|
+
*
|
|
276
|
+
* @param event Token event details
|
|
277
|
+
* @param user_data User-provided context
|
|
278
|
+
* @return RAC_TRUE to continue, RAC_FALSE to stop generation
|
|
279
|
+
*/
|
|
280
|
+
typedef rac_bool_t (*rac_llm_token_event_callback_fn)(const rac_llm_token_event_t* event,
|
|
281
|
+
void* user_data);
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* @brief Streaming result handle
|
|
285
|
+
*
|
|
286
|
+
* Opaque handle for managing streaming generation.
|
|
287
|
+
* In C++, this wraps the streaming state and provides synchronization.
|
|
288
|
+
*
|
|
289
|
+
* Note: LLMStreamingResult in Swift returns an AsyncThrowingStream and a Task.
|
|
290
|
+
* In C, we use callbacks instead of async streams.
|
|
291
|
+
*/
|
|
292
|
+
typedef void* rac_llm_stream_handle_t;
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* @brief Streaming generation parameters
|
|
296
|
+
*
|
|
297
|
+
* Configuration for starting a streaming generation.
|
|
298
|
+
*/
|
|
299
|
+
typedef struct rac_llm_stream_params {
|
|
300
|
+
/** Prompt to generate from */
|
|
301
|
+
const char* prompt;
|
|
302
|
+
|
|
303
|
+
/** Generation options */
|
|
304
|
+
rac_llm_options_t options;
|
|
305
|
+
|
|
306
|
+
/** Callback for each token */
|
|
307
|
+
rac_llm_stream_callback_fn on_token;
|
|
308
|
+
|
|
309
|
+
/** Extended callback with token event details (optional, can be NULL) */
|
|
310
|
+
rac_llm_token_event_callback_fn on_token_event;
|
|
311
|
+
|
|
312
|
+
/** User data passed to callbacks */
|
|
313
|
+
void* user_data;
|
|
314
|
+
|
|
315
|
+
/** Optional thinking tag pattern to extract thinking content */
|
|
316
|
+
const rac_thinking_tag_pattern_t* thinking_pattern;
|
|
317
|
+
} rac_llm_stream_params_t;
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* @brief Streaming generation metrics
|
|
321
|
+
*
|
|
322
|
+
* Metrics collected during streaming generation.
|
|
323
|
+
*/
|
|
324
|
+
typedef struct rac_llm_stream_metrics {
|
|
325
|
+
/** Time to first token in milliseconds */
|
|
326
|
+
int64_t time_to_first_token_ms;
|
|
327
|
+
|
|
328
|
+
/** Total generation time in milliseconds */
|
|
329
|
+
int64_t total_time_ms;
|
|
330
|
+
|
|
331
|
+
/** Number of tokens generated */
|
|
332
|
+
int32_t tokens_generated;
|
|
333
|
+
|
|
334
|
+
/** Tokens per second */
|
|
335
|
+
float tokens_per_second;
|
|
336
|
+
|
|
337
|
+
/** Number of tokens in the prompt */
|
|
338
|
+
int32_t prompt_tokens;
|
|
339
|
+
|
|
340
|
+
/** Thinking tokens if thinking pattern was used */
|
|
341
|
+
int32_t thinking_tokens;
|
|
342
|
+
|
|
343
|
+
/** Response tokens (excluding thinking) */
|
|
344
|
+
int32_t response_tokens;
|
|
345
|
+
} rac_llm_stream_metrics_t;
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* @brief Complete streaming result
|
|
349
|
+
*
|
|
350
|
+
* Final result after streaming generation is complete.
|
|
351
|
+
*/
|
|
352
|
+
typedef struct rac_llm_stream_result {
|
|
353
|
+
/** Full generated text (owned, must be freed with rac_free) */
|
|
354
|
+
char* text;
|
|
355
|
+
|
|
356
|
+
/** Extracted thinking content if pattern was provided (can be NULL) */
|
|
357
|
+
char* thinking_content;
|
|
358
|
+
|
|
359
|
+
/** Generation metrics */
|
|
360
|
+
rac_llm_stream_metrics_t metrics;
|
|
361
|
+
|
|
362
|
+
/** Error code if generation failed (RAC_SUCCESS on success) */
|
|
363
|
+
rac_result_t error_code;
|
|
364
|
+
|
|
365
|
+
/** Error message if generation failed (can be NULL) */
|
|
366
|
+
char* error_message;
|
|
367
|
+
} rac_llm_stream_result_t;
|
|
368
|
+
|
|
369
|
+
// =============================================================================
|
|
370
|
+
// MEMORY MANAGEMENT
|
|
371
|
+
// =============================================================================
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* @brief Free LLM result resources
|
|
375
|
+
*
|
|
376
|
+
* @param result Result to free (can be NULL)
|
|
377
|
+
*/
|
|
378
|
+
RAC_API void rac_llm_result_free(rac_llm_result_t* result);
|
|
379
|
+
|
|
380
|
+
#ifdef __cplusplus
|
|
381
|
+
}
|
|
382
|
+
#endif
|
|
383
|
+
|
|
384
|
+
#endif /* RAC_LLM_TYPES_H */
|