Older versions of the assistant SDK don't have the ON_RENDER_RESPONSE event - check if they have it defined before testing the event type
This commit is contained in:
parent
8708d53236
commit
a4273f5619
1 changed files with 1 additions and 1 deletions
|
@ -52,7 +52,7 @@ class AssistantGoogleBackend(Backend):
|
|||
self.bus.post(ConversationTimeoutEvent())
|
||||
elif event.type == EventType.ON_NO_RESPONSE:
|
||||
self.bus.post(NoResponseEvent())
|
||||
elif event.type == EventType.ON_RENDER_RESPONSE:
|
||||
elif hasattr(EventType, 'ON_RENDER_RESPONSE') and event.type == EventType.ON_RENDER_RESPONSE:
|
||||
self.bus.post(ResponseEvent(response_text=event.args.get('text')))
|
||||
elif event.type == EventType.ON_RECOGNIZING_SPEECH_FINISHED:
|
||||
phrase = event.args['text'].lower().strip()
|
||||
|
|
Loading…
Reference in a new issue