#[non_exhaustive]pub struct SessionInput {
pub will_continue: bool,
pub input_type: Option<InputType>,
/* private fields */
}Expand description
Input for the session.
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.will_continue: boolOptional. A flag to indicate if the current message is a fragment of a larger input in the bidi streaming session.
When set to true, the agent defers processing until it receives a
subsequent message where will_continue is false, or until the system
detects an endpoint in the audio input.
NOTE: This field does not apply to audio and DTMF inputs, as they are always processed automatically based on the endpointing signal.
input_type: Option<InputType>The type of the input.
Implementations§
Source§impl SessionInput
impl SessionInput
Sourcepub fn set_will_continue<T: Into<bool>>(self, v: T) -> Self
pub fn set_will_continue<T: Into<bool>>(self, v: T) -> Self
Sourcepub fn set_input_type<T: Into<Option<InputType>>>(self, v: T) -> Self
pub fn set_input_type<T: Into<Option<InputType>>>(self, v: T) -> Self
Sets the value of input_type.
Note that all the setters affecting input_type are mutually
exclusive.
§Example
use google_cloud_ces_v1::model::session_input::InputType;
let x = SessionInput::new().set_input_type(Some(InputType::Text("example".to_string())));Sourcepub fn text(&self) -> Option<&String>
pub fn text(&self) -> Option<&String>
The value of input_type
if it holds a Text, None if the field is not set or
holds a different branch.
Sourcepub fn set_text<T: Into<String>>(self, v: T) -> Self
pub fn set_text<T: Into<String>>(self, v: T) -> Self
Sets the value of input_type
to hold a Text.
Note that all the setters affecting input_type are
mutually exclusive.
§Example
let x = SessionInput::new().set_text("example");
assert!(x.text().is_some());
assert!(x.dtmf().is_none());
assert!(x.audio().is_none());
assert!(x.tool_responses().is_none());
assert!(x.image().is_none());
assert!(x.blob().is_none());
assert!(x.variables().is_none());
assert!(x.event().is_none());Sourcepub fn dtmf(&self) -> Option<&String>
pub fn dtmf(&self) -> Option<&String>
The value of input_type
if it holds a Dtmf, None if the field is not set or
holds a different branch.
Sourcepub fn set_dtmf<T: Into<String>>(self, v: T) -> Self
pub fn set_dtmf<T: Into<String>>(self, v: T) -> Self
Sets the value of input_type
to hold a Dtmf.
Note that all the setters affecting input_type are
mutually exclusive.
§Example
let x = SessionInput::new().set_dtmf("example");
assert!(x.dtmf().is_some());
assert!(x.text().is_none());
assert!(x.audio().is_none());
assert!(x.tool_responses().is_none());
assert!(x.image().is_none());
assert!(x.blob().is_none());
assert!(x.variables().is_none());
assert!(x.event().is_none());Sourcepub fn audio(&self) -> Option<&Bytes>
pub fn audio(&self) -> Option<&Bytes>
The value of input_type
if it holds a Audio, None if the field is not set or
holds a different branch.
Sourcepub fn set_audio<T: Into<Bytes>>(self, v: T) -> Self
pub fn set_audio<T: Into<Bytes>>(self, v: T) -> Self
Sets the value of input_type
to hold a Audio.
Note that all the setters affecting input_type are
mutually exclusive.
§Example
let x = SessionInput::new().set_audio(bytes::Bytes::from_static(b"example"));
assert!(x.audio().is_some());
assert!(x.text().is_none());
assert!(x.dtmf().is_none());
assert!(x.tool_responses().is_none());
assert!(x.image().is_none());
assert!(x.blob().is_none());
assert!(x.variables().is_none());
assert!(x.event().is_none());Sourcepub fn tool_responses(&self) -> Option<&Box<ToolResponses>>
pub fn tool_responses(&self) -> Option<&Box<ToolResponses>>
The value of input_type
if it holds a ToolResponses, None if the field is not set or
holds a different branch.
Sourcepub fn set_tool_responses<T: Into<Box<ToolResponses>>>(self, v: T) -> Self
pub fn set_tool_responses<T: Into<Box<ToolResponses>>>(self, v: T) -> Self
Sets the value of input_type
to hold a ToolResponses.
Note that all the setters affecting input_type are
mutually exclusive.
§Example
use google_cloud_ces_v1::model::ToolResponses;
let x = SessionInput::new().set_tool_responses(ToolResponses::default()/* use setters */);
assert!(x.tool_responses().is_some());
assert!(x.text().is_none());
assert!(x.dtmf().is_none());
assert!(x.audio().is_none());
assert!(x.image().is_none());
assert!(x.blob().is_none());
assert!(x.variables().is_none());
assert!(x.event().is_none());Sourcepub fn image(&self) -> Option<&Box<Image>>
pub fn image(&self) -> Option<&Box<Image>>
The value of input_type
if it holds a Image, None if the field is not set or
holds a different branch.
Sourcepub fn set_image<T: Into<Box<Image>>>(self, v: T) -> Self
pub fn set_image<T: Into<Box<Image>>>(self, v: T) -> Self
Sets the value of input_type
to hold a Image.
Note that all the setters affecting input_type are
mutually exclusive.
§Example
use google_cloud_ces_v1::model::Image;
let x = SessionInput::new().set_image(Image::default()/* use setters */);
assert!(x.image().is_some());
assert!(x.text().is_none());
assert!(x.dtmf().is_none());
assert!(x.audio().is_none());
assert!(x.tool_responses().is_none());
assert!(x.blob().is_none());
assert!(x.variables().is_none());
assert!(x.event().is_none());Sourcepub fn blob(&self) -> Option<&Box<Blob>>
pub fn blob(&self) -> Option<&Box<Blob>>
The value of input_type
if it holds a Blob, None if the field is not set or
holds a different branch.
Sourcepub fn set_blob<T: Into<Box<Blob>>>(self, v: T) -> Self
pub fn set_blob<T: Into<Box<Blob>>>(self, v: T) -> Self
Sets the value of input_type
to hold a Blob.
Note that all the setters affecting input_type are
mutually exclusive.
§Example
use google_cloud_ces_v1::model::Blob;
let x = SessionInput::new().set_blob(Blob::default()/* use setters */);
assert!(x.blob().is_some());
assert!(x.text().is_none());
assert!(x.dtmf().is_none());
assert!(x.audio().is_none());
assert!(x.tool_responses().is_none());
assert!(x.image().is_none());
assert!(x.variables().is_none());
assert!(x.event().is_none());Sourcepub fn variables(&self) -> Option<&Box<Struct>>
pub fn variables(&self) -> Option<&Box<Struct>>
The value of input_type
if it holds a Variables, None if the field is not set or
holds a different branch.
Sourcepub fn set_variables<T: Into<Box<Struct>>>(self, v: T) -> Self
pub fn set_variables<T: Into<Box<Struct>>>(self, v: T) -> Self
Sets the value of input_type
to hold a Variables.
Note that all the setters affecting input_type are
mutually exclusive.
§Example
use wkt::Struct;
let x = SessionInput::new().set_variables(Struct::default()/* use setters */);
assert!(x.variables().is_some());
assert!(x.text().is_none());
assert!(x.dtmf().is_none());
assert!(x.audio().is_none());
assert!(x.tool_responses().is_none());
assert!(x.image().is_none());
assert!(x.blob().is_none());
assert!(x.event().is_none());Sourcepub fn event(&self) -> Option<&Box<Event>>
pub fn event(&self) -> Option<&Box<Event>>
The value of input_type
if it holds a Event, None if the field is not set or
holds a different branch.
Sourcepub fn set_event<T: Into<Box<Event>>>(self, v: T) -> Self
pub fn set_event<T: Into<Box<Event>>>(self, v: T) -> Self
Sets the value of input_type
to hold a Event.
Note that all the setters affecting input_type are
mutually exclusive.
§Example
use google_cloud_ces_v1::model::Event;
let x = SessionInput::new().set_event(Event::default()/* use setters */);
assert!(x.event().is_some());
assert!(x.text().is_none());
assert!(x.dtmf().is_none());
assert!(x.audio().is_none());
assert!(x.tool_responses().is_none());
assert!(x.image().is_none());
assert!(x.blob().is_none());
assert!(x.variables().is_none());Trait Implementations§
Source§impl Clone for SessionInput
impl Clone for SessionInput
Source§fn clone(&self) -> SessionInput
fn clone(&self) -> SessionInput
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SessionInput
impl Debug for SessionInput
Source§impl Default for SessionInput
impl Default for SessionInput
Source§fn default() -> SessionInput
fn default() -> SessionInput
Source§impl Message for SessionInput
impl Message for SessionInput
Source§impl PartialEq for SessionInput
impl PartialEq for SessionInput
impl StructuralPartialEq for SessionInput
Auto Trait Implementations§
impl !Freeze for SessionInput
impl RefUnwindSafe for SessionInput
impl Send for SessionInput
impl Sync for SessionInput
impl Unpin for SessionInput
impl UnsafeUnpin for SessionInput
impl UnwindSafe for SessionInput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request