aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore55
-rw-r--r--.metadata15
-rw-r--r--lib/grpc/generated/voice_agent.pb.dart715
-rw-r--r--lib/grpc/generated/voice_agent.pbenum.dart73
-rw-r--r--lib/grpc/generated/voice_agent.pbgrpc.dart113
-rw-r--r--lib/grpc/generated/voice_agent.pbjson.dart157
-rw-r--r--lib/grpc/voice_agent_client.dart18
-rw-r--r--lib/main.dart6
-rw-r--r--lib/models/app_state.dart2
-rw-r--r--lib/protos/voice_agent.proto30
-rw-r--r--lib/providers/service_status.dart7
-rw-r--r--lib/screens/home_screen.dart135
-rw-r--r--lib/widgets/assistant_mode_choice.dart4
-rw-r--r--lib/widgets/chat_section.dart14
-rw-r--r--lib/widgets/nlu_engine_choice.dart4
-rw-r--r--lib/widgets/try_commands.dart87
-rw-r--r--pubspec.lock30
17 files changed, 909 insertions, 556 deletions
diff --git a/.gitignore b/.gitignore
index 0295d78..a269bcb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -43,57 +43,8 @@ app.*.map.json
/android/app/profile
/android/app/release
-# Flutter/Dart-specific files
-.dart_tool/
-.flutter-plugins
-.pub/
-build/
-.dart_tool/
-.idea/
-.packages
-
-# Android-specific files
-android/
-*.iml
-local.properties
-.gradle
-/build/
-/captures/
-
-# iOS-specific files
-ios/
-Podfile.lock
-Pods/
-*.xcworkspace
-*.pbxproj
-*.mode1v3
-*.mode2v3
-*.perspectivev3
-
-# Windows-specific files
+# ignore folders other than linux
windows/
-*.suo
-*.user
-*.sln
-*.vcxproj
-*.filters
-Runner.sln
-Runner.vcxproj
-Runner.vcxproj.filters
-
-# macOS-specific files
macos/
-macos/Flutter/Flutter.xcodeproj/
-macos/Flutter/Generated.xcconfig/
-macos/Flutter/flutter_assets/
-macos/Flutter/clang.xcconfig
-macos/Flutter/AppFrameworkInfo.plist
-macos/Flutter/flutter_export_environment.sh
-macos/Runner.xcodeproj/
-
-# Web-specific files
-web/
-web/index.html
-web/main.dart.js
-web/packages/
-web/.dart_tool/ \ No newline at end of file
+android/
+ios/ \ No newline at end of file
diff --git a/.metadata b/.metadata
index 620e877..f8b7ed3 100644
--- a/.metadata
+++ b/.metadata
@@ -15,24 +15,9 @@ migration:
- platform: root
create_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
base_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
- - platform: android
- create_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
- base_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
- - platform: ios
- create_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
- base_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
- platform: linux
create_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
base_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
- - platform: macos
- create_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
- base_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
- - platform: web
- create_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
- base_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
- - platform: windows
- create_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
- base_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
# User provided section
diff --git a/lib/grpc/generated/voice_agent.pb.dart b/lib/grpc/generated/voice_agent.pb.dart
index 363e93f..2c0f9fa 100644
--- a/lib/grpc/generated/voice_agent.pb.dart
+++ b/lib/grpc/generated/voice_agent.pb.dart
@@ -20,27 +20,23 @@ export 'voice_agent.pbenum.dart';
class Empty extends $pb.GeneratedMessage {
factory Empty() => create();
Empty._() : super();
- factory Empty.fromBuffer($core.List<$core.int> i,
- [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
- create()..mergeFromBuffer(i, r);
- factory Empty.fromJson($core.String i,
- [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
- create()..mergeFromJson(i, r);
-
- static final $pb.BuilderInfo _i = $pb.BuilderInfo(
- _omitMessageNames ? '' : 'Empty',
- createEmptyInstance: create)
- ..hasRequiredFields = false;
-
- @$core.Deprecated('Using this can add significant overhead to your binary. '
- 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
- 'Will be removed in next major version')
+ factory Empty.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
+ factory Empty.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Empty', createEmptyInstance: create)
+ ..hasRequiredFields = false
+ ;
+
+ @$core.Deprecated(
+ 'Using this can add significant overhead to your binary. '
+ 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
+ 'Will be removed in next major version')
Empty clone() => Empty()..mergeFromMessage(this);
- @$core.Deprecated('Using this can add significant overhead to your binary. '
- 'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
- 'Will be removed in next major version')
- Empty copyWith(void Function(Empty) updates) =>
- super.copyWith((message) => updates(message as Empty)) as Empty;
+ @$core.Deprecated(
+ 'Using this can add significant overhead to your binary. '
+ 'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
+ 'Will be removed in next major version')
+ Empty copyWith(void Function(Empty) updates) => super.copyWith((message) => updates(message as Empty)) as Empty;
$pb.BuilderInfo get info_ => _i;
@@ -49,8 +45,7 @@ class Empty extends $pb.GeneratedMessage {
Empty createEmptyInstance() => create();
static $pb.PbList<Empty> createRepeated() => $pb.PbList<Empty>();
@$core.pragma('dart2js:noInline')
- static Empty getDefault() =>
- _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Empty>(create);
+ static Empty getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Empty>(create);
static Empty? _defaultInstance;
}
@@ -58,6 +53,7 @@ class ServiceStatus extends $pb.GeneratedMessage {
factory ServiceStatus({
$core.String? version,
$core.bool? status,
+ $core.String? wakeWord,
}) {
final $result = create();
if (version != null) {
@@ -66,53 +62,47 @@ class ServiceStatus extends $pb.GeneratedMessage {
if (status != null) {
$result.status = status;
}
+ if (wakeWord != null) {
+ $result.wakeWord = wakeWord;
+ }
return $result;
}
ServiceStatus._() : super();
- factory ServiceStatus.fromBuffer($core.List<$core.int> i,
- [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
- create()..mergeFromBuffer(i, r);
- factory ServiceStatus.fromJson($core.String i,
- [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
- create()..mergeFromJson(i, r);
-
- static final $pb.BuilderInfo _i = $pb.BuilderInfo(
- _omitMessageNames ? '' : 'ServiceStatus',
- createEmptyInstance: create)
+ factory ServiceStatus.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
+ factory ServiceStatus.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'ServiceStatus', createEmptyInstance: create)
..aOS(1, _omitFieldNames ? '' : 'version')
..aOB(2, _omitFieldNames ? '' : 'status')
- ..hasRequiredFields = false;
-
- @$core.Deprecated('Using this can add significant overhead to your binary. '
- 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
- 'Will be removed in next major version')
+ ..aOS(3, _omitFieldNames ? '' : 'wakeWord')
+ ..hasRequiredFields = false
+ ;
+
+ @$core.Deprecated(
+ 'Using this can add significant overhead to your binary. '
+ 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
+ 'Will be removed in next major version')
ServiceStatus clone() => ServiceStatus()..mergeFromMessage(this);
- @$core.Deprecated('Using this can add significant overhead to your binary. '
- 'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
- 'Will be removed in next major version')
- ServiceStatus copyWith(void Function(ServiceStatus) updates) =>
- super.copyWith((message) => updates(message as ServiceStatus))
- as ServiceStatus;
+ @$core.Deprecated(
+ 'Using this can add significant overhead to your binary. '
+ 'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
+ 'Will be removed in next major version')
+ ServiceStatus copyWith(void Function(ServiceStatus) updates) => super.copyWith((message) => updates(message as ServiceStatus)) as ServiceStatus;
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static ServiceStatus create() => ServiceStatus._();
ServiceStatus createEmptyInstance() => create();
- static $pb.PbList<ServiceStatus> createRepeated() =>
- $pb.PbList<ServiceStatus>();
+ static $pb.PbList<ServiceStatus> createRepeated() => $pb.PbList<ServiceStatus>();
@$core.pragma('dart2js:noInline')
- static ServiceStatus getDefault() => _defaultInstance ??=
- $pb.GeneratedMessage.$_defaultFor<ServiceStatus>(create);
+ static ServiceStatus getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<ServiceStatus>(create);
static ServiceStatus? _defaultInstance;
@$pb.TagNumber(1)
$core.String get version => $_getSZ(0);
@$pb.TagNumber(1)
- set version($core.String v) {
- $_setString(0, v);
- }
-
+ set version($core.String v) { $_setString(0, v); }
@$pb.TagNumber(1)
$core.bool hasVersion() => $_has(0);
@$pb.TagNumber(1)
@@ -121,14 +111,112 @@ class ServiceStatus extends $pb.GeneratedMessage {
@$pb.TagNumber(2)
$core.bool get status => $_getBF(1);
@$pb.TagNumber(2)
- set status($core.bool v) {
- $_setBool(1, v);
- }
-
+ set status($core.bool v) { $_setBool(1, v); }
@$pb.TagNumber(2)
$core.bool hasStatus() => $_has(1);
@$pb.TagNumber(2)
void clearStatus() => clearField(2);
+
+ @$pb.TagNumber(3)
+ $core.String get wakeWord => $_getSZ(2);
+ @$pb.TagNumber(3)
+ set wakeWord($core.String v) { $_setString(2, v); }
+ @$pb.TagNumber(3)
+ $core.bool hasWakeWord() => $_has(2);
+ @$pb.TagNumber(3)
+ void clearWakeWord() => clearField(3);
+}
+
+class VoiceAudio extends $pb.GeneratedMessage {
+ factory VoiceAudio({
+ $core.List<$core.int>? audioChunk,
+ $core.String? audioFormat,
+ $core.int? sampleRate,
+ $core.String? language,
+ }) {
+ final $result = create();
+ if (audioChunk != null) {
+ $result.audioChunk = audioChunk;
+ }
+ if (audioFormat != null) {
+ $result.audioFormat = audioFormat;
+ }
+ if (sampleRate != null) {
+ $result.sampleRate = sampleRate;
+ }
+ if (language != null) {
+ $result.language = language;
+ }
+ return $result;
+ }
+ VoiceAudio._() : super();
+ factory VoiceAudio.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
+ factory VoiceAudio.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'VoiceAudio', createEmptyInstance: create)
+ ..a<$core.List<$core.int>>(1, _omitFieldNames ? '' : 'audioChunk', $pb.PbFieldType.OY)
+ ..aOS(2, _omitFieldNames ? '' : 'audioFormat')
+ ..a<$core.int>(3, _omitFieldNames ? '' : 'sampleRate', $pb.PbFieldType.O3)
+ ..aOS(4, _omitFieldNames ? '' : 'language')
+ ..hasRequiredFields = false
+ ;
+
+ @$core.Deprecated(
+ 'Using this can add significant overhead to your binary. '
+ 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
+ 'Will be removed in next major version')
+ VoiceAudio clone() => VoiceAudio()..mergeFromMessage(this);
+ @$core.Deprecated(
+ 'Using this can add significant overhead to your binary. '
+ 'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
+ 'Will be removed in next major version')
+ VoiceAudio copyWith(void Function(VoiceAudio) updates) => super.copyWith((message) => updates(message as VoiceAudio)) as VoiceAudio;
+
+ $pb.BuilderInfo get info_ => _i;
+
+ @$core.pragma('dart2js:noInline')
+ static VoiceAudio create() => VoiceAudio._();
+ VoiceAudio createEmptyInstance() => create();
+ static $pb.PbList<VoiceAudio> createRepeated() => $pb.PbList<VoiceAudio>();
+ @$core.pragma('dart2js:noInline')
+ static VoiceAudio getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<VoiceAudio>(create);
+ static VoiceAudio? _defaultInstance;
+
+ @$pb.TagNumber(1)
+ $core.List<$core.int> get audioChunk => $_getN(0);
+ @$pb.TagNumber(1)
+ set audioChunk($core.List<$core.int> v) { $_setBytes(0, v); }
+ @$pb.TagNumber(1)
+ $core.bool hasAudioChunk() => $_has(0);
+ @$pb.TagNumber(1)
+ void clearAudioChunk() => clearField(1);
+
+ @$pb.TagNumber(2)
+ $core.String get audioFormat => $_getSZ(1);
+ @$pb.TagNumber(2)
+ set audioFormat($core.String v) { $_setString(1, v); }
+ @$pb.TagNumber(2)
+ $core.bool hasAudioFormat() => $_has(1);
+ @$pb.TagNumber(2)
+ void clearAudioFormat() => clearField(2);
+
+ @$pb.TagNumber(3)
+ $core.int get sampleRate => $_getIZ(2);
+ @$pb.TagNumber(3)
+ set sampleRate($core.int v) { $_setSignedInt32(2, v); }
+ @$pb.TagNumber(3)
+ $core.bool hasSampleRate() => $_has(2);
+ @$pb.TagNumber(3)
+ void clearSampleRate() => clearField(3);
+
+ @$pb.TagNumber(4)
+ $core.String get language => $_getSZ(3);
+ @$pb.TagNumber(4)
+ set language($core.String v) { $_setString(3, v); }
+ @$pb.TagNumber(4)
+ $core.bool hasLanguage() => $_has(3);
+ @$pb.TagNumber(4)
+ void clearLanguage() => clearField(4);
}
class WakeWordStatus extends $pb.GeneratedMessage {
@@ -142,57 +230,127 @@ class WakeWordStatus extends $pb.GeneratedMessage {
return $result;
}
WakeWordStatus._() : super();
- factory WakeWordStatus.fromBuffer($core.List<$core.int> i,
- [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
- create()..mergeFromBuffer(i, r);
- factory WakeWordStatus.fromJson($core.String i,
- [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
- create()..mergeFromJson(i, r);
-
- static final $pb.BuilderInfo _i = $pb.BuilderInfo(
- _omitMessageNames ? '' : 'WakeWordStatus',
- createEmptyInstance: create)
+ factory WakeWordStatus.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
+ factory WakeWordStatus.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'WakeWordStatus', createEmptyInstance: create)
..aOB(1, _omitFieldNames ? '' : 'status')
- ..hasRequiredFields = false;
+ ..hasRequiredFields = false
+ ;
- @$core.Deprecated('Using this can add significant overhead to your binary. '
- 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
- 'Will be removed in next major version')
+ @$core.Deprecated(
+ 'Using this can add significant overhead to your binary. '
+ 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
+ 'Will be removed in next major version')
WakeWordStatus clone() => WakeWordStatus()..mergeFromMessage(this);
- @$core.Deprecated('Using this can add significant overhead to your binary. '
- 'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
- 'Will be removed in next major version')
- WakeWordStatus copyWith(void Function(WakeWordStatus) updates) =>
- super.copyWith((message) => updates(message as WakeWordStatus))
- as WakeWordStatus;
+ @$core.Deprecated(
+ 'Using this can add significant overhead to your binary. '
+ 'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
+ 'Will be removed in next major version')
+ WakeWordStatus copyWith(void Function(WakeWordStatus) updates) => super.copyWith((message) => updates(message as WakeWordStatus)) as WakeWordStatus;
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static WakeWordStatus create() => WakeWordStatus._();
WakeWordStatus createEmptyInstance() => create();
- static $pb.PbList<WakeWordStatus> createRepeated() =>
- $pb.PbList<WakeWordStatus>();
+ static $pb.PbList<WakeWordStatus> createRepeated() => $pb.PbList<WakeWordStatus>();
@$core.pragma('dart2js:noInline')
- static WakeWordStatus getDefault() => _defaultInstance ??=
- $pb.GeneratedMessage.$_defaultFor<WakeWordStatus>(create);
+ static WakeWordStatus getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<WakeWordStatus>(create);
static WakeWordStatus? _defaultInstance;
@$pb.TagNumber(1)
$core.bool get status => $_getBF(0);
@$pb.TagNumber(1)
- set status($core.bool v) {
- $_setBool(0, v);
- }
-
+ set status($core.bool v) { $_setBool(0, v); }
@$pb.TagNumber(1)
$core.bool hasStatus() => $_has(0);
@$pb.TagNumber(1)
void clearStatus() => clearField(1);
}
-class RecognizeControl extends $pb.GeneratedMessage {
- factory RecognizeControl({
+class S_RecognizeVoiceControl extends $pb.GeneratedMessage {
+ factory S_RecognizeVoiceControl({
+ VoiceAudio? audioStream,
+ NLUModel? nluModel,
+ $core.String? streamId,
+ }) {
+ final $result = create();
+ if (audioStream != null) {
+ $result.audioStream = audioStream;
+ }
+ if (nluModel != null) {
+ $result.nluModel = nluModel;
+ }
+ if (streamId != null) {
+ $result.streamId = streamId;
+ }
+ return $result;
+ }
+ S_RecognizeVoiceControl._() : super();
+ factory S_RecognizeVoiceControl.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
+ factory S_RecognizeVoiceControl.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'S_RecognizeVoiceControl', createEmptyInstance: create)
+ ..aOM<VoiceAudio>(1, _omitFieldNames ? '' : 'audioStream', subBuilder: VoiceAudio.create)
+ ..e<NLUModel>(2, _omitFieldNames ? '' : 'nluModel', $pb.PbFieldType.OE, defaultOrMaker: NLUModel.SNIPS, valueOf: NLUModel.valueOf, enumValues: NLUModel.values)
+ ..aOS(3, _omitFieldNames ? '' : 'streamId')
+ ..hasRequiredFields = false
+ ;
+
+ @$core.Deprecated(
+ 'Using this can add significant overhead to your binary. '
+ 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
+ 'Will be removed in next major version')
+ S_RecognizeVoiceControl clone() => S_RecognizeVoiceControl()..mergeFromMessage(this);
+ @$core.Deprecated(
+ 'Using this can add significant overhead to your binary. '
+ 'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
+ 'Will be removed in next major version')
+ S_RecognizeVoiceControl copyWith(void Function(S_RecognizeVoiceControl) updates) => super.copyWith((message) => updates(message as S_RecognizeVoiceControl)) as S_RecognizeVoiceControl;
+
+ $pb.BuilderInfo get info_ => _i;
+
+ @$core.pragma('dart2js:noInline')
+ static S_RecognizeVoiceControl create() => S_RecognizeVoiceControl._();
+ S_RecognizeVoiceControl createEmptyInstance() => create();
+ static $pb.PbList<S_RecognizeVoiceControl> createRepeated() => $pb.PbList<S_RecognizeVoiceControl>();
+ @$core.pragma('dart2js:noInline')
+ static S_RecognizeVoiceControl getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<S_RecognizeVoiceControl>(create);
+ static S_RecognizeVoiceControl? _defaultInstance;
+
+ @$pb.TagNumber(1)
+ VoiceAudio get audioStream => $_getN(0);
+ @$pb.TagNumber(1)
+ set audioStream(VoiceAudio v) { setField(1, v); }
+ @$pb.TagNumber(1)
+ $core.bool hasAudioStream() => $_has(0);
+ @$pb.TagNumber(1)
+ void clearAudioStream() => clearField(1);
+ @$pb.TagNumber(1)
+ VoiceAudio ensureAudioStream() => $_ensure(0);
+
+ @$pb.TagNumber(2)
+ NLUModel get nluModel => $_getN(1);
+ @$pb.TagNumber(2)
+ set nluModel(NLUModel v) { setField(2, v); }
+ @$pb.TagNumber(2)
+ $core.bool hasNluModel() => $_has(1);
+ @$pb.TagNumber(2)
+ void clearNluModel() => clearField(2);
+
+ @$pb.TagNumber(3)
+ $core.String get streamId => $_getSZ(2);
+ @$pb.TagNumber(3)
+ set streamId($core.String v) { $_setString(2, v); }
+ @$pb.TagNumber(3)
+ $core.bool hasStreamId() => $_has(2);
+ @$pb.TagNumber(3)
+ void clearStreamId() => clearField(3);
+}
+
+class RecognizeVoiceControl extends $pb.GeneratedMessage {
+ factory RecognizeVoiceControl({
RecordAction? action,
NLUModel? nluModel,
RecordMode? recordMode,
@@ -213,62 +371,43 @@ class RecognizeControl extends $pb.GeneratedMessage {
}
return $result;
}
- RecognizeControl._() : super();
- factory RecognizeControl.fromBuffer($core.List<$core.int> i,
- [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
- create()..mergeFromBuffer(i, r);
- factory RecognizeControl.fromJson($core.String i,
- [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
- create()..mergeFromJson(i, r);
-
- static final $pb.BuilderInfo _i = $pb.BuilderInfo(
- _omitMessageNames ? '' : 'RecognizeControl',
- createEmptyInstance: create)
- ..e<RecordAction>(1, _omitFieldNames ? '' : 'action', $pb.PbFieldType.OE,
- defaultOrMaker: RecordAction.START,
- valueOf: RecordAction.valueOf,
- enumValues: RecordAction.values)
- ..e<NLUModel>(2, _omitFieldNames ? '' : 'nluModel', $pb.PbFieldType.OE,
- defaultOrMaker: NLUModel.SNIPS,
- valueOf: NLUModel.valueOf,
- enumValues: NLUModel.values)
- ..e<RecordMode>(3, _omitFieldNames ? '' : 'recordMode', $pb.PbFieldType.OE,
- defaultOrMaker: RecordMode.MANUAL,
- valueOf: RecordMode.valueOf,
- enumValues: RecordMode.values)
+ RecognizeVoiceControl._() : super();
+ factory RecognizeVoiceControl.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
+ factory RecognizeVoiceControl.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'RecognizeVoiceControl', createEmptyInstance: create)
+ ..e<RecordAction>(1, _omitFieldNames ? '' : 'action', $pb.PbFieldType.OE, defaultOrMaker: RecordAction.START, valueOf: RecordAction.valueOf, enumValues: RecordAction.values)
+ ..e<NLUModel>(2, _omitFieldNames ? '' : 'nluModel', $pb.PbFieldType.OE, defaultOrMaker: NLUModel.SNIPS, valueOf: NLUModel.valueOf, enumValues: NLUModel.values)
+ ..e<RecordMode>(3, _omitFieldNames ? '' : 'recordMode', $pb.PbFieldType.OE, defaultOrMaker: RecordMode.MANUAL, valueOf: RecordMode.valueOf, enumValues: RecordMode.values)
..aOS(4, _omitFieldNames ? '' : 'streamId')
- ..hasRequiredFields = false;
-
- @$core.Deprecated('Using this can add significant overhead to your binary. '
- 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
- 'Will be removed in next major version')
- RecognizeControl clone() => RecognizeControl()..mergeFromMessage(this);
- @$core.Deprecated('Using this can add significant overhead to your binary. '
- 'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
- 'Will be removed in next major version')
- RecognizeControl copyWith(void Function(RecognizeControl) updates) =>
- super.copyWith((message) => updates(message as RecognizeControl))
- as RecognizeControl;
+ ..hasRequiredFields = false
+ ;
+
+ @$core.Deprecated(
+ 'Using this can add significant overhead to your binary. '
+ 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
+ 'Will be removed in next major version')
+ RecognizeVoiceControl clone() => RecognizeVoiceControl()..mergeFromMessage(this);
+ @$core.Deprecated(
+ 'Using this can add significant overhead to your binary. '
+ 'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
+ 'Will be removed in next major version')
+ RecognizeVoiceControl copyWith(void Function(RecognizeVoiceControl) updates) => super.copyWith((message) => updates(message as RecognizeVoiceControl)) as RecognizeVoiceControl;
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
- static RecognizeControl create() => RecognizeControl._();
- RecognizeControl createEmptyInstance() => create();
- static $pb.PbList<RecognizeControl> createRepeated() =>
- $pb.PbList<RecognizeControl>();
+ static RecognizeVoiceControl create() => RecognizeVoiceControl._();
+ RecognizeVoiceControl createEmptyInstance() => create();
+ static $pb.PbList<RecognizeVoiceControl> createRepeated() => $pb.PbList<RecognizeVoiceControl>();
@$core.pragma('dart2js:noInline')
- static RecognizeControl getDefault() => _defaultInstance ??=
- $pb.GeneratedMessage.$_defaultFor<RecognizeControl>(create);
- static RecognizeControl? _defaultInstance;
+ static RecognizeVoiceControl getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<RecognizeVoiceControl>(create);
+ static RecognizeVoiceControl? _defaultInstance;
@$pb.TagNumber(1)
RecordAction get action => $_getN(0);
@$pb.TagNumber(1)
- set action(RecordAction v) {
- setField(1, v);
- }
-
+ set action(RecordAction v) { setField(1, v); }
@$pb.TagNumber(1)
$core.bool hasAction() => $_has(0);
@$pb.TagNumber(1)
@@ -277,10 +416,7 @@ class RecognizeControl extends $pb.GeneratedMessage {
@$pb.TagNumber(2)
NLUModel get nluModel => $_getN(1);
@$pb.TagNumber(2)
- set nluModel(NLUModel v) {
- setField(2, v);
- }
-
+ set nluModel(NLUModel v) { setField(2, v); }
@$pb.TagNumber(2)
$core.bool hasNluModel() => $_has(1);
@$pb.TagNumber(2)
@@ -289,10 +425,7 @@ class RecognizeControl extends $pb.GeneratedMessage {
@$pb.TagNumber(3)
RecordMode get recordMode => $_getN(2);
@$pb.TagNumber(3)
- set recordMode(RecordMode v) {
- setField(3, v);
- }
-
+ set recordMode(RecordMode v) { setField(3, v); }
@$pb.TagNumber(3)
$core.bool hasRecordMode() => $_has(2);
@$pb.TagNumber(3)
@@ -301,16 +434,77 @@ class RecognizeControl extends $pb.GeneratedMessage {
@$pb.TagNumber(4)
$core.String get streamId => $_getSZ(3);
@$pb.TagNumber(4)
- set streamId($core.String v) {
- $_setString(3, v);
- }
-
+ set streamId($core.String v) { $_setString(3, v); }
@$pb.TagNumber(4)
$core.bool hasStreamId() => $_has(3);
@$pb.TagNumber(4)
void clearStreamId() => clearField(4);
}
+class RecognizeTextControl extends $pb.GeneratedMessage {
+ factory RecognizeTextControl({
+ $core.String? textCommand,
+ NLUModel? nluModel,
+ }) {
+ final $result = create();
+ if (textCommand != null) {
+ $result.textCommand = textCommand;
+ }
+ if (nluModel != null) {
+ $result.nluModel = nluModel;
+ }
+ return $result;
+ }
+ RecognizeTextControl._() : super();
+ factory RecognizeTextControl.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
+ factory RecognizeTextControl.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'RecognizeTextControl', createEmptyInstance: create)
+ ..aOS(1, _omitFieldNames ? '' : 'textCommand')
+ ..e<NLUModel>(2, _omitFieldNames ? '' : 'nluModel', $pb.PbFieldType.OE, defaultOrMaker: NLUModel.SNIPS, valueOf: NLUModel.valueOf, enumValues: NLUModel.values)
+ ..hasRequiredFields = false
+ ;
+
+ @$core.Deprecated(
+ 'Using this can add significant overhead to your binary. '
+ 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
+ 'Will be removed in next major version')
+ RecognizeTextControl clone() => RecognizeTextControl()..mergeFromMessage(this);
+ @$core.Deprecated(
+ 'Using this can add significant overhead to your binary. '
+ 'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
+ 'Will be removed in next major version')
+ RecognizeTextControl copyWith(void Function(RecognizeTextControl) updates) => super.copyWith((message) => updates(message as RecognizeTextControl)) as RecognizeTextControl;
+
+ $pb.BuilderInfo get info_ => _i;
+
+ @$core.pragma('dart2js:noInline')
+ static RecognizeTextControl create() => RecognizeTextControl._();
+ RecognizeTextControl createEmptyInstance() => create();
+ static $pb.PbList<RecognizeTextControl> createRepeated() => $pb.PbList<RecognizeTextControl>();
+ @$core.pragma('dart2js:noInline')
+ static RecognizeTextControl getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<RecognizeTextControl>(create);
+ static RecognizeTextControl? _defaultInstance;
+
+ @$pb.TagNumber(1)
+ $core.String get textCommand => $_getSZ(0);
+ @$pb.TagNumber(1)
+ set textCommand($core.String v) { $_setString(0, v); }
+ @$pb.TagNumber(1)
+ $core.bool hasTextCommand() => $_has(0);
+ @$pb.TagNumber(1)
+ void clearTextCommand() => clearField(1);
+
+ @$pb.TagNumber(2)
+ NLUModel get nluModel => $_getN(1);
+ @$pb.TagNumber(2)
+ set nluModel(NLUModel v) { setField(2, v); }
+ @$pb.TagNumber(2)
+ $core.bool hasNluModel() => $_has(1);
+ @$pb.TagNumber(2)
+ void clearNluModel() => clearField(2);
+}
+
class IntentSlot extends $pb.GeneratedMessage {
factory IntentSlot({
$core.String? name,
@@ -326,29 +520,25 @@ class IntentSlot extends $pb.GeneratedMessage {
return $result;
}
IntentSlot._() : super();
- factory IntentSlot.fromBuffer($core.List<$core.int> i,
- [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
- create()..mergeFromBuffer(i, r);
- factory IntentSlot.fromJson($core.String i,
- [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
- create()..mergeFromJson(i, r);
-
- static final $pb.BuilderInfo _i = $pb.BuilderInfo(
- _omitMessageNames ? '' : 'IntentSlot',
- createEmptyInstance: create)
+ factory IntentSlot.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
+ factory IntentSlot.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'IntentSlot', createEmptyInstance: create)
..aOS(1, _omitFieldNames ? '' : 'name')
..aOS(2, _omitFieldNames ? '' : 'value')
- ..hasRequiredFields = false;
+ ..hasRequiredFields = false
+ ;
- @$core.Deprecated('Using this can add significant overhead to your binary. '
- 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
- 'Will be removed in next major version')
+ @$core.Deprecated(
+ 'Using this can add significant overhead to your binary. '
+ 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
+ 'Will be removed in next major version')
IntentSlot clone() => IntentSlot()..mergeFromMessage(this);
- @$core.Deprecated('Using this can add significant overhead to your binary. '
- 'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
- 'Will be removed in next major version')
- IntentSlot copyWith(void Function(IntentSlot) updates) =>
- super.copyWith((message) => updates(message as IntentSlot)) as IntentSlot;
+ @$core.Deprecated(
+ 'Using this can add significant overhead to your binary. '
+ 'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
+ 'Will be removed in next major version')
+ IntentSlot copyWith(void Function(IntentSlot) updates) => super.copyWith((message) => updates(message as IntentSlot)) as IntentSlot;
$pb.BuilderInfo get info_ => _i;
@@ -357,17 +547,13 @@ class IntentSlot extends $pb.GeneratedMessage {
IntentSlot createEmptyInstance() => create();
static $pb.PbList<IntentSlot> createRepeated() => $pb.PbList<IntentSlot>();
@$core.pragma('dart2js:noInline')
- static IntentSlot getDefault() => _defaultInstance ??=
- $pb.GeneratedMessage.$_defaultFor<IntentSlot>(create);
+ static IntentSlot getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<IntentSlot>(create);
static IntentSlot? _defaultInstance;
@$pb.TagNumber(1)
$core.String get name => $_getSZ(0);
@$pb.TagNumber(1)
- set name($core.String v) {
- $_setString(0, v);
- }
-
+ set name($core.String v) { $_setString(0, v); }
@$pb.TagNumber(1)
$core.bool hasName() => $_has(0);
@$pb.TagNumber(1)
@@ -376,10 +562,7 @@ class IntentSlot extends $pb.GeneratedMessage {
@$pb.TagNumber(2)
$core.String get value => $_getSZ(1);
@$pb.TagNumber(2)
- set value($core.String v) {
- $_setString(1, v);
- }
-
+ set value($core.String v) { $_setString(1, v); }
@$pb.TagNumber(2)
$core.bool hasValue() => $_has(1);
@$pb.TagNumber(2)
@@ -413,59 +596,43 @@ class RecognizeResult extends $pb.GeneratedMessage {
return $result;
}
RecognizeResult._() : super();
- factory RecognizeResult.fromBuffer($core.List<$core.int> i,
- [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
- create()..mergeFromBuffer(i, r);
- factory RecognizeResult.fromJson($core.String i,
- [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
- create()..mergeFromJson(i, r);
-
- static final $pb.BuilderInfo _i = $pb.BuilderInfo(
- _omitMessageNames ? '' : 'RecognizeResult',
- createEmptyInstance: create)
+ factory RecognizeResult.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
+ factory RecognizeResult.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'RecognizeResult', createEmptyInstance: create)
..aOS(1, _omitFieldNames ? '' : 'command')
..aOS(2, _omitFieldNames ? '' : 'intent')
- ..pc<IntentSlot>(
- 3, _omitFieldNames ? '' : 'intentSlots', $pb.PbFieldType.PM,
- subBuilder: IntentSlot.create)
+ ..pc<IntentSlot>(3, _omitFieldNames ? '' : 'intentSlots', $pb.PbFieldType.PM, subBuilder: IntentSlot.create)
..aOS(4, _omitFieldNames ? '' : 'streamId')
- ..e<RecognizeStatusType>(
- 5, _omitFieldNames ? '' : 'status', $pb.PbFieldType.OE,
- defaultOrMaker: RecognizeStatusType.REC_ERROR,
- valueOf: RecognizeStatusType.valueOf,
- enumValues: RecognizeStatusType.values)
- ..hasRequiredFields = false;
-
- @$core.Deprecated('Using this can add significant overhead to your binary. '
- 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
- 'Will be removed in next major version')
+ ..e<RecognizeStatusType>(5, _omitFieldNames ? '' : 'status', $pb.PbFieldType.OE, defaultOrMaker: RecognizeStatusType.REC_ERROR, valueOf: RecognizeStatusType.valueOf, enumValues: RecognizeStatusType.values)
+ ..hasRequiredFields = false
+ ;
+
+ @$core.Deprecated(
+ 'Using this can add significant overhead to your binary. '
+ 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
+ 'Will be removed in next major version')
RecognizeResult clone() => RecognizeResult()..mergeFromMessage(this);
- @$core.Deprecated('Using this can add significant overhead to your binary. '
- 'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
- 'Will be removed in next major version')
- RecognizeResult copyWith(void Function(RecognizeResult) updates) =>
- super.copyWith((message) => updates(message as RecognizeResult))
- as RecognizeResult;
+ @$core.Deprecated(
+ 'Using this can add significant overhead to your binary. '
+ 'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
+ 'Will be removed in next major version')
+ RecognizeResult copyWith(void Function(RecognizeResult) updates) => super.copyWith((message) => updates(message as RecognizeResult)) as RecognizeResult;
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static RecognizeResult create() => RecognizeResult._();
RecognizeResult createEmptyInstance() => create();
- static $pb.PbList<RecognizeResult> createRepeated() =>
- $pb.PbList<RecognizeResult>();
+ static $pb.PbList<RecognizeResult> createRepeated() => $pb.PbList<RecognizeResult>();
@$core.pragma('dart2js:noInline')
- static RecognizeResult getDefault() => _defaultInstance ??=
- $pb.GeneratedMessage.$_defaultFor<RecognizeResult>(create);
+ static RecognizeResult getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<RecognizeResult>(create);
static RecognizeResult? _defaultInstance;
@$pb.TagNumber(1)
$core.String get command => $_getSZ(0);
@$pb.TagNumber(1)
- set command($core.String v) {
- $_setString(0, v);
- }
-
+ set command($core.String v) { $_setString(0, v); }
@$pb.TagNumber(1)
$core.bool hasCommand() => $_has(0);
@$pb.TagNumber(1)
@@ -474,10 +641,7 @@ class RecognizeResult extends $pb.GeneratedMessage {
@$pb.TagNumber(2)
$core.String get intent => $_getSZ(1);
@$pb.TagNumber(2)
- set intent($core.String v) {
- $_setString(1, v);
- }
-
+ set intent($core.String v) { $_setString(1, v); }
@$pb.TagNumber(2)
$core.bool hasIntent() => $_has(1);
@$pb.TagNumber(2)
@@ -489,10 +653,7 @@ class RecognizeResult extends $pb.GeneratedMessage {
@$pb.TagNumber(4)
$core.String get streamId => $_getSZ(3);
@$pb.TagNumber(4)
- set streamId($core.String v) {
- $_setString(3, v);
- }
-
+ set streamId($core.String v) { $_setString(3, v); }
@$pb.TagNumber(4)
$core.bool hasStreamId() => $_has(3);
@$pb.TagNumber(4)
@@ -501,10 +662,7 @@ class RecognizeResult extends $pb.GeneratedMessage {
@$pb.TagNumber(5)
RecognizeStatusType get status => $_getN(4);
@$pb.TagNumber(5)
- set status(RecognizeStatusType v) {
- setField(5, v);
- }
-
+ set status(RecognizeStatusType v) { setField(5, v); }
@$pb.TagNumber(5)
$core.bool hasStatus() => $_has(4);
@$pb.TagNumber(5)
@@ -526,52 +684,40 @@ class ExecuteInput extends $pb.GeneratedMessage {
return $result;
}
ExecuteInput._() : super();
- factory ExecuteInput.fromBuffer($core.List<$core.int> i,
- [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
- create()..mergeFromBuffer(i, r);
- factory ExecuteInput.fromJson($core.String i,
- [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
- create()..mergeFromJson(i, r);
-
- static final $pb.BuilderInfo _i = $pb.BuilderInfo(
- _omitMessageNames ? '' : 'ExecuteInput',
- createEmptyInstance: create)
+ factory ExecuteInput.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
+ factory ExecuteInput.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'ExecuteInput', createEmptyInstance: create)
..aOS(1, _omitFieldNames ? '' : 'intent')
- ..pc<IntentSlot>(
- 2, _omitFieldNames ? '' : 'intentSlots', $pb.PbFieldType.PM,
- subBuilder: IntentSlot.create)
- ..hasRequiredFields = false;
-
- @$core.Deprecated('Using this can add significant overhead to your binary. '
- 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
- 'Will be removed in next major version')
+ ..pc<IntentSlot>(2, _omitFieldNames ? '' : 'intentSlots', $pb.PbFieldType.PM, subBuilder: IntentSlot.create)
+ ..hasRequiredFields = false
+ ;
+
+ @$core.Deprecated(
+ 'Using this can add significant overhead to your binary. '
+ 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
+ 'Will be removed in next major version')
ExecuteInput clone() => ExecuteInput()..mergeFromMessage(this);
- @$core.Deprecated('Using this can add significant overhead to your binary. '
- 'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
- 'Will be removed in next major version')
- ExecuteInput copyWith(void Function(ExecuteInput) updates) =>
- super.copyWith((message) => updates(message as ExecuteInput))
- as ExecuteInput;
+ @$core.Deprecated(
+ 'Using this can add significant overhead to your binary. '
+ 'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
+ 'Will be removed in next major version')
+ ExecuteInput copyWith(void Function(ExecuteInput) updates) => super.copyWith((message) => updates(message as ExecuteInput)) as ExecuteInput;
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static ExecuteInput create() => ExecuteInput._();
ExecuteInput createEmptyInstance() => create();
- static $pb.PbList<ExecuteInput> createRepeated() =>
- $pb.PbList<ExecuteInput>();
+ static $pb.PbList<ExecuteInput> createRepeated() => $pb.PbList<ExecuteInput>();
@$core.pragma('dart2js:noInline')
- static ExecuteInput getDefault() => _defaultInstance ??=
- $pb.GeneratedMessage.$_defaultFor<ExecuteInput>(create);
+ static ExecuteInput getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<ExecuteInput>(create);
static ExecuteInput? _defaultInstance;
@$pb.TagNumber(1)
$core.String get intent => $_getSZ(0);
@$pb.TagNumber(1)
- set intent($core.String v) {
- $_setString(0, v);
- }
-
+ set intent($core.String v) { $_setString(0, v); }
@$pb.TagNumber(1)
$core.bool hasIntent() => $_has(0);
@$pb.TagNumber(1)
@@ -596,54 +742,40 @@ class ExecuteResult extends $pb.GeneratedMessage {
return $result;
}
ExecuteResult._() : super();
- factory ExecuteResult.fromBuffer($core.List<$core.int> i,
- [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
- create()..mergeFromBuffer(i, r);
- factory ExecuteResult.fromJson($core.String i,
- [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
- create()..mergeFromJson(i, r);
-
- static final $pb.BuilderInfo _i = $pb.BuilderInfo(
- _omitMessageNames ? '' : 'ExecuteResult',
- createEmptyInstance: create)
+ factory ExecuteResult.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
+ factory ExecuteResult.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
+
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'ExecuteResult', createEmptyInstance: create)
..aOS(1, _omitFieldNames ? '' : 'response')
- ..e<ExecuteStatusType>(
- 2, _omitFieldNames ? '' : 'status', $pb.PbFieldType.OE,
- defaultOrMaker: ExecuteStatusType.EXEC_ERROR,
- valueOf: ExecuteStatusType.valueOf,
- enumValues: ExecuteStatusType.values)
- ..hasRequiredFields = false;
-
- @$core.Deprecated('Using this can add significant overhead to your binary. '
- 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
- 'Will be removed in next major version')
+ ..e<ExecuteStatusType>(2, _omitFieldNames ? '' : 'status', $pb.PbFieldType.OE, defaultOrMaker: ExecuteStatusType.EXEC_ERROR, valueOf: ExecuteStatusType.valueOf, enumValues: ExecuteStatusType.values)
+ ..hasRequiredFields = false
+ ;
+
+ @$core.Deprecated(
+ 'Using this can add significant overhead to your binary. '
+ 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
+ 'Will be removed in next major version')
ExecuteResult clone() => ExecuteResult()..mergeFromMessage(this);
- @$core.Deprecated('Using this can add significant overhead to your binary. '
- 'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
- 'Will be removed in next major version')
- ExecuteResult copyWith(void Function(ExecuteResult) updates) =>
- super.copyWith((message) => updates(message as ExecuteResult))
- as ExecuteResult;
+ @$core.Deprecated(
+ 'Using this can add significant overhead to your binary. '
+ 'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
+ 'Will be removed in next major version')
+ ExecuteResult copyWith(void Function(ExecuteResult) updates) => super.copyWith((message) => updates(message as ExecuteResult)) as ExecuteResult;
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static ExecuteResult create() => ExecuteResult._();
ExecuteResult createEmptyInstance() => create();
- static $pb.PbList<ExecuteResult> createRepeated() =>
- $pb.PbList<ExecuteResult>();
+ static $pb.PbList<ExecuteResult> createRepeated() => $pb.PbList<ExecuteResult>();
@$core.pragma('dart2js:noInline')
- static ExecuteResult getDefault() => _defaultInstance ??=
- $pb.GeneratedMessage.$_defaultFor<ExecuteResult>(create);
+ static ExecuteResult getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<ExecuteResult>(create);
static ExecuteResult? _defaultInstance;
@$pb.TagNumber(1)
$core.String get response => $_getSZ(0);
@$pb.TagNumber(1)
- set response($core.String v) {
- $_setString(0, v);
- }
-
+ set response($core.String v) { $_setString(0, v); }
@$pb.TagNumber(1)
$core.bool hasResponse() => $_has(0);
@$pb.TagNumber(1)
@@ -652,16 +784,13 @@ class ExecuteResult extends $pb.GeneratedMessage {
@$pb.TagNumber(2)
ExecuteStatusType get status => $_getN(1);
@$pb.TagNumber(2)
- set status(ExecuteStatusType v) {
- setField(2, v);
- }
-
+ set status(ExecuteStatusType v) { setField(2, v); }
@$pb.TagNumber(2)
$core.bool hasStatus() => $_has(1);
@$pb.TagNumber(2)
void clearStatus() => clearField(2);
}
+
const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names');
-const _omitMessageNames =
- $core.bool.fromEnvironment('protobuf.omit_message_names');
+const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names');
diff --git a/lib/grpc/generated/voice_agent.pbenum.dart b/lib/grpc/generated/voice_agent.pbenum.dart
index a001f03..78da13f 100644
--- a/lib/grpc/generated/voice_agent.pbenum.dart
+++ b/lib/grpc/generated/voice_agent.pbenum.dart
@@ -14,18 +14,15 @@ import 'dart:core' as $core;
import 'package:protobuf/protobuf.dart' as $pb;
class RecordAction extends $pb.ProtobufEnum {
- static const RecordAction START =
- RecordAction._(0, _omitEnumNames ? '' : 'START');
- static const RecordAction STOP =
- RecordAction._(1, _omitEnumNames ? '' : 'STOP');
+ static const RecordAction START = RecordAction._(0, _omitEnumNames ? '' : 'START');
+ static const RecordAction STOP = RecordAction._(1, _omitEnumNames ? '' : 'STOP');
- static const $core.List<RecordAction> values = <RecordAction>[
+ static const $core.List<RecordAction> values = <RecordAction> [
START,
STOP,
];
- static final $core.Map<$core.int, RecordAction> _byValue =
- $pb.ProtobufEnum.initByValue(values);
+ static final $core.Map<$core.int, RecordAction> _byValue = $pb.ProtobufEnum.initByValue(values);
static RecordAction? valueOf($core.int value) => _byValue[value];
const RecordAction._($core.int v, $core.String n) : super(v, n);
@@ -35,75 +32,65 @@ class NLUModel extends $pb.ProtobufEnum {
static const NLUModel SNIPS = NLUModel._(0, _omitEnumNames ? '' : 'SNIPS');
static const NLUModel RASA = NLUModel._(1, _omitEnumNames ? '' : 'RASA');
- static const $core.List<NLUModel> values = <NLUModel>[
+ static const $core.List<NLUModel> values = <NLUModel> [
SNIPS,
RASA,
];
- static final $core.Map<$core.int, NLUModel> _byValue =
- $pb.ProtobufEnum.initByValue(values);
+ static final $core.Map<$core.int, NLUModel> _byValue = $pb.ProtobufEnum.initByValue(values);
static NLUModel? valueOf($core.int value) => _byValue[value];
const NLUModel._($core.int v, $core.String n) : super(v, n);
}
class RecordMode extends $pb.ProtobufEnum {
- static const RecordMode MANUAL =
- RecordMode._(0, _omitEnumNames ? '' : 'MANUAL');
+ static const RecordMode MANUAL = RecordMode._(0, _omitEnumNames ? '' : 'MANUAL');
static const RecordMode AUTO = RecordMode._(1, _omitEnumNames ? '' : 'AUTO');
- static const $core.List<RecordMode> values = <RecordMode>[
+ static const $core.List<RecordMode> values = <RecordMode> [
MANUAL,
AUTO,
];
- static final $core.Map<$core.int, RecordMode> _byValue =
- $pb.ProtobufEnum.initByValue(values);
+ static final $core.Map<$core.int, RecordMode> _byValue = $pb.ProtobufEnum.initByValue(values);
static RecordMode? valueOf($core.int value) => _byValue[value];
const RecordMode._($core.int v, $core.String n) : super(v, n);
}
class RecognizeStatusType extends $pb.ProtobufEnum {
- static const RecognizeStatusType REC_ERROR =
- RecognizeStatusType._(0, _omitEnumNames ? '' : 'REC_ERROR');
- static const RecognizeStatusType REC_SUCCESS =
- RecognizeStatusType._(1, _omitEnumNames ? '' : 'REC_SUCCESS');
- static const RecognizeStatusType REC_PROCESSING =
- RecognizeStatusType._(2, _omitEnumNames ? '' : 'REC_PROCESSING');
- static const RecognizeStatusType VOICE_NOT_RECOGNIZED =
- RecognizeStatusType._(3, _omitEnumNames ? '' : 'VOICE_NOT_RECOGNIZED');
- static const RecognizeStatusType INTENT_NOT_RECOGNIZED =
- RecognizeStatusType._(4, _omitEnumNames ? '' : 'INTENT_NOT_RECOGNIZED');
-
- static const $core.List<RecognizeStatusType> values = <RecognizeStatusType>[
+ static const RecognizeStatusType REC_ERROR = RecognizeStatusType._(0, _omitEnumNames ? '' : 'REC_ERROR');
+ static const RecognizeStatusType REC_SUCCESS = RecognizeStatusType._(1, _omitEnumNames ? '' : 'REC_SUCCESS');
+ static const RecognizeStatusType REC_PROCESSING = RecognizeStatusType._(2, _omitEnumNames ? '' : 'REC_PROCESSING');
+ static const RecognizeStatusType VOICE_NOT_RECOGNIZED = RecognizeStatusType._(3, _omitEnumNames ? '' : 'VOICE_NOT_RECOGNIZED');
+ static const RecognizeStatusType INTENT_NOT_RECOGNIZED = RecognizeStatusType._(4, _omitEnumNames ? '' : 'INTENT_NOT_RECOGNIZED');
+ static const RecognizeStatusType TEXT_NOT_RECOGNIZED = RecognizeStatusType._(5, _omitEnumNames ? '' : 'TEXT_NOT_RECOGNIZED');
+ static const RecognizeStatusType NLU_MODEL_NOT_SUPPORTED = RecognizeStatusType._(6, _omitEnumNames ? '' : 'NLU_MODEL_NOT_SUPPORTED');
+
+ static const $core.List<RecognizeStatusType> values = <RecognizeStatusType> [
REC_ERROR,
REC_SUCCESS,
REC_PROCESSING,
VOICE_NOT_RECOGNIZED,
INTENT_NOT_RECOGNIZED,
+ TEXT_NOT_RECOGNIZED,
+ NLU_MODEL_NOT_SUPPORTED,
];
- static final $core.Map<$core.int, RecognizeStatusType> _byValue =
- $pb.ProtobufEnum.initByValue(values);
+ static final $core.Map<$core.int, RecognizeStatusType> _byValue = $pb.ProtobufEnum.initByValue(values);
static RecognizeStatusType? valueOf($core.int value) => _byValue[value];
const RecognizeStatusType._($core.int v, $core.String n) : super(v, n);
}
class ExecuteStatusType extends $pb.ProtobufEnum {
- static const ExecuteStatusType EXEC_ERROR =
- ExecuteStatusType._(0, _omitEnumNames ? '' : 'EXEC_ERROR');
- static const ExecuteStatusType EXEC_SUCCESS =
- ExecuteStatusType._(1, _omitEnumNames ? '' : 'EXEC_SUCCESS');
- static const ExecuteStatusType KUKSA_CONN_ERROR =
- ExecuteStatusType._(2, _omitEnumNames ? '' : 'KUKSA_CONN_ERROR');
- static const ExecuteStatusType INTENT_NOT_SUPPORTED =
- ExecuteStatusType._(3, _omitEnumNames ? '' : 'INTENT_NOT_SUPPORTED');
- static const ExecuteStatusType INTENT_SLOTS_INCOMPLETE =
- ExecuteStatusType._(4, _omitEnumNames ? '' : 'INTENT_SLOTS_INCOMPLETE');
-
- static const $core.List<ExecuteStatusType> values = <ExecuteStatusType>[
+ static const ExecuteStatusType EXEC_ERROR = ExecuteStatusType._(0, _omitEnumNames ? '' : 'EXEC_ERROR');
+ static const ExecuteStatusType EXEC_SUCCESS = ExecuteStatusType._(1, _omitEnumNames ? '' : 'EXEC_SUCCESS');
+ static const ExecuteStatusType KUKSA_CONN_ERROR = ExecuteStatusType._(2, _omitEnumNames ? '' : 'KUKSA_CONN_ERROR');
+ static const ExecuteStatusType INTENT_NOT_SUPPORTED = ExecuteStatusType._(3, _omitEnumNames ? '' : 'INTENT_NOT_SUPPORTED');
+ static const ExecuteStatusType INTENT_SLOTS_INCOMPLETE = ExecuteStatusType._(4, _omitEnumNames ? '' : 'INTENT_SLOTS_INCOMPLETE');
+
+ static const $core.List<ExecuteStatusType> values = <ExecuteStatusType> [
EXEC_ERROR,
EXEC_SUCCESS,
KUKSA_CONN_ERROR,
@@ -111,11 +98,11 @@ class ExecuteStatusType extends $pb.ProtobufEnum {
INTENT_SLOTS_INCOMPLETE,
];
- static final $core.Map<$core.int, ExecuteStatusType> _byValue =
- $pb.ProtobufEnum.initByValue(values);
+ static final $core.Map<$core.int, ExecuteStatusType> _byValue = $pb.ProtobufEnum.initByValue(values);
static ExecuteStatusType? valueOf($core.int value) => _byValue[value];
const ExecuteStatusType._($core.int v, $core.String n) : super(v, n);
}
+
const _omitEnumNames = $core.bool.fromEnvironment('protobuf.omit_enum_names');
diff --git a/lib/grpc/generated/voice_agent.pbgrpc.dart b/lib/grpc/generated/voice_agent.pbgrpc.dart
index 7984ed3..502c797 100644
--- a/lib/grpc/generated/voice_agent.pbgrpc.dart
+++ b/lib/grpc/generated/voice_agent.pbgrpc.dart
@@ -26,20 +26,37 @@ class VoiceAgentServiceClient extends $grpc.Client {
'/VoiceAgentService/CheckServiceStatus',
($0.Empty value) => value.writeToBuffer(),
($core.List<$core.int> value) => $0.ServiceStatus.fromBuffer(value));
+ static final _$s_DetectWakeWord =
+ $grpc.ClientMethod<$0.VoiceAudio, $0.WakeWordStatus>(
+ '/VoiceAgentService/S_DetectWakeWord',
+ ($0.VoiceAudio value) => value.writeToBuffer(),
+ ($core.List<$core.int> value) => $0.WakeWordStatus.fromBuffer(value));
static final _$detectWakeWord =
$grpc.ClientMethod<$0.Empty, $0.WakeWordStatus>(
'/VoiceAgentService/DetectWakeWord',
($0.Empty value) => value.writeToBuffer(),
($core.List<$core.int> value) => $0.WakeWordStatus.fromBuffer(value));
+ static final _$s_RecognizeVoiceCommand =
+ $grpc.ClientMethod<$0.S_RecognizeVoiceControl, $0.RecognizeResult>(
+ '/VoiceAgentService/S_RecognizeVoiceCommand',
+ ($0.S_RecognizeVoiceControl value) => value.writeToBuffer(),
+ ($core.List<$core.int> value) =>
+ $0.RecognizeResult.fromBuffer(value));
static final _$recognizeVoiceCommand =
- $grpc.ClientMethod<$0.RecognizeControl, $0.RecognizeResult>(
+ $grpc.ClientMethod<$0.RecognizeVoiceControl, $0.RecognizeResult>(
'/VoiceAgentService/RecognizeVoiceCommand',
- ($0.RecognizeControl value) => value.writeToBuffer(),
+ ($0.RecognizeVoiceControl value) => value.writeToBuffer(),
($core.List<$core.int> value) =>
$0.RecognizeResult.fromBuffer(value));
- static final _$executeVoiceCommand =
+ static final _$recognizeTextCommand =
+ $grpc.ClientMethod<$0.RecognizeTextControl, $0.RecognizeResult>(
+ '/VoiceAgentService/RecognizeTextCommand',
+ ($0.RecognizeTextControl value) => value.writeToBuffer(),
+ ($core.List<$core.int> value) =>
+ $0.RecognizeResult.fromBuffer(value));
+ static final _$executeCommand =
$grpc.ClientMethod<$0.ExecuteInput, $0.ExecuteResult>(
- '/VoiceAgentService/ExecuteVoiceCommand',
+ '/VoiceAgentService/ExecuteCommand',
($0.ExecuteInput value) => value.writeToBuffer(),
($core.List<$core.int> value) => $0.ExecuteResult.fromBuffer(value));
@@ -53,6 +70,12 @@ class VoiceAgentServiceClient extends $grpc.Client {
return $createUnaryCall(_$checkServiceStatus, request, options: options);
}
+ $grpc.ResponseStream<$0.WakeWordStatus> s_DetectWakeWord(
+ $async.Stream<$0.VoiceAudio> request,
+ {$grpc.CallOptions? options}) {
+ return $createStreamingCall(_$s_DetectWakeWord, request, options: options);
+ }
+
$grpc.ResponseStream<$0.WakeWordStatus> detectWakeWord($0.Empty request,
{$grpc.CallOptions? options}) {
return $createStreamingCall(
@@ -60,18 +83,31 @@ class VoiceAgentServiceClient extends $grpc.Client {
options: options);
}
+ $grpc.ResponseFuture<$0.RecognizeResult> s_RecognizeVoiceCommand(
+ $async.Stream<$0.S_RecognizeVoiceControl> request,
+ {$grpc.CallOptions? options}) {
+ return $createStreamingCall(_$s_RecognizeVoiceCommand, request,
+ options: options)
+ .single;
+ }
+
$grpc.ResponseFuture<$0.RecognizeResult> recognizeVoiceCommand(
- $async.Stream<$0.RecognizeControl> request,
+ $async.Stream<$0.RecognizeVoiceControl> request,
{$grpc.CallOptions? options}) {
return $createStreamingCall(_$recognizeVoiceCommand, request,
options: options)
.single;
}
- $grpc.ResponseFuture<$0.ExecuteResult> executeVoiceCommand(
- $0.ExecuteInput request,
+ $grpc.ResponseFuture<$0.RecognizeResult> recognizeTextCommand(
+ $0.RecognizeTextControl request,
+ {$grpc.CallOptions? options}) {
+ return $createUnaryCall(_$recognizeTextCommand, request, options: options);
+ }
+
+ $grpc.ResponseFuture<$0.ExecuteResult> executeCommand($0.ExecuteInput request,
{$grpc.CallOptions? options}) {
- return $createUnaryCall(_$executeVoiceCommand, request, options: options);
+ return $createUnaryCall(_$executeCommand, request, options: options);
}
}
@@ -87,6 +123,13 @@ abstract class VoiceAgentServiceBase extends $grpc.Service {
false,
($core.List<$core.int> value) => $0.Empty.fromBuffer(value),
($0.ServiceStatus value) => value.writeToBuffer()));
+ $addMethod($grpc.ServiceMethod<$0.VoiceAudio, $0.WakeWordStatus>(
+ 'S_DetectWakeWord',
+ s_DetectWakeWord,
+ true,
+ true,
+ ($core.List<$core.int> value) => $0.VoiceAudio.fromBuffer(value),
+ ($0.WakeWordStatus value) => value.writeToBuffer()));
$addMethod($grpc.ServiceMethod<$0.Empty, $0.WakeWordStatus>(
'DetectWakeWord',
detectWakeWord_Pre,
@@ -94,16 +137,35 @@ abstract class VoiceAgentServiceBase extends $grpc.Service {
true,
($core.List<$core.int> value) => $0.Empty.fromBuffer(value),
($0.WakeWordStatus value) => value.writeToBuffer()));
- $addMethod($grpc.ServiceMethod<$0.RecognizeControl, $0.RecognizeResult>(
- 'RecognizeVoiceCommand',
- recognizeVoiceCommand,
- true,
+ $addMethod(
+ $grpc.ServiceMethod<$0.S_RecognizeVoiceControl, $0.RecognizeResult>(
+ 'S_RecognizeVoiceCommand',
+ s_RecognizeVoiceCommand,
+ true,
+ false,
+ ($core.List<$core.int> value) =>
+ $0.S_RecognizeVoiceControl.fromBuffer(value),
+ ($0.RecognizeResult value) => value.writeToBuffer()));
+ $addMethod(
+ $grpc.ServiceMethod<$0.RecognizeVoiceControl, $0.RecognizeResult>(
+ 'RecognizeVoiceCommand',
+ recognizeVoiceCommand,
+ true,
+ false,
+ ($core.List<$core.int> value) =>
+ $0.RecognizeVoiceControl.fromBuffer(value),
+ ($0.RecognizeResult value) => value.writeToBuffer()));
+ $addMethod($grpc.ServiceMethod<$0.RecognizeTextControl, $0.RecognizeResult>(
+ 'RecognizeTextCommand',
+ recognizeTextCommand_Pre,
+ false,
false,
- ($core.List<$core.int> value) => $0.RecognizeControl.fromBuffer(value),
+ ($core.List<$core.int> value) =>
+ $0.RecognizeTextControl.fromBuffer(value),
($0.RecognizeResult value) => value.writeToBuffer()));
$addMethod($grpc.ServiceMethod<$0.ExecuteInput, $0.ExecuteResult>(
- 'ExecuteVoiceCommand',
- executeVoiceCommand_Pre,
+ 'ExecuteCommand',
+ executeCommand_Pre,
false,
false,
($core.List<$core.int> value) => $0.ExecuteInput.fromBuffer(value),
@@ -120,17 +182,30 @@ abstract class VoiceAgentServiceBase extends $grpc.Service {
yield* detectWakeWord(call, await request);
}
- $async.Future<$0.ExecuteResult> executeVoiceCommand_Pre(
+ $async.Future<$0.RecognizeResult> recognizeTextCommand_Pre(
+ $grpc.ServiceCall call,
+ $async.Future<$0.RecognizeTextControl> request) async {
+ return recognizeTextCommand(call, await request);
+ }
+
+ $async.Future<$0.ExecuteResult> executeCommand_Pre(
$grpc.ServiceCall call, $async.Future<$0.ExecuteInput> request) async {
- return executeVoiceCommand(call, await request);
+ return executeCommand(call, await request);
}
$async.Future<$0.ServiceStatus> checkServiceStatus(
$grpc.ServiceCall call, $0.Empty request);
+ $async.Stream<$0.WakeWordStatus> s_DetectWakeWord(
+ $grpc.ServiceCall call, $async.Stream<$0.VoiceAudio> request);
$async.Stream<$0.WakeWordStatus> detectWakeWord(
$grpc.ServiceCall call, $0.Empty request);
+ $async.Future<$0.RecognizeResult> s_RecognizeVoiceCommand(
+ $grpc.ServiceCall call,
+ $async.Stream<$0.S_RecognizeVoiceControl> request);
$async.Future<$0.RecognizeResult> recognizeVoiceCommand(
- $grpc.ServiceCall call, $async.Stream<$0.RecognizeControl> request);
- $async.Future<$0.ExecuteResult> executeVoiceCommand(
+ $grpc.ServiceCall call, $async.Stream<$0.RecognizeVoiceControl> request);
+ $async.Future<$0.RecognizeResult> recognizeTextCommand(
+ $grpc.ServiceCall call, $0.RecognizeTextControl request);
+ $async.Future<$0.ExecuteResult> executeCommand(
$grpc.ServiceCall call, $0.ExecuteInput request);
}
diff --git a/lib/grpc/generated/voice_agent.pbjson.dart b/lib/grpc/generated/voice_agent.pbjson.dart
index f4a913c..6fa9502 100644
--- a/lib/grpc/generated/voice_agent.pbjson.dart
+++ b/lib/grpc/generated/voice_agent.pbjson.dart
@@ -23,8 +23,8 @@ const RecordAction$json = {
};
/// Descriptor for `RecordAction`. Decode as a `google.protobuf.EnumDescriptorProto`.
-final $typed_data.Uint8List recordActionDescriptor =
- $convert.base64Decode('CgxSZWNvcmRBY3Rpb24SCQoFU1RBUlQQABIICgRTVE9QEAE=');
+final $typed_data.Uint8List recordActionDescriptor = $convert.base64Decode(
+ 'CgxSZWNvcmRBY3Rpb24SCQoFU1RBUlQQABIICgRTVE9QEAE=');
@$core.Deprecated('Use nLUModelDescriptor instead')
const NLUModel$json = {
@@ -36,8 +36,8 @@ const NLUModel$json = {
};
/// Descriptor for `NLUModel`. Decode as a `google.protobuf.EnumDescriptorProto`.
-final $typed_data.Uint8List nLUModelDescriptor =
- $convert.base64Decode('CghOTFVNb2RlbBIJCgVTTklQUxAAEggKBFJBU0EQAQ==');
+final $typed_data.Uint8List nLUModelDescriptor = $convert.base64Decode(
+ 'CghOTFVNb2RlbBIJCgVTTklQUxAAEggKBFJBU0EQAQ==');
@$core.Deprecated('Use recordModeDescriptor instead')
const RecordMode$json = {
@@ -49,8 +49,8 @@ const RecordMode$json = {
};
/// Descriptor for `RecordMode`. Decode as a `google.protobuf.EnumDescriptorProto`.
-final $typed_data.Uint8List recordModeDescriptor =
- $convert.base64Decode('CgpSZWNvcmRNb2RlEgoKBk1BTlVBTBAAEggKBEFVVE8QAQ==');
+final $typed_data.Uint8List recordModeDescriptor = $convert.base64Decode(
+ 'CgpSZWNvcmRNb2RlEgoKBk1BTlVBTBAAEggKBEFVVE8QAQ==');
@$core.Deprecated('Use recognizeStatusTypeDescriptor instead')
const RecognizeStatusType$json = {
@@ -61,6 +61,8 @@ const RecognizeStatusType$json = {
{'1': 'REC_PROCESSING', '2': 2},
{'1': 'VOICE_NOT_RECOGNIZED', '2': 3},
{'1': 'INTENT_NOT_RECOGNIZED', '2': 4},
+ {'1': 'TEXT_NOT_RECOGNIZED', '2': 5},
+ {'1': 'NLU_MODEL_NOT_SUPPORTED', '2': 6},
],
};
@@ -68,7 +70,8 @@ const RecognizeStatusType$json = {
final $typed_data.Uint8List recognizeStatusTypeDescriptor = $convert.base64Decode(
'ChNSZWNvZ25pemVTdGF0dXNUeXBlEg0KCVJFQ19FUlJPUhAAEg8KC1JFQ19TVUNDRVNTEAESEg'
'oOUkVDX1BST0NFU1NJTkcQAhIYChRWT0lDRV9OT1RfUkVDT0dOSVpFRBADEhkKFUlOVEVOVF9O'
- 'T1RfUkVDT0dOSVpFRBAE');
+ 'T1RfUkVDT0dOSVpFRBAEEhcKE1RFWFRfTk9UX1JFQ09HTklaRUQQBRIbChdOTFVfTU9ERUxfTk'
+ '9UX1NVUFBPUlRFRBAG');
@$core.Deprecated('Use executeStatusTypeDescriptor instead')
const ExecuteStatusType$json = {
@@ -94,8 +97,8 @@ const Empty$json = {
};
/// Descriptor for `Empty`. Decode as a `google.protobuf.DescriptorProto`.
-final $typed_data.Uint8List emptyDescriptor =
- $convert.base64Decode('CgVFbXB0eQ==');
+final $typed_data.Uint8List emptyDescriptor = $convert.base64Decode(
+ 'CgVFbXB0eQ==');
@$core.Deprecated('Use serviceStatusDescriptor instead')
const ServiceStatus$json = {
@@ -103,13 +106,31 @@ const ServiceStatus$json = {
'2': [
{'1': 'version', '3': 1, '4': 1, '5': 9, '10': 'version'},
{'1': 'status', '3': 2, '4': 1, '5': 8, '10': 'status'},
+ {'1': 'wake_word', '3': 3, '4': 1, '5': 9, '10': 'wakeWord'},
],
};
/// Descriptor for `ServiceStatus`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List serviceStatusDescriptor = $convert.base64Decode(
'Cg1TZXJ2aWNlU3RhdHVzEhgKB3ZlcnNpb24YASABKAlSB3ZlcnNpb24SFgoGc3RhdHVzGAIgAS'
- 'gIUgZzdGF0dXM=');
+ 'gIUgZzdGF0dXMSGwoJd2FrZV93b3JkGAMgASgJUgh3YWtlV29yZA==');
+
+@$core.Deprecated('Use voiceAudioDescriptor instead')
+const VoiceAudio$json = {
+ '1': 'VoiceAudio',
+ '2': [
+ {'1': 'audio_chunk', '3': 1, '4': 1, '5': 12, '10': 'audioChunk'},
+ {'1': 'audio_format', '3': 2, '4': 1, '5': 9, '10': 'audioFormat'},
+ {'1': 'sample_rate', '3': 3, '4': 1, '5': 5, '10': 'sampleRate'},
+ {'1': 'language', '3': 4, '4': 1, '5': 9, '10': 'language'},
+ ],
+};
+
+/// Descriptor for `VoiceAudio`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List voiceAudioDescriptor = $convert.base64Decode(
+ 'CgpWb2ljZUF1ZGlvEh8KC2F1ZGlvX2NodW5rGAEgASgMUgphdWRpb0NodW5rEiEKDGF1ZGlvX2'
+ 'Zvcm1hdBgCIAEoCVILYXVkaW9Gb3JtYXQSHwoLc2FtcGxlX3JhdGUYAyABKAVSCnNhbXBsZVJh'
+ 'dGUSGgoIbGFuZ3VhZ2UYBCABKAlSCGxhbmd1YWdl');
@$core.Deprecated('Use wakeWordStatusDescriptor instead')
const WakeWordStatus$json = {
@@ -120,47 +141,56 @@ const WakeWordStatus$json = {
};
/// Descriptor for `WakeWordStatus`. Decode as a `google.protobuf.DescriptorProto`.
-final $typed_data.Uint8List wakeWordStatusDescriptor = $convert
- .base64Decode('Cg5XYWtlV29yZFN0YXR1cxIWCgZzdGF0dXMYASABKAhSBnN0YXR1cw==');
+final $typed_data.Uint8List wakeWordStatusDescriptor = $convert.base64Decode(
+ 'Cg5XYWtlV29yZFN0YXR1cxIWCgZzdGF0dXMYASABKAhSBnN0YXR1cw==');
+
+@$core.Deprecated('Use s_RecognizeVoiceControlDescriptor instead')
+const S_RecognizeVoiceControl$json = {
+ '1': 'S_RecognizeVoiceControl',
+ '2': [
+ {'1': 'audio_stream', '3': 1, '4': 1, '5': 11, '6': '.VoiceAudio', '10': 'audioStream'},
+ {'1': 'nlu_model', '3': 2, '4': 1, '5': 14, '6': '.NLUModel', '10': 'nluModel'},
+ {'1': 'stream_id', '3': 3, '4': 1, '5': 9, '10': 'streamId'},
+ ],
+};
+
+/// Descriptor for `S_RecognizeVoiceControl`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List s_RecognizeVoiceControlDescriptor = $convert.base64Decode(
+ 'ChdTX1JlY29nbml6ZVZvaWNlQ29udHJvbBIuCgxhdWRpb19zdHJlYW0YASABKAsyCy5Wb2ljZU'
+ 'F1ZGlvUgthdWRpb1N0cmVhbRImCglubHVfbW9kZWwYAiABKA4yCS5OTFVNb2RlbFIIbmx1TW9k'
+ 'ZWwSGwoJc3RyZWFtX2lkGAMgASgJUghzdHJlYW1JZA==');
-@$core.Deprecated('Use recognizeControlDescriptor instead')
-const RecognizeControl$json = {
- '1': 'RecognizeControl',
+@$core.Deprecated('Use recognizeVoiceControlDescriptor instead')
+const RecognizeVoiceControl$json = {
+ '1': 'RecognizeVoiceControl',
'2': [
- {
- '1': 'action',
- '3': 1,
- '4': 1,
- '5': 14,
- '6': '.RecordAction',
- '10': 'action'
- },
- {
- '1': 'nlu_model',
- '3': 2,
- '4': 1,
- '5': 14,
- '6': '.NLUModel',
- '10': 'nluModel'
- },
- {
- '1': 'record_mode',
- '3': 3,
- '4': 1,
- '5': 14,
- '6': '.RecordMode',
- '10': 'recordMode'
- },
+ {'1': 'action', '3': 1, '4': 1, '5': 14, '6': '.RecordAction', '10': 'action'},
+ {'1': 'nlu_model', '3': 2, '4': 1, '5': 14, '6': '.NLUModel', '10': 'nluModel'},
+ {'1': 'record_mode', '3': 3, '4': 1, '5': 14, '6': '.RecordMode', '10': 'recordMode'},
{'1': 'stream_id', '3': 4, '4': 1, '5': 9, '10': 'streamId'},
],
};
-/// Descriptor for `RecognizeControl`. Decode as a `google.protobuf.DescriptorProto`.
-final $typed_data.Uint8List recognizeControlDescriptor = $convert.base64Decode(
- 'ChBSZWNvZ25pemVDb250cm9sEiUKBmFjdGlvbhgBIAEoDjINLlJlY29yZEFjdGlvblIGYWN0aW'
- '9uEiYKCW5sdV9tb2RlbBgCIAEoDjIJLk5MVU1vZGVsUghubHVNb2RlbBIsCgtyZWNvcmRfbW9k'
- 'ZRgDIAEoDjILLlJlY29yZE1vZGVSCnJlY29yZE1vZGUSGwoJc3RyZWFtX2lkGAQgASgJUghzdH'
- 'JlYW1JZA==');
+/// Descriptor for `RecognizeVoiceControl`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List recognizeVoiceControlDescriptor = $convert.base64Decode(
+ 'ChVSZWNvZ25pemVWb2ljZUNvbnRyb2wSJQoGYWN0aW9uGAEgASgOMg0uUmVjb3JkQWN0aW9uUg'
+ 'ZhY3Rpb24SJgoJbmx1X21vZGVsGAIgASgOMgkuTkxVTW9kZWxSCG5sdU1vZGVsEiwKC3JlY29y'
+ 'ZF9tb2RlGAMgASgOMgsuUmVjb3JkTW9kZVIKcmVjb3JkTW9kZRIbCglzdHJlYW1faWQYBCABKA'
+ 'lSCHN0cmVhbUlk');
+
+@$core.Deprecated('Use recognizeTextControlDescriptor instead')
+const RecognizeTextControl$json = {
+ '1': 'RecognizeTextControl',
+ '2': [
+ {'1': 'text_command', '3': 1, '4': 1, '5': 9, '10': 'textCommand'},
+ {'1': 'nlu_model', '3': 2, '4': 1, '5': 14, '6': '.NLUModel', '10': 'nluModel'},
+ ],
+};
+
+/// Descriptor for `RecognizeTextControl`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List recognizeTextControlDescriptor = $convert.base64Decode(
+ 'ChRSZWNvZ25pemVUZXh0Q29udHJvbBIhCgx0ZXh0X2NvbW1hbmQYASABKAlSC3RleHRDb21tYW'
+ '5kEiYKCW5sdV9tb2RlbBgCIAEoDjIJLk5MVU1vZGVsUghubHVNb2RlbA==');
@$core.Deprecated('Use intentSlotDescriptor instead')
const IntentSlot$json = {
@@ -181,23 +211,9 @@ const RecognizeResult$json = {
'2': [
{'1': 'command', '3': 1, '4': 1, '5': 9, '10': 'command'},
{'1': 'intent', '3': 2, '4': 1, '5': 9, '10': 'intent'},
- {
- '1': 'intent_slots',
- '3': 3,
- '4': 3,
- '5': 11,
- '6': '.IntentSlot',
- '10': 'intentSlots'
- },
+ {'1': 'intent_slots', '3': 3, '4': 3, '5': 11, '6': '.IntentSlot', '10': 'intentSlots'},
{'1': 'stream_id', '3': 4, '4': 1, '5': 9, '10': 'streamId'},
- {
- '1': 'status',
- '3': 5,
- '4': 1,
- '5': 14,
- '6': '.RecognizeStatusType',
- '10': 'status'
- },
+ {'1': 'status', '3': 5, '4': 1, '5': 14, '6': '.RecognizeStatusType', '10': 'status'},
],
};
@@ -213,14 +229,7 @@ const ExecuteInput$json = {
'1': 'ExecuteInput',
'2': [
{'1': 'intent', '3': 1, '4': 1, '5': 9, '10': 'intent'},
- {
- '1': 'intent_slots',
- '3': 2,
- '4': 3,
- '5': 11,
- '6': '.IntentSlot',
- '10': 'intentSlots'
- },
+ {'1': 'intent_slots', '3': 2, '4': 3, '5': 11, '6': '.IntentSlot', '10': 'intentSlots'},
],
};
@@ -234,14 +243,7 @@ const ExecuteResult$json = {
'1': 'ExecuteResult',
'2': [
{'1': 'response', '3': 1, '4': 1, '5': 9, '10': 'response'},
- {
- '1': 'status',
- '3': 2,
- '4': 1,
- '5': 14,
- '6': '.ExecuteStatusType',
- '10': 'status'
- },
+ {'1': 'status', '3': 2, '4': 1, '5': 14, '6': '.ExecuteStatusType', '10': 'status'},
],
};
@@ -249,3 +251,4 @@ const ExecuteResult$json = {
final $typed_data.Uint8List executeResultDescriptor = $convert.base64Decode(
'Cg1FeGVjdXRlUmVzdWx0EhoKCHJlc3BvbnNlGAEgASgJUghyZXNwb25zZRIqCgZzdGF0dXMYAi'
'ABKA4yEi5FeGVjdXRlU3RhdHVzVHlwZVIGc3RhdHVz');
+
diff --git a/lib/grpc/voice_agent_client.dart b/lib/grpc/voice_agent_client.dart
index f25f0d2..089d2a5 100644
--- a/lib/grpc/voice_agent_client.dart
+++ b/lib/grpc/voice_agent_client.dart
@@ -43,7 +43,7 @@ class VoiceAgentClient {
}
Future<RecognizeResult> recognizeVoiceCommand(
- Stream<RecognizeControl> controlStream) async {
+ Stream<RecognizeVoiceControl> controlStream) async {
try {
final response = await _client.recognizeVoiceCommand(controlStream);
return response;
@@ -54,9 +54,21 @@ class VoiceAgentClient {
}
}
- Future<ExecuteResult> executeVoiceCommand(ExecuteInput input) async {
+ Future<RecognizeResult> recognizeTextCommand(
+ RecognizeTextControl controlInput) async {
try {
- final response = await _client.executeVoiceCommand(input);
+ final response = await _client.recognizeTextCommand(controlInput);
+ return response;
+ } catch (e) {
+ print('Error calling RecognizeTextCommand: $e');
+ // Handle the error gracefully, such as returning a default RecognizeResult
+ return RecognizeResult()..status = RecognizeStatusType.REC_ERROR;
+ }
+ }
+
+ Future<ExecuteResult> executeCommand(ExecuteInput input) async {
+ try {
+ final response = await _client.executeCommand(input);
return response;
} catch (e) {
print('Error calling ExecuteVoiceCommand: $e');
diff --git a/lib/main.dart b/lib/main.dart
index bc5b84b..b271b79 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -19,6 +19,7 @@ void main() async {
// Check the service status initially
final initialServiceStatus = await checkServiceStatus(config);
serviceStatusProvider.setServiceStatus(initialServiceStatus.status);
+ serviceStatusProvider.setWakeWord(initialServiceStatus.wakeWord);
runApp(
MultiProvider(
@@ -35,6 +36,9 @@ void main() async {
if (serviceStatus.status) {
serviceStatusProvider
.setServiceStatus(true); // Update the service status
+
+ serviceStatusProvider
+ .setWakeWord(serviceStatus.wakeWord); // Update the wake word
}
},
),
@@ -66,7 +70,7 @@ class App extends StatelessWidget {
home: Consumer<ServiceStatusProvider>(
builder: (context, provider, child) {
return provider.isServiceOnline
- ? HomePage(config: config)
+ ? HomePage(config: config, wakeWord: provider.wakeWord)
: ErrorScreen(
onRetry: onRetry, // Pass the callback to the ErrorScreen
); // Conditionally render HomePage or ErrorScreen
diff --git a/lib/models/app_state.dart b/lib/models/app_state.dart
index be39bd2..709b445 100644
--- a/lib/models/app_state.dart
+++ b/lib/models/app_state.dart
@@ -5,4 +5,6 @@ class AppState extends ChangeNotifier {
bool isWakeWordMode = false;
String intentEngine = "snips";
String streamId = "";
+ bool isCommandProcessing = false;
+ String commandProcessingText = "Processing...";
}
diff --git a/lib/protos/voice_agent.proto b/lib/protos/voice_agent.proto
index 8c3ab65..40dfe6a 100644
--- a/lib/protos/voice_agent.proto
+++ b/lib/protos/voice_agent.proto
@@ -3,9 +3,12 @@ syntax = "proto3";
service VoiceAgentService {
rpc CheckServiceStatus(Empty) returns (ServiceStatus);
+ rpc S_DetectWakeWord(stream VoiceAudio) returns (stream WakeWordStatus); // Stream version of DetectWakeWord, assumes audio is coming from client
rpc DetectWakeWord(Empty) returns (stream WakeWordStatus);
- rpc RecognizeVoiceCommand(stream RecognizeControl) returns (RecognizeResult);
- rpc ExecuteVoiceCommand(ExecuteInput) returns (ExecuteResult);
+ rpc S_RecognizeVoiceCommand(stream S_RecognizeVoiceControl) returns (RecognizeResult); // Stream version of RecognizeVoiceCommand, assumes audio is coming from client
+ rpc RecognizeVoiceCommand(stream RecognizeVoiceControl) returns (RecognizeResult);
+ rpc RecognizeTextCommand(RecognizeTextControl) returns (RecognizeResult);
+ rpc ExecuteCommand(ExecuteInput) returns (ExecuteResult);
}
@@ -30,6 +33,8 @@ enum RecognizeStatusType {
REC_PROCESSING = 2;
VOICE_NOT_RECOGNIZED = 3;
INTENT_NOT_RECOGNIZED = 4;
+ TEXT_NOT_RECOGNIZED = 5;
+ NLU_MODEL_NOT_SUPPORTED = 6;
}
enum ExecuteStatusType {
@@ -46,19 +51,38 @@ message Empty {}
message ServiceStatus {
string version = 1;
bool status = 2;
+ string wake_word = 3;
+}
+
+message VoiceAudio {
+ bytes audio_chunk = 1;
+ string audio_format = 2;
+ int32 sample_rate = 3;
+ string language = 4;
}
message WakeWordStatus {
bool status = 1;
}
-message RecognizeControl {
+message S_RecognizeVoiceControl {
+ VoiceAudio audio_stream = 1;
+ NLUModel nlu_model = 2;
+ string stream_id = 3;
+}
+
+message RecognizeVoiceControl {
RecordAction action = 1;
NLUModel nlu_model = 2;
RecordMode record_mode = 3;
string stream_id = 4;
}
+message RecognizeTextControl {
+ string text_command = 1;
+ NLUModel nlu_model = 2;
+}
+
message IntentSlot {
string name = 1;
string value = 2;
diff --git a/lib/providers/service_status.dart b/lib/providers/service_status.dart
index 595c92e..ac0e188 100644
--- a/lib/providers/service_status.dart
+++ b/lib/providers/service_status.dart
@@ -2,11 +2,18 @@ import 'package:flutter/material.dart';
class ServiceStatusProvider extends ChangeNotifier {
bool _isServiceOnline = false;
+ String _wakeWord = '';
bool get isServiceOnline => _isServiceOnline;
+ String get wakeWord => _wakeWord;
void setServiceStatus(bool isOnline) {
_isServiceOnline = isOnline;
notifyListeners(); // Notify listeners (i.e., widgets that depend on this value) about the change
}
+
+ void setWakeWord(String wakeWord) {
+ _wakeWord = wakeWord;
+ notifyListeners(); // Notify listeners (i.e., widgets that depend on this value) about the change
+ }
}
diff --git a/lib/screens/home_screen.dart b/lib/screens/home_screen.dart
index d19d461..bf1d020 100644
--- a/lib/screens/home_screen.dart
+++ b/lib/screens/home_screen.dart
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
+import 'package:flutter_voiceassistant/widgets/try_commands.dart';
import 'package:provider/provider.dart';
import 'dart:async';
import '../models/app_state.dart';
@@ -13,14 +14,16 @@ import '../utils/app_config.dart';
class HomePage extends StatefulWidget {
final AppConfig config;
+ final String wakeWord;
- HomePage({Key? key, required this.config});
+ HomePage({Key? key, required this.config, required this.wakeWord});
@override
HomePageState createState() => HomePageState();
}
class HomePageState extends State<HomePage> {
late AppConfig _config; // Store the config as an instance variable
+ late String _wakeWord; // Store the wake word as an instance variable
final ScrollController _scrollController = ScrollController();
List<ChatMessage> chatMessages = [];
StreamSubscription<WakeWordStatus>? _wakeWordStatusSubscription;
@@ -30,6 +33,7 @@ class HomePageState extends State<HomePage> {
void initState() {
super.initState();
_config = widget.config; // Initialize _config in the initState
+ _wakeWord = widget.wakeWord; // Initialize _wakeWord in the initState
addChatMessage(
"Assistant in Manual mode. You can send commands directly by pressing the record button.");
}
@@ -39,11 +43,12 @@ class HomePageState extends State<HomePage> {
clearChatMessages();
appState.streamId = "";
appState.isWakeWordDetected = false;
+ appState.isCommandProcessing = false;
if (newMode == AssistantMode.wakeWord) {
appState.isWakeWordMode = true;
addChatMessage(
- 'Switched to Wake Word mode. I\'ll listen for the wake word before responding.');
+ 'Switched to Wake Word mode. I\'ll listen for the wake word "$_wakeWord" before responding.');
toggleWakeWordDetection(context, true);
} else if (newMode == AssistantMode.manual) {
appState.isWakeWordMode = false;
@@ -99,13 +104,19 @@ class HomePageState extends State<HomePage> {
if (isRecording) {
appState.streamId = await startRecording();
} else {
+ appState.commandProcessingText = "Converting speech to text...";
+ appState.isCommandProcessing = true;
+ setState(
+ () {}); // Trigger a rebuild to ensure the loading indicator is shown, tis a bad practice though but deosn't heavily affect the performance
final response =
await stopRecording(appState.streamId, appState.intentEngine);
// Process and store the result
if (response.status == RecognizeStatusType.REC_SUCCESS) {
- await executeVoiceCommand(
+ appState.commandProcessingText = "Executing command...";
+ await executeCommand(
response); // Call executeVoiceCommand with the response
}
+ appState.isCommandProcessing = false;
}
}
@@ -158,7 +169,7 @@ class HomePageState extends State<HomePage> {
voiceAgentClient = VoiceAgentClient(_config.grpcHost, _config.grpcPort);
try {
// Create a RecognizeControl message to start recording
- final controlMessage = RecognizeControl()
+ final controlMessage = RecognizeVoiceControl()
..action = RecordAction.START
..recordMode = RecordMode
.MANUAL; // You can change this to your desired record mode
@@ -186,7 +197,7 @@ class HomePageState extends State<HomePage> {
model = NLUModel.SNIPS;
}
// Create a RecognizeControl message to stop recording
- final controlMessage = RecognizeControl()
+ final controlMessage = RecognizeVoiceControl()
..action = RecordAction.STOP
..nluModel = model
..streamId =
@@ -226,7 +237,46 @@ class HomePageState extends State<HomePage> {
// await voiceAgentClient.shutdown();
}
- Future<void> executeVoiceCommand(RecognizeResult response) async {
+ Future<RecognizeResult> recognizeTextCommand(
+ String command, String nluModel) async {
+ voiceAgentClient = VoiceAgentClient(_config.grpcHost, _config.grpcPort);
+ try {
+ NLUModel model = NLUModel.RASA;
+ if (nluModel == "snips") {
+ model = NLUModel.SNIPS;
+ }
+ // Create a RecognizeControl message to stop recording
+ final controlMessage = RecognizeTextControl()
+ ..textCommand = command
+ ..nluModel = model;
+
+ // Call the gRPC method to stop recording
+ final response =
+ await voiceAgentClient.recognizeTextCommand(controlMessage);
+
+ // Process and store the result
+ if (response.status == RecognizeStatusType.REC_SUCCESS) {
+ // Do nothing
+ } else if (response.status == RecognizeStatusType.INTENT_NOT_RECOGNIZED) {
+ final command = response.command;
+ addChatMessage(command, isUserMessage: true);
+ addChatMessage(
+ "Unable to undertsand the intent behind your request. Please try again.");
+ } else {
+ addChatMessage(
+ 'Failed to process your text command. Please try again.');
+ }
+ await voiceAgentClient.shutdown();
+ return response;
+ } catch (e) {
+ print('Error encountered during text command recognition: $e');
+ addChatMessage('Failed to process your text command. Please try again.');
+ await voiceAgentClient.shutdown();
+ return RecognizeResult()..status = RecognizeStatusType.REC_ERROR;
+ }
+ }
+
+ Future<void> executeCommand(RecognizeResult response) async {
voiceAgentClient = VoiceAgentClient(_config.grpcHost, _config.grpcPort);
try {
// Create an ExecuteInput message using the response from stopRecording
@@ -235,8 +285,7 @@ class HomePageState extends State<HomePage> {
..intentSlots.addAll(response.intentSlots);
// Call the gRPC method to execute the voice command
- final execResponse =
- await voiceAgentClient.executeVoiceCommand(executeInput);
+ final execResponse = await voiceAgentClient.executeCommand(executeInput);
// Handle the response as needed
if (execResponse.status == ExecuteStatusType.EXEC_SUCCESS) {
@@ -258,6 +307,28 @@ class HomePageState extends State<HomePage> {
await voiceAgentClient.shutdown();
}
+ Future<void> handleCommandTap(String command) async {
+ final appState = context.read<AppState>();
+ addChatMessage(command, isUserMessage: true);
+ appState.isCommandProcessing = true;
+ appState.commandProcessingText = "Recognizing intent...";
+
+ setState(
+ () {}); // Trigger a rebuild to ensure the loading indicator is shown, tis a bad practice though but deosn't heavily affect the performance
+
+ final response = await recognizeTextCommand(command, appState.intentEngine);
+ // Process and store the result
+ if (response.status == RecognizeStatusType.REC_SUCCESS) {
+ appState.commandProcessingText = "Executing command...";
+ setState(
+ () {}); // Trigger a rebuild to ensure the loading indicator is shown, tis a bad practice though but deosn't heavily affect the performance
+ await executeCommand(
+ response); // Call executeVoiceCommand with the response
+ }
+
+ appState.isCommandProcessing = false;
+ }
+
@override
Widget build(BuildContext context) {
final appState = context.watch<AppState>();
@@ -280,7 +351,7 @@ class HomePageState extends State<HomePage> {
"AGL Voice Assistant",
style: TextStyle(fontSize: 26, fontWeight: FontWeight.bold),
),
- SizedBox(height: 30),
+ SizedBox(height: 15),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
@@ -299,7 +370,7 @@ class HomePageState extends State<HomePage> {
Text(
'Assistant Mode',
style: TextStyle(
- fontSize: 20,
+ fontSize: 18,
fontWeight: FontWeight.bold,
),
),
@@ -339,7 +410,7 @@ class HomePageState extends State<HomePage> {
Text(
'Intent Engine',
style: TextStyle(
- fontSize: 20,
+ fontSize: 18,
fontWeight: FontWeight.bold,
),
),
@@ -363,23 +434,44 @@ class HomePageState extends State<HomePage> {
),
],
),
- SizedBox(height: 30),
+ SizedBox(height: 15),
ChatSection(
scrollController: _scrollController,
chatMessages: chatMessages,
addChatMessage: addChatMessage,
),
+ SizedBox(height: 10),
+ if (!appState.isWakeWordMode || appState.isWakeWordDetected)
+ TryCommandsSection(onCommandTap: handleCommandTap),
SizedBox(height: 30),
if (!appState.isWakeWordMode || appState.isWakeWordDetected)
- Center(
- child: Consumer<AppState>(builder: (context, appState, _) {
- return RecordCommandButton(
- onRecordingStateChanged: (isRecording) {
- changeCommandRecordingState(context, isRecording);
- },
- );
- }),
- )
+ if (!appState.isCommandProcessing)
+ Center(
+ child:
+ Consumer<AppState>(builder: (context, appState, _) {
+ return RecordCommandButton(
+ onRecordingStateChanged: (isRecording) {
+ changeCommandRecordingState(context, isRecording);
+ },
+ );
+ }),
+ )
+ else
+ Column(children: [
+ Center(
+ child: CircularProgressIndicator(),
+ ),
+ SizedBox(height: 12),
+ Center(
+ child: Text(
+ appState.commandProcessingText,
+ style: TextStyle(
+ fontSize: 14,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ ])
else
Center(
child: Consumer<AppState>(
@@ -388,6 +480,7 @@ class HomePageState extends State<HomePage> {
},
),
),
+ SizedBox(height: 30),
],
),
),
diff --git a/lib/widgets/assistant_mode_choice.dart b/lib/widgets/assistant_mode_choice.dart
index ec17534..d0c1953 100644
--- a/lib/widgets/assistant_mode_choice.dart
+++ b/lib/widgets/assistant_mode_choice.dart
@@ -132,7 +132,7 @@ class AssistantModeChoiceState extends State<AssistantModeChoice> {
'Wake Word',
style: TextStyle(
fontWeight: FontWeight.bold,
- fontSize: 18,
+ fontSize: 17,
color: _selectedMode == AssistantMode.wakeWord
? Colors.white
: Colors.green,
@@ -177,7 +177,7 @@ class AssistantModeChoiceState extends State<AssistantModeChoice> {
'Manual',
style: TextStyle(
fontWeight: FontWeight.bold,
- fontSize: 18,
+ fontSize: 17,
color: _selectedMode == AssistantMode.manual
? Colors.white
: Colors.green,
diff --git a/lib/widgets/chat_section.dart b/lib/widgets/chat_section.dart
index 596b9f3..ca48cab 100644
--- a/lib/widgets/chat_section.dart
+++ b/lib/widgets/chat_section.dart
@@ -20,22 +20,24 @@ class ChatSection extends StatelessWidget {
borderRadius: BorderRadius.circular(12),
),
child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Chat heading
Container(
- padding: EdgeInsets.all(6),
- alignment: Alignment.center,
+ padding: EdgeInsets.fromLTRB(12, 12, 0, 0),
+ // alignment: Alignment.l,
child: Text(
- 'Command Logs',
+ 'Conversation Logs',
style: TextStyle(
fontWeight: FontWeight.bold,
- fontSize: 20,
+ fontSize: 18,
),
+ textAlign: TextAlign.left,
),
),
// Chat messages with fixed height
Container(
- padding: EdgeInsets.all(12),
+ padding: EdgeInsets.all(10),
height: 180, // Adjust the height as needed
child: ListView.builder(
controller: scrollController,
@@ -106,7 +108,7 @@ class ChatMessageTile extends StatelessWidget {
),
child: Text(
message.text,
- style: TextStyle(color: Colors.white, fontSize: 18),
+ style: TextStyle(color: Colors.white, fontSize: 17),
maxLines: null,
),
),
diff --git a/lib/widgets/nlu_engine_choice.dart b/lib/widgets/nlu_engine_choice.dart
index 1e8ca52..22b7074 100644
--- a/lib/widgets/nlu_engine_choice.dart
+++ b/lib/widgets/nlu_engine_choice.dart
@@ -130,7 +130,7 @@ class _NLUEngineChoiceState extends State<NLUEngineChoice> {
'Snips',
style: TextStyle(
fontWeight: FontWeight.bold,
- fontSize: 18,
+ fontSize: 17,
color: _selectedEngine == NLUEngine.snips
? Colors.white
: Colors.green,
@@ -175,7 +175,7 @@ class _NLUEngineChoiceState extends State<NLUEngineChoice> {
'RASA',
style: TextStyle(
fontWeight: FontWeight.bold,
- fontSize: 18,
+ fontSize: 17,
color: _selectedEngine == NLUEngine.rasa
? Colors.white
: Colors.green,
diff --git a/lib/widgets/try_commands.dart b/lib/widgets/try_commands.dart
new file mode 100644
index 0000000..0670bd2
--- /dev/null
+++ b/lib/widgets/try_commands.dart
@@ -0,0 +1,87 @@
+import 'package:flutter/material.dart';
+
+class TryCommandsSection extends StatelessWidget {
+ final Future<void> Function(String) onCommandTap; // Define a callback
+
+ TryCommandsSection({required this.onCommandTap});
+
+ @override
+ Widget build(BuildContext context) {
+ return SizedBox(
+ width: double.infinity,
+ child: Card(
+ // padding: EdgeInsets.all(16),
+ // decoration: BoxDecoration(
+ // borderRadius: BorderRadius.circular(12),
+ // ),
+ elevation: 4, // Add a subtle shadow
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(12),
+ ),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Container(
+ padding: EdgeInsets.fromLTRB(12, 12, 0, 0),
+ child: Text(
+ "Try Commands",
+ style: TextStyle(
+ fontSize: 18,
+ fontWeight: FontWeight.bold,
+ ),
+ textAlign: TextAlign.left,
+ ),
+ ),
+ Container(
+ padding: EdgeInsets.fromLTRB(12, 0, 12, 0),
+ child: Text(
+ "(Tap on any of the following commands to try them out)",
+ style: TextStyle(fontSize: 14, fontStyle: FontStyle.italic),
+ textAlign: TextAlign.left,
+ ),
+ ),
+ SizedBox(height: 6),
+ Container(
+ padding: EdgeInsets.fromLTRB(12, 0, 12, 12),
+ child: Wrap(
+ spacing: 10,
+ children: [
+ buildCommandButton("Set the volume to fifty percent"),
+ buildCommandButton("Set the fan speed to max"),
+ buildCommandButton(
+ "Increase the temperature by three degrees"),
+ buildCommandButton(
+ "Decrease the fan speed by five percent"),
+ buildCommandButton("Can you reduce the volume"),
+ ],
+ ),
+ ),
+ ],
+ ),
+ ));
+ }
+
+ Widget buildCommandButton(String commandText) {
+ return GestureDetector(
+ onTap: () {
+ onCommandTap(commandText);
+ },
+ child: Container(
+ margin: EdgeInsets.all(6),
+ padding: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
+ decoration: BoxDecoration(
+ color: Colors.green.withOpacity(0.1),
+ borderRadius: BorderRadius.circular(10),
+ border: Border.all(color: Colors.green, width: 2),
+ ),
+ child: Text(
+ commandText,
+ style: TextStyle(
+ color: Colors.green,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ );
+ }
+}
diff --git a/pubspec.lock b/pubspec.lock
index 2d38fbb..d6aeae5 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -53,10 +53,10 @@ packages:
dependency: transitive
description:
name: collection
- sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
+ sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c"
url: "https://pub.dev"
source: hosted
- version: "1.17.2"
+ version: "1.17.1"
convert:
dependency: transitive
description:
@@ -167,18 +167,18 @@ packages:
dependency: transitive
description:
name: matcher
- sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
+ sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb"
url: "https://pub.dev"
source: hosted
- version: "0.12.16"
+ version: "0.12.15"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
- sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
+ sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
url: "https://pub.dev"
source: hosted
- version: "0.5.0"
+ version: "0.2.0"
meta:
dependency: transitive
description:
@@ -236,10 +236,10 @@ packages:
dependency: transitive
description:
name: source_span
- sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
+ sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
url: "https://pub.dev"
source: hosted
- version: "1.10.0"
+ version: "1.9.1"
stack_trace:
dependency: transitive
description:
@@ -276,10 +276,10 @@ packages:
dependency: transitive
description:
name: test_api
- sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
+ sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb
url: "https://pub.dev"
source: hosted
- version: "0.6.0"
+ version: "0.5.1"
typed_data:
dependency: transitive
description:
@@ -296,14 +296,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.4"
- web:
- dependency: transitive
- description:
- name: web
- sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
- url: "https://pub.dev"
- source: hosted
- version: "0.1.4-beta"
sdks:
- dart: ">=3.1.0-185.0.dev <4.0.0"
+ dart: ">=3.0.0 <4.0.0"
flutter: ">=1.16.0"