Skip to content

Commit d4ba1bc

Browse files
committed
Add /model command to interactive mode
- Added MODEL slash command to show current LLM model being used - Added handle_model_command() function to display model information - Also updated /context command to include model name in output - Provides quick access to see which model is currently configured
1 parent 9746fa6 commit d4ba1bc

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

holmes/interactive.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ class SlashCommands(Enum):
6161
)
6262
CONTEXT = ("/context", "Show conversation context size and token count")
6363
SHOW = ("/show", "Show specific tool output in scrollable view")
64+
MODEL = ("/model", "Show current LLM model being used")
6465

6566
def __init__(self, command, description):
6667
self.command = command
@@ -457,6 +458,13 @@ def _(event):
457458
console.print(format_tool_call_output(tool_call))
458459

459460

461+
def handle_model_command(ai: ToolCallingLLM, console: Console) -> None:
462+
"""Handle the /model command to show current LLM model information."""
463+
console.print(
464+
f"[bold {STATUS_COLOR}]Current Model:[/bold {STATUS_COLOR}] {ai.llm.model}"
465+
)
466+
467+
460468
def handle_context_command(messages, ai: ToolCallingLLM, console: Console) -> None:
461469
"""Handle the /context command to show conversation context statistics."""
462470
if messages is None:
@@ -489,6 +497,7 @@ def handle_context_command(messages, ai: ToolCallingLLM, console: Console) -> No
489497

490498
# Display context information
491499
console.print(f"[bold {STATUS_COLOR}]Conversation Context:[/bold {STATUS_COLOR}]")
500+
console.print(f" Model: {ai.llm.model}")
492501
console.print(
493502
f" Context used: {total_tokens:,} / {max_context_size:,} tokens ({(total_tokens / max_context_size) * 100:.1f}%)"
494503
)
@@ -970,6 +979,9 @@ def get_bottom_toolbar():
970979
elif command == SlashCommands.CONTEXT.command:
971980
handle_context_command(messages, ai, console)
972981
continue
982+
elif command == SlashCommands.MODEL.command:
983+
handle_model_command(ai, console)
984+
continue
973985
elif command.startswith(SlashCommands.SHOW.command):
974986
# Parse the command to extract tool index or name
975987
show_arg = original_input[len(SlashCommands.SHOW.command) :].strip()

0 commit comments

Comments
 (0)