#[non_exhaustive]pub struct StreamingAnalyzeContentRequest {
pub participant: String,
pub reply_audio_config: Option<OutputAudioConfig>,
pub query_params: Option<QueryParameters>,
pub assist_query_params: Option<AssistQueryParameters>,
pub cx_parameters: Option<Struct>,
pub enable_extended_streaming: bool,
pub enable_partial_automated_agent_reply: bool,
pub enable_debugging_info: bool,
pub config: Option<Config>,
pub input: Option<Input>,
/* private fields */
}participants only.Expand description
The top-level message sent by the client to the [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent] method.
Multiple request messages should be sent in order:
-
The first message must contain participant, config and optionally query_params. If you want to receive an audio response, it should also contain reply_audio_config. The message must not contain input.
-
If config in the first message was set to audio_config, all subsequent messages must contain input_audio to continue with Speech recognition. However, note that:
- Dialogflow will bill you for the audio so far.
- Dialogflow discards all Speech recognition results in favor of the text input.
-
If StreamingAnalyzeContentRequest.config in the first message was set to StreamingAnalyzeContentRequest.text_config, then the second message must contain only input_text. Moreover, you must not send more than two messages.
After you sent all input, you must half-close or abort the request stream.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.participant: StringRequired. The name of the participant this text comes from.
Format: projects/<Project ID>/locations/<Location ID>/conversations/<Conversation ID>/participants/<Participant ID>.
reply_audio_config: Option<OutputAudioConfig>Speech synthesis configuration. The speech synthesis settings for a virtual agent that may be configured for the associated conversation profile are not used when calling StreamingAnalyzeContent. If this configuration is not supplied, speech synthesis is disabled.
query_params: Option<QueryParameters>Parameters for a Dialogflow virtual-agent query.
assist_query_params: Option<AssistQueryParameters>Parameters for a human assist query.
cx_parameters: Option<Struct>Additional parameters to be put into Dialogflow CX session parameters. To remove a parameter from the session, clients should explicitly set the parameter value to null.
Note: this field should only be used if you are connecting to a Dialogflow CX agent.
enable_extended_streaming: boolOptional. Enable full bidirectional streaming. You can keep streaming the audio until timeout, and there’s no need to half close the stream to get the response.
Restrictions:
- Timeout: 3 mins.
- Audio Encoding: only supports AudioEncoding.AUDIO_ENCODING_LINEAR_16 and AudioEncoding.AUDIO_ENCODING_MULAW
- Lifecycle: conversation should be in
Assist Stage, go to Conversations.CreateConversation for more information.
InvalidArgument Error will be returned if the one of restriction checks failed.
You can find more details in https://cloud.google.com/agent-assist/docs/extended-streaming
enable_partial_automated_agent_reply: boolOptional. Enable partial responses from Dialogflow CX agent. If this flag
is not enabled, response stream still contains only one final response even
if some Fulfillments in Dialogflow CX agent have been configured to
return partial responses.
enable_debugging_info: boolIf true, StreamingAnalyzeContentResponse.debugging_info will get
populated.
config: Option<Config>The input config.
input: Option<Input>The input.
Implementations§
Source§impl StreamingAnalyzeContentRequest
impl StreamingAnalyzeContentRequest
pub fn new() -> Self
Sourcepub fn set_participant<T: Into<String>>(self, v: T) -> Self
pub fn set_participant<T: Into<String>>(self, v: T) -> Self
Sets the value of participant.
§Example
let x = StreamingAnalyzeContentRequest::new().set_participant("example");Sourcepub fn set_reply_audio_config<T>(self, v: T) -> Selfwhere
T: Into<OutputAudioConfig>,
pub fn set_reply_audio_config<T>(self, v: T) -> Selfwhere
T: Into<OutputAudioConfig>,
Sets the value of reply_audio_config.
§Example
use google_cloud_dialogflow_v2::model::OutputAudioConfig;
let x = StreamingAnalyzeContentRequest::new().set_reply_audio_config(OutputAudioConfig::default()/* use setters */);Sourcepub fn set_or_clear_reply_audio_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<OutputAudioConfig>,
pub fn set_or_clear_reply_audio_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<OutputAudioConfig>,
Sets or clears the value of reply_audio_config.
§Example
use google_cloud_dialogflow_v2::model::OutputAudioConfig;
let x = StreamingAnalyzeContentRequest::new().set_or_clear_reply_audio_config(Some(OutputAudioConfig::default()/* use setters */));
let x = StreamingAnalyzeContentRequest::new().set_or_clear_reply_audio_config(None::<OutputAudioConfig>);Sourcepub fn set_query_params<T>(self, v: T) -> Selfwhere
T: Into<QueryParameters>,
pub fn set_query_params<T>(self, v: T) -> Selfwhere
T: Into<QueryParameters>,
Sets the value of query_params.
§Example
use google_cloud_dialogflow_v2::model::QueryParameters;
let x = StreamingAnalyzeContentRequest::new().set_query_params(QueryParameters::default()/* use setters */);Sourcepub fn set_or_clear_query_params<T>(self, v: Option<T>) -> Selfwhere
T: Into<QueryParameters>,
pub fn set_or_clear_query_params<T>(self, v: Option<T>) -> Selfwhere
T: Into<QueryParameters>,
Sets or clears the value of query_params.
§Example
use google_cloud_dialogflow_v2::model::QueryParameters;
let x = StreamingAnalyzeContentRequest::new().set_or_clear_query_params(Some(QueryParameters::default()/* use setters */));
let x = StreamingAnalyzeContentRequest::new().set_or_clear_query_params(None::<QueryParameters>);Sourcepub fn set_assist_query_params<T>(self, v: T) -> Selfwhere
T: Into<AssistQueryParameters>,
pub fn set_assist_query_params<T>(self, v: T) -> Selfwhere
T: Into<AssistQueryParameters>,
Sets the value of assist_query_params.
§Example
use google_cloud_dialogflow_v2::model::AssistQueryParameters;
let x = StreamingAnalyzeContentRequest::new().set_assist_query_params(AssistQueryParameters::default()/* use setters */);Sourcepub fn set_or_clear_assist_query_params<T>(self, v: Option<T>) -> Selfwhere
T: Into<AssistQueryParameters>,
pub fn set_or_clear_assist_query_params<T>(self, v: Option<T>) -> Selfwhere
T: Into<AssistQueryParameters>,
Sets or clears the value of assist_query_params.
§Example
use google_cloud_dialogflow_v2::model::AssistQueryParameters;
let x = StreamingAnalyzeContentRequest::new().set_or_clear_assist_query_params(Some(AssistQueryParameters::default()/* use setters */));
let x = StreamingAnalyzeContentRequest::new().set_or_clear_assist_query_params(None::<AssistQueryParameters>);Sourcepub fn set_cx_parameters<T>(self, v: T) -> Self
pub fn set_cx_parameters<T>(self, v: T) -> Self
Sets the value of cx_parameters.
§Example
use wkt::Struct;
let x = StreamingAnalyzeContentRequest::new().set_cx_parameters(Struct::default()/* use setters */);Sourcepub fn set_or_clear_cx_parameters<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_cx_parameters<T>(self, v: Option<T>) -> Self
Sets or clears the value of cx_parameters.
§Example
use wkt::Struct;
let x = StreamingAnalyzeContentRequest::new().set_or_clear_cx_parameters(Some(Struct::default()/* use setters */));
let x = StreamingAnalyzeContentRequest::new().set_or_clear_cx_parameters(None::<Struct>);Sourcepub fn set_enable_extended_streaming<T: Into<bool>>(self, v: T) -> Self
pub fn set_enable_extended_streaming<T: Into<bool>>(self, v: T) -> Self
Sets the value of enable_extended_streaming.
§Example
let x = StreamingAnalyzeContentRequest::new().set_enable_extended_streaming(true);Sourcepub fn set_enable_partial_automated_agent_reply<T: Into<bool>>(
self,
v: T,
) -> Self
pub fn set_enable_partial_automated_agent_reply<T: Into<bool>>( self, v: T, ) -> Self
Sets the value of enable_partial_automated_agent_reply.
§Example
let x = StreamingAnalyzeContentRequest::new().set_enable_partial_automated_agent_reply(true);Sourcepub fn set_enable_debugging_info<T: Into<bool>>(self, v: T) -> Self
pub fn set_enable_debugging_info<T: Into<bool>>(self, v: T) -> Self
Sets the value of enable_debugging_info.
§Example
let x = StreamingAnalyzeContentRequest::new().set_enable_debugging_info(true);Sourcepub fn set_config<T: Into<Option<Config>>>(self, v: T) -> Self
pub fn set_config<T: Into<Option<Config>>>(self, v: T) -> Self
Sets the value of config.
Note that all the setters affecting config are mutually
exclusive.
§Example
use google_cloud_dialogflow_v2::model::InputAudioConfig;
let x = StreamingAnalyzeContentRequest::new().set_config(Some(
google_cloud_dialogflow_v2::model::streaming_analyze_content_request::Config::AudioConfig(InputAudioConfig::default().into())));Sourcepub fn audio_config(&self) -> Option<&Box<InputAudioConfig>>
pub fn audio_config(&self) -> Option<&Box<InputAudioConfig>>
The value of config
if it holds a AudioConfig, None if the field is not set or
holds a different branch.
Sourcepub fn set_audio_config<T: Into<Box<InputAudioConfig>>>(self, v: T) -> Self
pub fn set_audio_config<T: Into<Box<InputAudioConfig>>>(self, v: T) -> Self
Sets the value of config
to hold a AudioConfig.
Note that all the setters affecting config are
mutually exclusive.
§Example
use google_cloud_dialogflow_v2::model::InputAudioConfig;
let x = StreamingAnalyzeContentRequest::new().set_audio_config(InputAudioConfig::default()/* use setters */);
assert!(x.audio_config().is_some());
assert!(x.text_config().is_none());Sourcepub fn text_config(&self) -> Option<&Box<InputTextConfig>>
pub fn text_config(&self) -> Option<&Box<InputTextConfig>>
The value of config
if it holds a TextConfig, None if the field is not set or
holds a different branch.
Sourcepub fn set_text_config<T: Into<Box<InputTextConfig>>>(self, v: T) -> Self
pub fn set_text_config<T: Into<Box<InputTextConfig>>>(self, v: T) -> Self
Sets the value of config
to hold a TextConfig.
Note that all the setters affecting config are
mutually exclusive.
§Example
use google_cloud_dialogflow_v2::model::InputTextConfig;
let x = StreamingAnalyzeContentRequest::new().set_text_config(InputTextConfig::default()/* use setters */);
assert!(x.text_config().is_some());
assert!(x.audio_config().is_none());Sourcepub fn set_input<T: Into<Option<Input>>>(self, v: T) -> Self
pub fn set_input<T: Into<Option<Input>>>(self, v: T) -> Self
Sets the value of input.
Note that all the setters affecting input are mutually
exclusive.
§Example
use google_cloud_dialogflow_v2::model::streaming_analyze_content_request::Input;
let x = StreamingAnalyzeContentRequest::new().set_input(Some(Input::InputAudio(bytes::Bytes::from_static(b"example"))));Sourcepub fn input_audio(&self) -> Option<&Bytes>
pub fn input_audio(&self) -> Option<&Bytes>
The value of input
if it holds a InputAudio, None if the field is not set or
holds a different branch.
Sourcepub fn set_input_audio<T: Into<Bytes>>(self, v: T) -> Self
pub fn set_input_audio<T: Into<Bytes>>(self, v: T) -> Self
Sets the value of input
to hold a InputAudio.
Note that all the setters affecting input are
mutually exclusive.
§Example
let x = StreamingAnalyzeContentRequest::new().set_input_audio(bytes::Bytes::from_static(b"example"));
assert!(x.input_audio().is_some());
assert!(x.input_text().is_none());
assert!(x.input_dtmf().is_none());Sourcepub fn input_text(&self) -> Option<&String>
pub fn input_text(&self) -> Option<&String>
The value of input
if it holds a InputText, None if the field is not set or
holds a different branch.
Sourcepub fn set_input_text<T: Into<String>>(self, v: T) -> Self
pub fn set_input_text<T: Into<String>>(self, v: T) -> Self
Sourcepub fn input_dtmf(&self) -> Option<&Box<TelephonyDtmfEvents>>
pub fn input_dtmf(&self) -> Option<&Box<TelephonyDtmfEvents>>
The value of input
if it holds a InputDtmf, None if the field is not set or
holds a different branch.
Sourcepub fn set_input_dtmf<T: Into<Box<TelephonyDtmfEvents>>>(self, v: T) -> Self
pub fn set_input_dtmf<T: Into<Box<TelephonyDtmfEvents>>>(self, v: T) -> Self
Sets the value of input
to hold a InputDtmf.
Note that all the setters affecting input are
mutually exclusive.
§Example
use google_cloud_dialogflow_v2::model::TelephonyDtmfEvents;
let x = StreamingAnalyzeContentRequest::new().set_input_dtmf(TelephonyDtmfEvents::default()/* use setters */);
assert!(x.input_dtmf().is_some());
assert!(x.input_audio().is_none());
assert!(x.input_text().is_none());Trait Implementations§
Source§impl Clone for StreamingAnalyzeContentRequest
impl Clone for StreamingAnalyzeContentRequest
Source§fn clone(&self) -> StreamingAnalyzeContentRequest
fn clone(&self) -> StreamingAnalyzeContentRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for StreamingAnalyzeContentRequest
impl Default for StreamingAnalyzeContentRequest
Source§fn default() -> StreamingAnalyzeContentRequest
fn default() -> StreamingAnalyzeContentRequest
Source§impl PartialEq for StreamingAnalyzeContentRequest
impl PartialEq for StreamingAnalyzeContentRequest
Source§fn eq(&self, other: &StreamingAnalyzeContentRequest) -> bool
fn eq(&self, other: &StreamingAnalyzeContentRequest) -> bool
self and other values to be equal, and is used by ==.