Extract agent, compact, embed, task, and modes modules from single service.rs files into focused sub-modules. Add orao module for O1-like reasoning loop. Move RigAgentService to rig_tool.rs.
33 lines
705 B
Rust
33 lines
705 B
Rust
//! Context compaction for AI sessions and room message history.
|
|
|
|
pub mod auth_fetch;
|
|
pub mod helpers;
|
|
pub mod room_compactor;
|
|
pub mod summarizer;
|
|
pub mod types;
|
|
|
|
use sea_orm::DatabaseConnection;
|
|
|
|
pub use types::{CompactConfig, CompactLevel, CompactSummary, MessageSummary, ThresholdResult};
|
|
|
|
#[derive(Clone)]
|
|
pub struct CompactService {
|
|
db: DatabaseConnection,
|
|
ai_client_config: crate::client::AiClientConfig,
|
|
model: String,
|
|
}
|
|
|
|
impl CompactService {
|
|
pub fn new(
|
|
db: DatabaseConnection,
|
|
ai_client_config: crate::client::AiClientConfig,
|
|
model: String,
|
|
) -> Self {
|
|
Self {
|
|
db,
|
|
ai_client_config,
|
|
model,
|
|
}
|
|
}
|
|
}
|