enhance evaluator with full system prompt context
the evaluator now receives sol's entire system prompt as a system
message, giving ministral-3b deep context on sol's personality when
scoring relevance. evaluation context window bumped from 25 to 200
messages, room/dm context windows unified at 200.
pre-computed timestamp variables ({ts_yesterday}, {ts_1h_ago},
{ts_last_week}) added to personality template for accurate time
references without LLM math.
This commit is contained in:
@@ -8,6 +8,10 @@ pub struct Config {
|
||||
pub behavior: BehaviorConfig,
|
||||
#[serde(default)]
|
||||
pub agents: AgentsConfig,
|
||||
#[serde(default)]
|
||||
pub services: ServicesConfig,
|
||||
#[serde(default)]
|
||||
pub vault: VaultConfig,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
@@ -120,6 +124,44 @@ pub struct BehaviorConfig {
|
||||
pub memory_extraction_enabled: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Default)]
|
||||
pub struct ServicesConfig {
|
||||
#[serde(default)]
|
||||
pub gitea: Option<GiteaConfig>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
pub struct GiteaConfig {
|
||||
pub url: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
pub struct VaultConfig {
|
||||
/// OpenBao/Vault URL. Default: http://openbao.data.svc.cluster.local:8200
|
||||
#[serde(default = "default_vault_url")]
|
||||
pub url: String,
|
||||
/// Kubernetes auth role name. Default: sol-agent
|
||||
#[serde(default = "default_vault_role")]
|
||||
pub role: String,
|
||||
/// KV v2 mount path. Default: secret
|
||||
#[serde(default = "default_vault_mount")]
|
||||
pub mount: String,
|
||||
}
|
||||
|
||||
impl Default for VaultConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
url: default_vault_url(),
|
||||
role: default_vault_role(),
|
||||
mount: default_vault_mount(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn default_vault_url() -> String { "http://openbao.data.svc.cluster.local:8200".into() }
|
||||
fn default_vault_role() -> String { "sol-agent".into() }
|
||||
fn default_vault_mount() -> String { "secret".into() }
|
||||
|
||||
fn default_batch_size() -> usize { 50 }
|
||||
fn default_flush_interval_ms() -> u64 { 2000 }
|
||||
fn default_embedding_pipeline() -> String { "tuwunel_embedding_pipeline".into() }
|
||||
@@ -133,12 +175,12 @@ fn default_spontaneous_delay_min_ms() -> u64 { 15000 }
|
||||
fn default_spontaneous_delay_max_ms() -> u64 { 60000 }
|
||||
fn default_spontaneous_threshold() -> f32 { 0.85 }
|
||||
fn default_cooldown_after_response_ms() -> u64 { 15000 }
|
||||
fn default_evaluation_context_window() -> usize { 25 }
|
||||
fn default_evaluation_context_window() -> usize { 200 }
|
||||
fn default_detect_sol_in_conversation() -> bool { true }
|
||||
fn default_reaction_threshold() -> f32 { 0.6 }
|
||||
fn default_reaction_enabled() -> bool { true }
|
||||
fn default_room_context_window() -> usize { 30 }
|
||||
fn default_dm_context_window() -> usize { 100 }
|
||||
fn default_room_context_window() -> usize { 200 }
|
||||
fn default_dm_context_window() -> usize { 200 }
|
||||
fn default_backfill_on_join() -> bool { true }
|
||||
fn default_backfill_limit() -> usize { 10000 }
|
||||
fn default_script_timeout_secs() -> u64 { 5 }
|
||||
@@ -237,8 +279,8 @@ backfill_limit = 5000
|
||||
assert!((config.behavior.spontaneous_threshold - 0.85).abs() < f32::EPSILON);
|
||||
assert!(!config.behavior.instant_responses);
|
||||
assert_eq!(config.behavior.cooldown_after_response_ms, 15000);
|
||||
assert_eq!(config.behavior.room_context_window, 30);
|
||||
assert_eq!(config.behavior.dm_context_window, 100);
|
||||
assert_eq!(config.behavior.room_context_window, 200);
|
||||
assert_eq!(config.behavior.dm_context_window, 200);
|
||||
assert!(config.behavior.backfill_on_join);
|
||||
assert_eq!(config.behavior.backfill_limit, 10000);
|
||||
assert!(config.behavior.memory_extraction_enabled);
|
||||
@@ -274,6 +316,23 @@ state_store_path = "/data/sol/state"
|
||||
assert!(Config::from_str(bad).is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_services_config_default_is_none() {
|
||||
let config = Config::from_str(MINIMAL_CONFIG).unwrap();
|
||||
assert!(config.services.gitea.is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_services_config_with_gitea() {
|
||||
let with_services = format!(
|
||||
"{}\n[services.gitea]\nurl = \"http://gitea:3000\"\n",
|
||||
MINIMAL_CONFIG
|
||||
);
|
||||
let config = Config::from_str(&with_services).unwrap();
|
||||
let gitea = config.services.gitea.unwrap();
|
||||
assert_eq!(gitea.url, "http://gitea:3000");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_missing_required_field_fails() {
|
||||
let bad = r#"
|
||||
|
||||
Reference in New Issue
Block a user