mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 08:02:17 +00:00
Merge pull request #315 from mitsuhiko/model-switcher
Reverse model switching and binding for dialog
This commit is contained in:
commit
4edfff41a7
5 changed files with 57 additions and 12 deletions
|
|
@ -213,9 +213,12 @@ export class InteractiveMode {
|
|||
theme.fg("dim", "shift+tab") +
|
||||
theme.fg("muted", " to cycle thinking") +
|
||||
"\n" +
|
||||
theme.fg("dim", "ctrl+p") +
|
||||
theme.fg("dim", "ctrl+p/shift+ctrl+p") +
|
||||
theme.fg("muted", " to cycle models") +
|
||||
"\n" +
|
||||
theme.fg("dim", "ctrl+l") +
|
||||
theme.fg("muted", " to select model") +
|
||||
"\n" +
|
||||
theme.fg("dim", "ctrl+o") +
|
||||
theme.fg("muted", " to expand tools") +
|
||||
"\n" +
|
||||
|
|
@ -580,7 +583,9 @@ export class InteractiveMode {
|
|||
this.editor.onCtrlD = () => this.handleCtrlD();
|
||||
this.editor.onCtrlZ = () => this.handleCtrlZ();
|
||||
this.editor.onShiftTab = () => this.cycleThinkingLevel();
|
||||
this.editor.onCtrlP = () => this.cycleModel();
|
||||
this.editor.onCtrlP = () => this.cycleModel("forward");
|
||||
this.editor.onShiftCtrlP = () => this.cycleModel("backward");
|
||||
this.editor.onCtrlL = () => this.showModelSelector();
|
||||
this.editor.onCtrlO = () => this.toggleToolOutputExpansion();
|
||||
this.editor.onCtrlT = () => this.toggleThinkingBlockVisibility();
|
||||
this.editor.onCtrlG = () => this.openExternalEditor();
|
||||
|
|
@ -1200,9 +1205,9 @@ export class InteractiveMode {
|
|||
}
|
||||
}
|
||||
|
||||
private async cycleModel(): Promise<void> {
|
||||
private async cycleModel(direction: "forward" | "backward"): Promise<void> {
|
||||
try {
|
||||
const result = await this.session.cycleModel();
|
||||
const result = await this.session.cycleModel(direction);
|
||||
if (result === null) {
|
||||
const msg = this.session.scopedModels.length > 0 ? "Only one model in scope" : "Only one model available";
|
||||
this.showStatus(msg);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue