#[non_exhaustive]pub struct SessionConfig {
pub session: String,
pub input_audio_config: Option<InputAudioConfig>,
pub output_audio_config: Option<OutputAudioConfig>,
pub historical_contexts: Vec<Message>,
pub entry_agent: String,
pub deployment: String,
pub time_zone: String,
pub use_tool_fakes: bool,
pub remote_dialogflow_query_parameters: Option<RemoteDialogflowQueryParameters>,
pub enable_text_streaming: bool,
/* private fields */
}Expand description
The configuration 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.session: StringRequired. The unique identifier of the session.
Format:
projects/{project}/locations/{location}/apps/{app}/sessions/{session}
input_audio_config: Option<InputAudioConfig>Optional. Configuration for processing the input audio.
output_audio_config: Option<OutputAudioConfig>Optional. Configuration for generating the output audio.
historical_contexts: Vec<Message>Optional. The historical context of the session, including user inputs, agent responses, and other messages. Typically, CES agent would manage session automatically so client doesn’t need to explicitly populate this field. However, client can optionally override the historical contexts to force the session start from certain state.
entry_agent: StringOptional. The entry agent to handle the session. If not specified, the
session will be handled by the root
agent of the app. Format:
projects/{project}/locations/{location}/apps/{app}/agents/{agent}
deployment: StringOptional. The deployment of the app to use for the session.
Format:
projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}
time_zone: StringOptional. The time zone of the user. If provided, the agent will use the time zone for date and time related variables. Otherwise, the agent will use the time zone specified in the App.time_zone_settings.
The format is the IANA Time Zone Database time zone, e.g. “America/Los_Angeles”.
use_tool_fakes: boolOptional. Whether to use tool fakes for the session. If this field is set, the agent will attempt use tool fakes instead of calling the real tools.
remote_dialogflow_query_parameters: Option<RemoteDialogflowQueryParameters>Optional. QueryParameters to send to the remote Dialogflow agent when the session control is transferred to the remote agent.
enable_text_streaming: boolOptional. Whether to enable streaming text outputs from the model. By default, text outputs from the model are collected before sending to the client. NOTE: This is only supported for text (non-voice) sessions via [StreamRunSession][google.cloud.ces.v1.SessionService.StreamRunSession] or [BidiRunSession][google.cloud.ces.v1.SessionService.BidiRunSession].
Implementations§
Source§impl SessionConfig
impl SessionConfig
Sourcepub fn set_session<T: Into<String>>(self, v: T) -> Self
pub fn set_session<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_input_audio_config<T>(self, v: T) -> Selfwhere
T: Into<InputAudioConfig>,
pub fn set_input_audio_config<T>(self, v: T) -> Selfwhere
T: Into<InputAudioConfig>,
Sets the value of input_audio_config.
§Example
use google_cloud_ces_v1::model::InputAudioConfig;
let x = SessionConfig::new().set_input_audio_config(InputAudioConfig::default()/* use setters */);Sourcepub fn set_or_clear_input_audio_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<InputAudioConfig>,
pub fn set_or_clear_input_audio_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<InputAudioConfig>,
Sets or clears the value of input_audio_config.
§Example
use google_cloud_ces_v1::model::InputAudioConfig;
let x = SessionConfig::new().set_or_clear_input_audio_config(Some(InputAudioConfig::default()/* use setters */));
let x = SessionConfig::new().set_or_clear_input_audio_config(None::<InputAudioConfig>);Sourcepub fn set_output_audio_config<T>(self, v: T) -> Selfwhere
T: Into<OutputAudioConfig>,
pub fn set_output_audio_config<T>(self, v: T) -> Selfwhere
T: Into<OutputAudioConfig>,
Sets the value of output_audio_config.
§Example
use google_cloud_ces_v1::model::OutputAudioConfig;
let x = SessionConfig::new().set_output_audio_config(OutputAudioConfig::default()/* use setters */);Sourcepub fn set_or_clear_output_audio_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<OutputAudioConfig>,
pub fn set_or_clear_output_audio_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<OutputAudioConfig>,
Sets or clears the value of output_audio_config.
§Example
use google_cloud_ces_v1::model::OutputAudioConfig;
let x = SessionConfig::new().set_or_clear_output_audio_config(Some(OutputAudioConfig::default()/* use setters */));
let x = SessionConfig::new().set_or_clear_output_audio_config(None::<OutputAudioConfig>);Sourcepub fn set_historical_contexts<T, V>(self, v: T) -> Self
pub fn set_historical_contexts<T, V>(self, v: T) -> Self
Sets the value of historical_contexts.
§Example
use google_cloud_ces_v1::model::Message;
let x = SessionConfig::new()
.set_historical_contexts([
Message::default()/* use setters */,
Message::default()/* use (different) setters */,
]);Sourcepub fn set_entry_agent<T: Into<String>>(self, v: T) -> Self
pub fn set_entry_agent<T: Into<String>>(self, v: T) -> Self
Sets the value of entry_agent.
§Example
let x = SessionConfig::new().set_entry_agent(format!("projects/{project_id}/locations/{location_id}/apps/{app_id}/agents/{agent_id}"));Sourcepub fn set_deployment<T: Into<String>>(self, v: T) -> Self
pub fn set_deployment<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_time_zone<T: Into<String>>(self, v: T) -> Self
pub fn set_time_zone<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_use_tool_fakes<T: Into<bool>>(self, v: T) -> Self
pub fn set_use_tool_fakes<T: Into<bool>>(self, v: T) -> Self
Sourcepub fn set_remote_dialogflow_query_parameters<T>(self, v: T) -> Selfwhere
T: Into<RemoteDialogflowQueryParameters>,
pub fn set_remote_dialogflow_query_parameters<T>(self, v: T) -> Selfwhere
T: Into<RemoteDialogflowQueryParameters>,
Sets the value of remote_dialogflow_query_parameters.
§Example
use google_cloud_ces_v1::model::session_config::RemoteDialogflowQueryParameters;
let x = SessionConfig::new().set_remote_dialogflow_query_parameters(RemoteDialogflowQueryParameters::default()/* use setters */);Sourcepub fn set_or_clear_remote_dialogflow_query_parameters<T>(
self,
v: Option<T>,
) -> Selfwhere
T: Into<RemoteDialogflowQueryParameters>,
pub fn set_or_clear_remote_dialogflow_query_parameters<T>(
self,
v: Option<T>,
) -> Selfwhere
T: Into<RemoteDialogflowQueryParameters>,
Sets or clears the value of remote_dialogflow_query_parameters.
§Example
use google_cloud_ces_v1::model::session_config::RemoteDialogflowQueryParameters;
let x = SessionConfig::new().set_or_clear_remote_dialogflow_query_parameters(Some(RemoteDialogflowQueryParameters::default()/* use setters */));
let x = SessionConfig::new().set_or_clear_remote_dialogflow_query_parameters(None::<RemoteDialogflowQueryParameters>);Sourcepub fn set_enable_text_streaming<T: Into<bool>>(self, v: T) -> Self
pub fn set_enable_text_streaming<T: Into<bool>>(self, v: T) -> Self
Sets the value of enable_text_streaming.
§Example
let x = SessionConfig::new().set_enable_text_streaming(true);Trait Implementations§
Source§impl Clone for SessionConfig
impl Clone for SessionConfig
Source§fn clone(&self) -> SessionConfig
fn clone(&self) -> SessionConfig
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 SessionConfig
impl Debug for SessionConfig
Source§impl Default for SessionConfig
impl Default for SessionConfig
Source§fn default() -> SessionConfig
fn default() -> SessionConfig
Source§impl Message for SessionConfig
impl Message for SessionConfig
Source§impl PartialEq for SessionConfig
impl PartialEq for SessionConfig
impl StructuralPartialEq for SessionConfig
Auto Trait Implementations§
impl Freeze for SessionConfig
impl RefUnwindSafe for SessionConfig
impl Send for SessionConfig
impl Sync for SessionConfig
impl Unpin for SessionConfig
impl UnsafeUnpin for SessionConfig
impl UnwindSafe for SessionConfig
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