pub struct ExternalActor {
pub actor_id: String,
pub actor_name: Option<String>,
pub source: String,
pub metadata: Option<HashMap<String, String>>,
}Expand description
Identity of a user message originating outside the embedding application.
Channel adapters attach this value so several people can speak in one
session without coupling the core protocol to Slack, Discord, Teams, or
another transport. The model-facing request prefixes the user’s text with
Self::display_label; the durable message itself remains unchanged.
Fields§
§actor_id: StringOpaque identifier assigned by the source, such as a Slack user id.
actor_name: Option<String>Human-readable name, when the source resolved one.
source: StringSource namespace, such as slack or discord.
metadata: Option<HashMap<String, String>>Source-specific attributes useful to the embedding host.
Implementations§
Source§impl ExternalActor
impl ExternalActor
Sourcepub fn new(source: impl Into<String>, actor_id: impl Into<String>) -> Self
pub fn new(source: impl Into<String>, actor_id: impl Into<String>) -> Self
Create an actor from its source namespace and opaque source id.
Sourcepub fn name(self, name: impl Into<String>) -> Self
pub fn name(self, name: impl Into<String>) -> Self
Attach the name shown to the model and presentation layers.
Sourcepub fn display_label(&self) -> &str
pub fn display_label(&self) -> &str
Human-readable name when present, otherwise the source id.