Index
EmbeddedAssistant
(interface)AssistConfig
(message)AssistRequest
(message)AssistResponse
(message)AssistResponse.EventType
(enum)AudioInConfig
(message)AudioInConfig.Encoding
(enum)AudioOut
(message)AudioOutConfig
(message)AudioOutConfig.Encoding
(enum)DebugConfig
(message)DebugInfo
(message)DeviceAction
(message)DeviceConfig
(message)DeviceLocation
(message)DialogStateIn
(message)DialogStateOut
(message)DialogStateOut.MicrophoneMode
(enum)ScreenOut
(message)ScreenOut.Format
(enum)ScreenOutConfig
(message)ScreenOutConfig.ScreenMode
(enum)SpeechRecognitionResult
(message)
EmbeddedAssistant
Service that implements the Google Assistant API.
Assist | |
---|---|
Initiates or continues a conversation with the embedded Assistant Service. Each call performs one round-trip, sending an audio request to the service and receiving the audio response. Uses bidirectional streaming to receive results, such as the A conversation is one or more gRPC connections, each consisting of several streamed requests and responses. For example, the user says Add to my shopping list and the Assistant responds What do you want to add?. The sequence of streamed requests and responses in the first gRPC message could be:
The user then says bagels and the Assistant responds OK, I've added bagels to your shopping list. This is sent as another gRPC connection call to the
Although the precise order of responses is not guaranteed, sequential
|
AssistConfig
Specifies how to process the AssistRequest
messages.
Fields | ||
---|---|---|
audio_out_config |
Required Specifies how to format the audio that will be returned. |
|
screen_out_config |
Optional Specifies the desired format to use when server returns a visual screen response. |
|
dialog_state_in |
Required Represents the current dialog state. |
|
device_config |
Device configuration that uniquely identifies a specific device. |
|
debug_config |
Optional Debugging parameters for the whole |
|
Union field
|
||
audio_in_config |
Specifies how to process the subsequent incoming audio. Required if |
|
text_query |
The text input to be sent to the Assistant. This can be populated from a text interface if audio input is not available. |
AssistRequest
The top-level message sent by the client. Clients must send at least two, and typically numerous AssistRequest
messages. The first message must contain a config
message and must not contain audio_in
data. All subsequent messages must contain audio_in
data and must not contain a config
message.
Fields | ||
---|---|---|
Union field type . Exactly one of these fields must be specified in each AssistRequest . type can be only one of the following: |
||
config |
The |
|
audio_in |
The audio data to be recognized. Sequential chunks of audio data are sent in sequential |
AssistResponse
The top-level message received by the client. A series of one or more AssistResponse
messages are streamed back to the client.
Fields | |
---|---|
event_type |
Output-only Indicates the type of event. |
audio_out |
Output-only The audio containing the Assistant's response to the query. |
screen_out |
Output-only Contains the Assistant's visual response to the query. |
device_action |
Output-only Contains the action triggered by the query with the appropriate payloads and semantic parsing. |
speech_results[] |
Output-only This repeated list contains zero or more speech recognition results that correspond to consecutive portions of the audio currently being processed, starting with the portion corresponding to the earliest audio (and most stable portion) to the portion corresponding to the most recent audio. The strings can be concatenated to view the full in-progress response. When the speech recognition completes, this list will contain one item with |
dialog_state_out |
Output-only Contains output related to the user's query. |
debug_info |
Output-only Debugging info for developer. Only returned if request set |
EventType
Indicates the type of event.
Enums | |
---|---|
EVENT_TYPE_UNSPECIFIED |
No event specified. |
END_OF_UTTERANCE |
This event indicates that the server has detected the end of the user's speech utterance and expects no additional speech. Therefore, the server will not process additional audio (although it may subsequently return additional results). The client should stop sending additional audio data, half-close the gRPC connection, and wait for any additional results until the server closes the gRPC connection. |
AudioInConfig
Specifies how to process the audio_in
data that will be provided in subsequent requests. For recommended settings, see the Google Assistant SDK best practices.
Fields | |
---|---|
encoding |
Required Encoding of audio data sent in all |
sample_rate_hertz |
Required Sample rate (in Hertz) of the audio data sent in all |
Encoding
Audio encoding of the data sent in the audio message. Audio must be one-channel (mono).
Enums | |
---|---|
ENCODING_UNSPECIFIED |
Not specified. Will return result google.rpc.Code.INVALID_ARGUMENT . |
LINEAR16 |
Uncompressed 16-bit signed little-endian samples (Linear PCM). This encoding includes no header, only the raw audio bytes. |
FLAC |
FLAC (Free Lossless Audio Codec) is the recommended encoding because it is lossless--therefore recognition is not compromised--and requires only about half the bandwidth of LINEAR16 . This encoding includes the FLAC stream header followed by audio data. It supports 16-bit and 24-bit samples, however, not all fields in STREAMINFO are supported. |
AudioOut
The audio containing the Assistant's response to the query. Sequential chunks of audio data are received in sequential AssistResponse
messages.
Fields | |
---|---|
audio_data |
Output-only The audio data containing the Assistant's response to the query. Sequential chunks of audio data are received in sequential |
AudioOutConfig
Specifies the desired format for the server to use when it returns audio_out
messages.
Fields | |
---|---|
encoding |
Required The encoding of audio data to be returned in all |
sample_rate_hertz |
Required The sample rate in Hertz of the audio data returned in |
volume_percentage |
Required Current volume setting of the device's audio output. Valid values are 1 to 100 (corresponding to 1% to 100%). |
Encoding
Audio encoding of the data returned in the audio message. All encodings are raw audio bytes with no header, except as indicated below.
Enums | |
---|---|
ENCODING_UNSPECIFIED |
Not specified. Will return result google.rpc.Code.INVALID_ARGUMENT . |
LINEAR16 |
Uncompressed 16-bit signed little-endian samples (Linear PCM). |
MP3 |
MP3 audio encoding. The sample rate is encoded in the payload. |
OPUS_IN_OGG |
Opus-encoded audio wrapped in an ogg container. The result will be a file which can be played natively on Android and in some browsers (such as Chrome). The quality of the encoding is considerably higher than MP3 while using the same bitrate. The sample rate is encoded in the payload. |
DebugConfig
Debugging parameters for the current request.
Fields | |
---|---|
return_debug_info |
When this field is set to true, the |
DebugInfo
Debug info for developer. Only returned if request set return_debug_info
to true.
Fields | |
---|---|
aog_agent_to_assistant_json |
The original JSON response from an Action-on-Google agent to Google server. See AppResponse. It will only be populated if the request maker owns the AoG project and the AoG project is in preview mode. |
DeviceAction
The response returned to the device if the user has triggered a Device Action. For example, a device which supports the query Turn on the light would receive a DeviceAction
with a JSON payload containing the semantics of the request.
Fields | |
---|---|
device_request_json |
JSON containing the device command response generated from the triggered Device Action grammar. The format is given by the |
DeviceConfig
Required Fields that identify the device to the Assistant.
See also:
Fields | |
---|---|
device_id |
Required Unique identifier for the device. The id length must be 128 characters or less. Example: DBCDW098234. This MUST match the device_id returned from device registration. This device_id is used to match against the user's registered devices to lookup the supported traits and capabilities of this device. This information should not change across device reboots. However, it should not be saved across factory-default resets. |
device_model_id |
Required Unique identifier for the device model. The combination of device_model_id and device_id must have been previously associated through device registration. |
DeviceLocation
There are three sources of locations. They are used with this precedence:
- This
DeviceLocation
, which is primarily used for mobile devices with GPS . - Location specified by the user during device setup; this is per-user, per device. This location is used if
DeviceLocation
is not specified. - Inferred location based on IP address. This is used only if neither of the above are specified.
Fields | |
---|---|
coordinates |
Latitude and longitude of device. |
DialogStateIn
Provides information about the current dialog state.
Fields | |
---|---|
conversation_state |
Required This field must always be set to the |
language_code |
Required Language of the request in IETF BCP 47 syntax (for example, "en-US"). See Language Support for more information. If you have selected a language for this |
device_location |
Optional Location of the device where the query originated. |
is_new_conversation |
Optional If true, the server will treat the request as a new conversation and not use state from the prior request. Set this field to true when the conversation should be restarted, such as after a device reboot, or after a significant lapse of time since the prior query. |
DialogStateOut
The dialog state resulting from the user's query. Multiple of these messages may be received.
Fields | |
---|---|
supplemental_display_text |
Output-only Supplemental display text from the Assistant. This could be the same as the speech spoken in |
conversation_state |
Output-only State information for the subsequent |
microphone_mode |
Output-only Specifies the mode of the microphone after this |
volume_percentage |
Output-only Updated volume level. The value will be 0 or omitted (indicating no change) unless a voice command such as Increase the volume or Set volume level 4 was recognized, in which case the value will be between 1 and 100 (corresponding to the new volume level of 1% to 100%). Typically, a client should use this volume level when playing the |
MicrophoneMode
Possible states of the microphone after a Assist
RPC completes.
Enums | |
---|---|
MICROPHONE_MODE_UNSPECIFIED |
No mode specified. |
CLOSE_MICROPHONE |
The service is not expecting a follow-on question from the user. The microphone should remain off until the user re-activates it. |
DIALOG_FOLLOW_ON |
The service is expecting a follow-on question from the user. The microphone should be re-opened when the AudioOut playback completes (by starting a new Assist RPC call to send the new audio). |
ScreenOut
The Assistant's visual output response to query. Enabled by screen_out_config
.
Fields | |
---|---|
format |
Output-only The format of the provided screen data. |
data |
Output-only The raw screen data to be displayed as the result of the Assistant query. |
Format
Possible formats of the screen data.
Enums | |
---|---|
FORMAT_UNSPECIFIED |
No format specified. |
HTML |
Data will contain a fully-formed HTML5 layout encoded in UTF-8, e.g. <html><body><div>...</div></body></html> . It is intended to be rendered along with the audio response. Note that HTML5 doctype should be included in the actual HTML data. |
ScreenOutConfig
Specifies the desired format for the server to use when it returns screen_out
response.
Fields | |
---|---|
screen_mode |
Current visual screen-mode for the device while issuing the query. |
ScreenMode
Possible modes for visual screen-output on the device.
Enums | |
---|---|
SCREEN_MODE_UNSPECIFIED |
No video mode specified. The Assistant may respond as if in OFF mode. |
OFF |
Screen is off (or has brightness or other settings set so low it is not visible). The Assistant will typically not return a screen response in this mode. |
PLAYING |
The Assistant will typically return a partial-screen response in this mode. |
SpeechRecognitionResult
The estimated transcription of a phrase the user has spoken. This could be a single segment or the full guess of the user's spoken query.
Fields | |
---|---|
transcript |
Output-only Transcript text representing the words that the user spoke. |
stability |
Output-only An estimate of the likelihood that the Assistant will not change its guess about this result. Values range from 0.0 (completely unstable) to 1.0 (completely stable and final). The default of 0.0 is a sentinel value indicating |