Skip to main content

synapto_interface/
peer_input_text.rs

1use crate::document::DocumentId;
2use crate::peer_input::MessageText;
3use crate::plugin::MessageChannel;
4use schemars::JsonSchema;
5use serde::{Deserialize, Serialize};
6
7/// Input message originating from a text-based source (e.g. chat, console).
8#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema)]
9pub struct PeerInputText {
10    /// The channel where the message was received.
11    pub channel: MessageChannel,
12    /// The ID of the user who sent the message.
13    pub sender_id: SenderId,
14    /// The text content of the message.
15    pub text: MessageText,
16    /// Any documents attached to the message.
17    pub attached_documents: Vec<DocumentId>,
18    /// Whether the assistant was explicitly mentioned or addressed.
19    pub explicitly_addressed: bool,
20}
21
22#[doc = " A unique identifier for a message sender."]
23#[derive(
24    Serialize,
25    Deserialize,
26    JsonSchema,
27    PartialEq,
28    Eq,
29    Debug,
30    Clone,
31    derive_more :: Display,
32    derive_more :: From,
33    derive_more :: Deref,
34)]
35pub struct SenderId(pub String);