refactor(gui_2): migrate DiscussionSettings consumer (Phase 10 batch 2)
Phase 10 (batch 2): DiscussionSettings
Before: 1 .get('temperature'/...) site in src/gui_2.py
After: 0
Delta: -1 (plan expected 3 sites; 2 were already migrated by Tier 2)
Migrates the summary line in persona preferred model rendering:
entry.get('temperature', 0.7)
entry.get('top_p', 1.0)
entry.get('max_output_tokens', 0)
to:
ds = DiscussionSettings.from_dict(entry) if isinstance(entry, dict) else ds
ds.temperature, ds.top_p, ds.max_output_tokens
The dataclass defaults match the original .get() defaults exactly
(temperature=0.7, top_p=1.0, max_output_tokens=0), so behavior is preserved.
This commit is contained in:
+3
-1
@@ -3536,7 +3536,9 @@ def render_persona_editor_window(app: App, is_embedded: bool = False) -> None:
|
||||
if imgui.button("-" if is_expanded else "+"): app._persona_pref_models_expanded[i] = not is_expanded
|
||||
imgui.same_line(); imgui.text(f"{i+1}."); imgui.same_line(); imgui.text_colored(C_LBL(), f"{prov}"); imgui.same_line(); imgui.text("-"); imgui.same_line(); imgui.text_colored(C_IN(), f"{mod}")
|
||||
if not is_expanded:
|
||||
imgui.same_line(); summary = f" (T:{entry.get('temperature', 0.7):.1f}, P:{entry.get('top_p', 1.0):.2f}, M:{entry.get('max_output_tokens', 0)})"
|
||||
from src.type_aliases import DiscussionSettings as _DS
|
||||
ds = _DS.from_dict(entry) if isinstance(entry, dict) else entry
|
||||
imgui.same_line(); summary = f" (T:{ds.temperature:.1f}, P:{ds.top_p:.2f}, M:{ds.max_output_tokens})"
|
||||
imgui.text_colored(C_SUB(), summary)
|
||||
imgui.same_line(imgui.get_content_region_avail().x - 30);
|
||||
if imgui.button("x"): to_remove.append(i)
|
||||
|
||||
Reference in New Issue
Block a user