Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions holmes/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class SlashCommands(Enum):
)
CONTEXT = ("/context", "Show conversation context size and token count")
SHOW = ("/show", "Show specific tool output in scrollable view")
MODEL = ("/model", "Show current LLM model being used")

def __init__(self, command, description):
self.command = command
Expand Down Expand Up @@ -457,6 +458,13 @@ def _(event):
console.print(format_tool_call_output(tool_call))


def handle_model_command(ai: ToolCallingLLM, console: Console) -> None:
"""Handle the /model command to show current LLM model information."""
console.print(
f"[bold {STATUS_COLOR}]Current Model:[/bold {STATUS_COLOR}] {ai.llm.model}"
)


def handle_context_command(messages, ai: ToolCallingLLM, console: Console) -> None:
"""Handle the /context command to show conversation context statistics."""
if messages is None:
Expand Down Expand Up @@ -489,6 +497,7 @@ def handle_context_command(messages, ai: ToolCallingLLM, console: Console) -> No

# Display context information
console.print(f"[bold {STATUS_COLOR}]Conversation Context:[/bold {STATUS_COLOR}]")
console.print(f" Model: {ai.llm.model}")
console.print(
f" Context used: {total_tokens:,} / {max_context_size:,} tokens ({(total_tokens / max_context_size) * 100:.1f}%)"
)
Expand Down Expand Up @@ -970,6 +979,9 @@ def get_bottom_toolbar():
elif command == SlashCommands.CONTEXT.command:
handle_context_command(messages, ai, console)
continue
elif command == SlashCommands.MODEL.command:
handle_model_command(ai, console)
continue
elif command.startswith(SlashCommands.SHOW.command):
# Parse the command to extract tool index or name
show_arg = original_input[len(SlashCommands.SHOW.command) :].strip()
Expand Down
Loading