alkove 0.1.1
alkove: ^0.1.1 copied to clipboard
Alkove for Flutter: Focus, Cue, Spot, Timbre and Lex on the device, over the native Android and iOS SDKs.
alkove #
Alkove for Flutter, on the native SDKs: ai.alkove:alkove on Android, the iOS SDK's Swift sources and its AlkoveFFI XCFramework on iOS (an app takes this plugin or the Alkove Swift package, not both). The surface of @alkove/react-native in Dart: AgentInput and WakeListener with their events as a Stream, Spot.compile and Spot.commands, Alkove.configure, Alkove.preload and Alkove.cached. Android and iOS, no Flutter web.
import 'package:alkove/alkove.dart';
final word = await Spot.compile('Hey Nova', lang: ['en']);
final wake = await WakeListener.start(WakeOptions([word]));
wake.events.listen((e) {
if (e is Wake) startListening();
});
final input = await AgentInput.start(const AgentOptions(utterances: true));
input.events.listen((e) => switch (e) {
Utterance(:final pcm) => transcribe(pcm),
TurnEnd() => agent.reply(),
Interrupt() => player.stop(),
_ => null,
});
// input.farEndActive(true) while the agent speaks: from the first call, the input learns the user's print
On iOS, the app's Info.plist needs NSMicrophoneUsageDescription; on Android, the plugin brings the permission and asks for it the first time an input starts.
The example app is in example. flutter test runs the Dart tests; scripts/integration.sh android emulator-5554 or scripts/integration.sh ios <simulator> runs the example's integration test on a device, on its microphone.
Apache-2.0.