summaryrefslogtreecommitdiffstats
path: root/agl_service_voiceagent/client.py
diff options
context:
space:
mode:
Diffstat (limited to 'agl_service_voiceagent/client.py')
-rw-r--r--agl_service_voiceagent/client.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/agl_service_voiceagent/client.py b/agl_service_voiceagent/client.py
index 9b2e0a0..922e08c 100644
--- a/agl_service_voiceagent/client.py
+++ b/agl_service_voiceagent/client.py
@@ -20,14 +20,8 @@ from agl_service_voiceagent.generated import voice_agent_pb2
from agl_service_voiceagent.generated import voice_agent_pb2_grpc
from agl_service_voiceagent.utils.config import get_config_value
-# following code is only reqired for logging
-import logging
-logging.basicConfig()
-logging.getLogger("grpc").setLevel(logging.DEBUG)
-
-SERVER_URL = get_config_value('SERVER_ADDRESS') + ":" + str(get_config_value('SERVER_PORT'))
-
def run_client(mode, nlu_model):
+ SERVER_URL = get_config_value('SERVER_ADDRESS') + ":" + str(get_config_value('SERVER_PORT'))
nlu_model = voice_agent_pb2.SNIPS if nlu_model == "snips" else voice_agent_pb2.RASA
print("Starting Voice Agent Client...")
print(f"Client connecting to URL: {SERVER_URL}")
@@ -73,6 +67,12 @@ def run_client(mode, nlu_model):
print("Command:", record_result.command)
print("Status:", status)
print("Intent:", record_result.intent)
+ intent_slots = []
for slot in record_result.intent_slots:
print("Slot Name:", slot.name)
- print("Slot Value:", slot.value) \ No newline at end of file
+ print("Slot Value:", slot.value)
+ i_slot = voice_agent_pb2.IntentSlot(name=slot.name, value=slot.value)
+ intent_slots.append(i_slot)
+
+ exec_voice_command_request = voice_agent_pb2.ExecuteInput(intent=record_result.intent, intent_slots=intent_slots)
+ response = stub.ExecuteVoiceCommand(exec_voice_command_request) \ No newline at end of file