Intent Recognizer Function for clearing Intent dictionary
parent
2a0e72ec07
commit
e6d0accd34
|
@ -25,7 +25,11 @@ Tree("32_Grotto_Chatbot_Test") {
|
||||||
Composite(Sequence) {
|
Composite(Sequence) {
|
||||||
BTC.Wait(5)
|
BTC.Wait(5)
|
||||||
BTC.CompareUserSpeechInputStarted(false)
|
BTC.CompareUserSpeechInputStarted(false)
|
||||||
RunTree("32_Grotto_Chatbot_Test_No_Answer")
|
BTC.StopSpeechIntentRecognition()
|
||||||
|
BTC.ClearPossbileSpeechIntents()
|
||||||
|
|
||||||
|
// Bilder Bergell
|
||||||
|
//BTC.Run("LoadScene.NEXT.35Slideshow")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,11 +45,13 @@ Tree("32_Grotto_Chatbot_Test_Compare_Intent") {
|
||||||
Composite(Race) {
|
Composite(Race) {
|
||||||
Composite(Sequence) {
|
Composite(Sequence) {
|
||||||
BTC.CompareIntentID("Story_B_Grotto.Nachfrage_Nonna_Grotto.2")
|
BTC.CompareIntentID("Story_B_Grotto.Nachfrage_Nonna_Grotto.2")
|
||||||
|
BTC.ClearPossbileSpeechIntents()
|
||||||
BTC.GetKeyDown("Return")
|
BTC.GetKeyDown("Return")
|
||||||
// ...
|
// ...
|
||||||
}
|
}
|
||||||
Composite(Sequence) {
|
Composite(Sequence) {
|
||||||
BTC.CompareIntentID("Story_B_Grotto.Nachfrage_Nonna_Grotto.4")
|
BTC.CompareIntentID("Story_B_Grotto.Nachfrage_Nonna_Grotto.4")
|
||||||
|
BTC.ClearPossbileSpeechIntents()
|
||||||
BTC.GetKeyDown("Return")
|
BTC.GetKeyDown("Return")
|
||||||
// ...
|
// ...
|
||||||
}
|
}
|
||||||
|
@ -63,11 +69,13 @@ Tree("32_Grotto_Chatbot_Test_Compare_Intent") {
|
||||||
Composite(Race) {
|
Composite(Race) {
|
||||||
Composite(Sequence) {
|
Composite(Sequence) {
|
||||||
BTC.CompareIntentID("Story_B_Grotto.Nachfrage_Nonna_Grotto.2")
|
BTC.CompareIntentID("Story_B_Grotto.Nachfrage_Nonna_Grotto.2")
|
||||||
|
BTC.ClearPossbileSpeechIntents()
|
||||||
BTC.GetKeyDown("Return")
|
BTC.GetKeyDown("Return")
|
||||||
// ...
|
// ...
|
||||||
}
|
}
|
||||||
Composite(Sequence) {
|
Composite(Sequence) {
|
||||||
BTC.CompareIntentID("Story_B_Grotto.Nachfrage_Nonna_Grotto.4")
|
BTC.CompareIntentID("Story_B_Grotto.Nachfrage_Nonna_Grotto.4")
|
||||||
|
BTC.ClearPossbileSpeechIntents()
|
||||||
BTC.GetKeyDown("Return")
|
BTC.GetKeyDown("Return")
|
||||||
// ...
|
// ...
|
||||||
}
|
}
|
||||||
|
@ -80,14 +88,6 @@ Tree("32_Grotto_Chatbot_Test_Compare_Intent") {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Tree("32_Grotto_Chatbot_Test_No_Answer") {
|
|
||||||
Composite(Sequence) {
|
|
||||||
// Bilder Bergell
|
|
||||||
BTC.StopSpeechIntentRecognition()
|
|
||||||
//BTC.Run("LoadScene.NEXT.35Slideshow")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Tree("32_Grotto_Kueche_Intro") {
|
Tree("32_Grotto_Kueche_Intro") {
|
||||||
Composite(Sequence) {
|
Composite(Sequence) {
|
||||||
BTC.Run("AudioSource.AUDIO.Kueche1FIntro")
|
BTC.Run("AudioSource.AUDIO.Kueche1FIntro")
|
||||||
|
|
|
@ -609,28 +609,21 @@ public class BTC : MonoBehaviour {
|
||||||
#endif
|
#endif
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region SpeechRecognizer
|
#region Speech Intent Recognizer
|
||||||
private ViaggioAIManager _speechMng { get { return ViaggioAIManager.Instance; } }
|
private ViaggioAIManager _speechMng { get { return ViaggioAIManager.Instance; } }
|
||||||
private RequestDataModel _requestDataModel = new RequestDataModel();
|
private RequestDataModel _requestDataModel = new RequestDataModel();
|
||||||
private string _recognizedIntentID = "";
|
private string _recognizedIntentID = "";
|
||||||
private bool _onIntentRecognitionInitiatedEventTriggered = false;
|
|
||||||
private bool _onIntentRecognitionSucceededEventTriggered = false;
|
private bool _onIntentRecognitionSucceededEventTriggered = false;
|
||||||
private bool _onUserSpeechInputStartedEventTriggered = false;
|
private bool _onUserSpeechInputStartedEventTriggered = false;
|
||||||
private bool _onIntentRecognitionFailedEventTriggered = false;
|
private bool _onIntentRecognitionFailedEventTriggered = false;
|
||||||
|
|
||||||
private void OnEnable()
|
private void OnEnable()
|
||||||
{
|
{
|
||||||
_speechMng.OnIntentRecognitionInitiatedEvent += IntentRecognitionInitiatedEventHandler;
|
|
||||||
_speechMng.OnIntentRecognitionSucceededEvent += IntentRecognitionSucceededEventHandler;
|
_speechMng.OnIntentRecognitionSucceededEvent += IntentRecognitionSucceededEventHandler;
|
||||||
_speechMng.OnUserSpeechInputStartedEvent += UserSpeechInputStartedEventHandler;
|
_speechMng.OnUserSpeechInputStartedEvent += UserSpeechInputStartedEventHandler;
|
||||||
_speechMng.OnIntentRecognitionFailedEvent += IntentRecognitionFailedEventHandler;
|
_speechMng.OnIntentRecognitionFailedEvent += IntentRecognitionFailedEventHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void IntentRecognitionInitiatedEventHandler(object sender, bool e)
|
|
||||||
{
|
|
||||||
_onIntentRecognitionInitiatedEventTriggered = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void IntentRecognitionSucceededEventHandler(object sender, string intentID)
|
private void IntentRecognitionSucceededEventHandler(object sender, string intentID)
|
||||||
{
|
{
|
||||||
_onIntentRecognitionSucceededEventTriggered = true;
|
_onIntentRecognitionSucceededEventTriggered = true;
|
||||||
|
@ -650,9 +643,8 @@ public class BTC : MonoBehaviour {
|
||||||
[Task]
|
[Task]
|
||||||
public void AddPossbileSpeechIntent(string intentID, string intentText)
|
public void AddPossbileSpeechIntent(string intentID, string intentText)
|
||||||
{
|
{
|
||||||
switch (Task.getState)
|
if (Task.getState == NodeState.FirstRun)
|
||||||
{
|
{
|
||||||
case NodeState.FirstRun:
|
|
||||||
_requestDataModel.PossibleIntents.Add(intentID, intentText);
|
_requestDataModel.PossibleIntents.Add(intentID, intentText);
|
||||||
foreach (var r in _requestDataModel.PossibleIntents)
|
foreach (var r in _requestDataModel.PossibleIntents)
|
||||||
{
|
{
|
||||||
|
@ -660,9 +652,7 @@ public class BTC : MonoBehaviour {
|
||||||
}
|
}
|
||||||
|
|
||||||
Task.SetSucceeded();
|
Task.SetSucceeded();
|
||||||
break;
|
return;
|
||||||
case NodeState.Aborting:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -758,6 +748,7 @@ public class BTC : MonoBehaviour {
|
||||||
if (Task.getState == NodeState.FirstRun)
|
if (Task.getState == NodeState.FirstRun)
|
||||||
{
|
{
|
||||||
_requestDataModel.PossibleIntents.Clear();
|
_requestDataModel.PossibleIntents.Clear();
|
||||||
|
_recognizedIntentID = "";
|
||||||
Task.SetSucceeded();
|
Task.SetSucceeded();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -775,6 +766,11 @@ public class BTC : MonoBehaviour {
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Speech Synthesizer
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region Oculus Input
|
#region Oculus Input
|
||||||
#if OCULUSVR_AVAILABLE
|
#if OCULUSVR_AVAILABLE
|
||||||
[Task]
|
[Task]
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue