Module: OllamaChat::History

Included in:
Chat
Defined in:
lib/ollama_chat/history.rb

Overview

A module that provides history management functionality for OllamaChat sessions.

The History module encapsulates methods for initializing, saving, and clearing command-line history within the OllamaChat application. It handles persistence of user input history to a file and ensures that chat sessions can maintain state across invocations by loading previous command histories.

Class Attribute Summary collapse

Class Attribute Details

.current_historySymbol

The currently active history namespace.

Returns:

  • (Symbol)

    the name of the current history namespace (e.g., :chat).



17
18
19
# File 'lib/ollama_chat/history.rb', line 17

def current_history
  @current_history
end

.historiesObject

A hash storing multiple history namespaces. Keys are symbols representing the namespace (e.g., :chat, :session_name), and values are arrays of strings containing the command history.



13
14
15
# File 'lib/ollama_chat/history.rb', line 13

def histories
  @histories
end