Search code examples
pythongoogle-assistant-sdkgoogle-assist-api

How to receive answer from Google Assistant as a String, not as an audio stream


I am using the python libraries from the Assistant SDK for speech recognition via gRPC. I have the speech recognized and returned as a string calling the method resp.result.spoken_request_text from \googlesamples\assistant\__main__.py and I have the answer as an audio stream from the assistant API with the method resp.audio_out.audio_data also from \googlesamples\assistant\__main__.py

I would like to know if it is possible to have the answer from the service as a string as well (hoping it is available in the service definition or that it could be included), and how I could access/request the answer as string.

Thanks in advance.


Solution

  • Update: for

    google.assistant.embedded.v1alpha2

    the assistant SDK includes the field supplemental_display_text

    which is meant to extract the assistant response as text which aids the user's understanding

    or to be displayed on screens. Still making the text available to the developer. Goolge assistant documentation