thalamus: interactive sampling parameter controls
F5 screen now shows temperature, top_p, top_k with interactive adjustment: - Up/down: select parameter - Left/right: adjust value (0.05 steps for temp/top_p, 5 for top_k) - Updates Agent and display immediately via HotkeyAction Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
dd009742ef
commit
c2c5530ecc
3 changed files with 61 additions and 7 deletions
|
|
@ -242,6 +242,9 @@ pub enum Screen {
|
|||
#[derive(Debug)]
|
||||
pub enum HotkeyAction {
|
||||
CycleReasoning, KillProcess, Interrupt, CycleAutonomy,
|
||||
/// Adjust a sampling parameter: (param_index, delta)
|
||||
/// 0=temperature, 1=top_p, 2=top_k
|
||||
AdjustSampling(usize, f32),
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
|
|
@ -296,6 +299,8 @@ pub struct App {
|
|||
pub(crate) agent_state: Vec<crate::subconscious::subconscious::AgentSnapshot>,
|
||||
pub(crate) channel_status: Vec<ChannelStatus>,
|
||||
pub(crate) idle_info: Option<IdleInfo>,
|
||||
/// Thalamus screen: selected sampling param (0=temp, 1=top_p, 2=top_k).
|
||||
pub(crate) sampling_selected: usize,
|
||||
}
|
||||
|
||||
impl App {
|
||||
|
|
@ -326,7 +331,7 @@ impl App {
|
|||
debug_expanded: std::collections::HashSet::new(),
|
||||
context_info: None, shared_context,
|
||||
agent_selected: 0, agent_log_view: false, agent_state: Vec::new(),
|
||||
channel_status: Vec::new(), idle_info: None,
|
||||
channel_status: Vec::new(), idle_info: None, sampling_selected: 0,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -477,7 +482,7 @@ impl App {
|
|||
_ => {}
|
||||
}
|
||||
}
|
||||
Screen::Unconscious | Screen::Thalamus => {
|
||||
Screen::Unconscious => {
|
||||
match key.code {
|
||||
KeyCode::PageUp => { self.debug_scroll = self.debug_scroll.saturating_sub(10); return; }
|
||||
KeyCode::PageDown => { self.debug_scroll += 10; return; }
|
||||
|
|
@ -485,6 +490,34 @@ impl App {
|
|||
_ => {}
|
||||
}
|
||||
}
|
||||
Screen::Thalamus => {
|
||||
match key.code {
|
||||
KeyCode::Up => { self.sampling_selected = self.sampling_selected.saturating_sub(1); return; }
|
||||
KeyCode::Down => { self.sampling_selected = (self.sampling_selected + 1).min(2); return; }
|
||||
KeyCode::Right => {
|
||||
let delta = match self.sampling_selected {
|
||||
0 => 0.05, // temperature
|
||||
1 => 0.05, // top_p
|
||||
2 => 5.0, // top_k
|
||||
_ => 0.0,
|
||||
};
|
||||
self.hotkey_actions.push(HotkeyAction::AdjustSampling(self.sampling_selected, delta));
|
||||
return;
|
||||
}
|
||||
KeyCode::Left => {
|
||||
let delta = match self.sampling_selected {
|
||||
0 => -0.05,
|
||||
1 => -0.05,
|
||||
2 => -5.0,
|
||||
_ => 0.0,
|
||||
};
|
||||
self.hotkey_actions.push(HotkeyAction::AdjustSampling(self.sampling_selected, delta));
|
||||
return;
|
||||
}
|
||||
KeyCode::Esc => { self.screen = Screen::Interact; return; }
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
Screen::Interact => {}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue