Skip to main content

StreamingAnalyzeContentRequest

Struct StreamingAnalyzeContentRequest 

Source
#[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 */ }
Available on crate feature 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:

  1. 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.

  2. 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.
  3. 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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§participant: String

Required. 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: bool

Optional. 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:

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: bool

Optional. 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: bool

If true, StreamingAnalyzeContentResponse.debugging_info will get populated.

§config: Option<Config>

The input config.

§input: Option<Input>

The input.

Implementations§

Source§

impl StreamingAnalyzeContentRequest

Source

pub fn new() -> Self

Source

pub fn set_participant<T: Into<String>>(self, v: T) -> Self

Sets the value of participant.

§Example
let x = StreamingAnalyzeContentRequest::new().set_participant("example");
Source

pub fn set_reply_audio_config<T>(self, v: T) -> Self

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 */);
Source

pub fn set_or_clear_reply_audio_config<T>(self, v: Option<T>) -> Self

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>);
Source

pub fn set_query_params<T>(self, v: T) -> Self

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 */);
Source

pub fn set_or_clear_query_params<T>(self, v: Option<T>) -> Self

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>);
Source

pub fn set_assist_query_params<T>(self, v: T) -> Self

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 */);
Source

pub fn set_or_clear_assist_query_params<T>(self, v: Option<T>) -> Self

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>);
Source

pub fn set_cx_parameters<T>(self, v: T) -> Self
where T: Into<Struct>,

Sets the value of cx_parameters.

§Example
use wkt::Struct;
let x = StreamingAnalyzeContentRequest::new().set_cx_parameters(Struct::default()/* use setters */);
Source

pub fn set_or_clear_cx_parameters<T>(self, v: Option<T>) -> Self
where T: Into<Struct>,

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>);
Source

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);
Source

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);
Source

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);
Source

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())));
Source

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.

Source

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());
Source

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.

Source

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());
Source

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"))));
Source

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.

Source

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());
Source

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.

Source

pub fn set_input_text<T: Into<String>>(self, v: T) -> Self

Sets the value of input to hold a InputText.

Note that all the setters affecting input are mutually exclusive.

§Example
let x = StreamingAnalyzeContentRequest::new().set_input_text("example");
assert!(x.input_text().is_some());
assert!(x.input_audio().is_none());
assert!(x.input_dtmf().is_none());
Source

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.

Source

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

Source§

fn clone(&self) -> StreamingAnalyzeContentRequest

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StreamingAnalyzeContentRequest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for StreamingAnalyzeContentRequest

Source§

fn default() -> StreamingAnalyzeContentRequest

Returns the “default value” for a type. Read more
Source§

impl Message for StreamingAnalyzeContentRequest

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for StreamingAnalyzeContentRequest

Source§

fn eq(&self, other: &StreamingAnalyzeContentRequest) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for StreamingAnalyzeContentRequest

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,