pub struct Activity { /* private fields */ }Expand description
High-level activity payload exchanged with Greentic hosts.
Implementations§
Source§impl Activity
impl Activity
Sourcepub fn custom(action: impl Into<String>, payload: Value) -> Activity
pub fn custom(action: impl Into<String>, payload: Value) -> Activity
Build a custom activity with a raw payload body.
Sourcepub fn with_welcome_flow_hint(self, hint: WelcomeFlowHint) -> Activity
pub fn with_welcome_flow_hint(self, hint: WelcomeFlowHint) -> Activity
Attach the M1.5 welcome-flow override hint. See WelcomeFlowHint
for the contract — the producer is responsible for only calling
this when the activity is actually first contact on the asserted
messaging endpoint. Attaching on every turn would route every
no-active-wait turn through the welcome flow.
Sourcepub fn welcome_flow_hint(&self) -> Option<&WelcomeFlowHint>
pub fn welcome_flow_hint(&self) -> Option<&WelcomeFlowHint>
Return the welcome-flow override hint, if any.
Sourcepub fn with_tenant(self, tenant: impl Into<String>) -> Activity
pub fn with_tenant(self, tenant: impl Into<String>) -> Activity
Attach a tenant identifier to the activity.
Sourcepub fn with_flow(self, flow_id: impl Into<String>) -> Activity
pub fn with_flow(self, flow_id: impl Into<String>) -> Activity
Target a specific flow identifier.
Sourcepub fn with_pack(self, pack_id: impl Into<String>) -> Activity
pub fn with_pack(self, pack_id: impl Into<String>) -> Activity
Target a specific pack identifier.
Sourcepub fn with_flow_type(self, flow_type: impl Into<String>) -> Activity
pub fn with_flow_type(self, flow_type: impl Into<String>) -> Activity
Hint which flow type should handle the activity.
Sourcepub fn with_session(self, session_id: impl Into<String>) -> Activity
pub fn with_session(self, session_id: impl Into<String>) -> Activity
Attach a session identifier used for retries/idempotency.
Sourcepub fn with_provider(self, provider: impl Into<String>) -> Activity
pub fn with_provider(self, provider: impl Into<String>) -> Activity
Attach a provider identifier for telemetry scoping.
Sourcepub fn with_messaging_endpoint(self, endpoint_id: impl Into<String>) -> Activity
pub fn with_messaging_endpoint(self, endpoint_id: impl Into<String>) -> Activity
Attach the receiving messaging endpoint id (M1.4). Distinguishes
provider instances of the same provider_type (e.g. teams-legal
vs teams-accounting); the runner threads it into the envelope so
session keys and telemetry partition per-endpoint.
Sourcepub fn from_user(self, user: impl Into<String>) -> Activity
pub fn from_user(self, user: impl Into<String>) -> Activity
Attach the originating user for messaging activities.
Sourcepub fn in_channel(self, channel: impl Into<String>) -> Activity
pub fn in_channel(self, channel: impl Into<String>) -> Activity
Attach a channel identifier (chat, room, or queue) for canonical session keys.
Sourcepub fn in_conversation(self, conversation: impl Into<String>) -> Activity
pub fn in_conversation(self, conversation: impl Into<String>) -> Activity
Attach a conversation/thread identifier for canonical session keys.
Sourcepub fn session_id(&self) -> Option<&str>
pub fn session_id(&self) -> Option<&str>
Return the originating session identifier, if supplied.
Sourcepub fn provider_id(&self) -> Option<&str>
pub fn provider_id(&self) -> Option<&str>
Return the originating provider identifier, if supplied.
Sourcepub fn messaging_endpoint_id(&self) -> Option<&str>
pub fn messaging_endpoint_id(&self) -> Option<&str>
Return the receiving messaging endpoint id (M1.4), if supplied.
Sourcepub fn conversation(&self) -> Option<&str>
pub fn conversation(&self) -> Option<&str>
Return the conversation identifier, if supplied.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Activity
impl<'de> Deserialize<'de> for Activity
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Activity, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Activity, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Activity
impl Serialize for Activity
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for Activity
impl RefUnwindSafe for Activity
impl Send for Activity
impl Sync for Activity
impl Unpin for Activity
impl UnsafeUnpin for Activity
impl UnwindSafe for Activity
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> FromBase64 for Twhere
T: for<'de> Deserialize<'de>,
impl<T> FromBase64 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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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