Add a per-room/global `sender_context_mode` setting that optionally
prefixes conversation messages with sender metadata before sending them
to the model provider.
This helps models distinguish between participants in multi-user rooms.
Three modes are supported:
- `disabled` (default, no change)
- `matrix_user_id` (prefixes with `[sender=@user:server]`)
- `matrix_user_id_and_timestamp` (adds `send_at`; Example: `[sender=@user:server sent_at=<ISO 8601>]`)
Sender context is applied to user and assistant text messages only,
skipping system prompts and non-text content.
Mixed-sender merged turns (something we intentionally do for Anthropic)
have their `sender_id` cleared to avoid misattribution.
15 lines
604 B
Rust
15 lines
604 B
Rust
pub mod defaults;
|
|
mod entity;
|
|
|
|
use mxlink::helpers::account_data_config::RoomConfigManager as AccountDataRoomConfigManager;
|
|
|
|
pub use entity::{RoomConfig, RoomConfigCarrierContent, RoomSettings, RoomSettingsHandler};
|
|
pub use entity::{
|
|
SpeechToTextFlowType, SpeechToTextMessageTypeForNonThreadedOnlyTranscribedMessages,
|
|
TextGenerationAutoUsage, TextGenerationPrefixRequirementType, TextGenerationSenderContextMode,
|
|
TextToSpeechBotMessagesFlowType, TextToSpeechUserMessagesFlowType,
|
|
};
|
|
|
|
pub type RoomConfigurationManager =
|
|
AccountDataRoomConfigManager<RoomConfig, RoomConfigCarrierContent>;
|