class ChatGPT::MagicCommandRunner
- ChatGPT::MagicCommandRunner
- Reference
- Object
Defined in:
chatgpt/magic_command_runner.crConstant Summary
-
Table =
[{"name" => "debug", "description" => "Toggle debug mode", "pattern" => "debug", "n_args" => 0, "method" => "debug_mode_toggle"}, {"name" => "model", "description" => "Show model name", "pattern" => "model", "n_args" => 0, "method" => "show_model_name"}, {"name" => "model <model_name>", "description" => "Set model name", "pattern" => /^model\s+(.+)/, "n_args" => 1, "method" => "set_model_name"}, {"name" => "system", "description" => "Show system messages", "pattern" => "system", "n_args" => 0, "method" => "show_system_messages"}, {"name" => "system <message>", "description" => "Set system message", "pattern" => /^system\s+(.+)/, "n_args" => 1, "method" => "set_system_messages"}, {"name" => "edit", "description" => "Show or edit data in JSON", "pattern" => "edit", "n_args" => 0, "method" => "edit_data_json"}, {"name" => "html", "description" => "Show data in the browser", "pattern" => "html", "n_args" => 0, "method" => "html_data"}, {"name" => "html <file_name>", "description" => "Save data to <file_name> and open in the browser", "pattern" => /^html\s+(.+)/, "n_args" => 1, "method" => "html_data"}, {"name" => "clear", "description" => "Clear messages and initialize data", "pattern" => "clear", "n_args" => 0, "method" => "clear_messages"}, {"name" => "write <file_name> or w <file_name>", "description" => "Write last message to <file_name>", "pattern" => /^[write,w]\s+(.+)/, "n_args" => 1, "method" => "write_to_file"}, {"name" => "undo", "description" => "Undo last message and response", "pattern" => "undo", "n_args" => 0, "method" => "undo"}, {"name" => "undo <n>", "description" => "Undo last <n> messages and responses", "pattern" => /^undo\s+(\d+)/, "n_args" => 1, "method" => "undo"}, {"name" => "resume", "description" => "Resume from auto-saved data", "pattern" => "resume", "n_args" => 0, "method" => "resume"}, {"name" => "save", "description" => "Save data to chatgpt-<timestamp>.json", "pattern" => "save", "n_args" => 0, "method" => "save_data_to_json"}, {"name" => "save <file_name>", "description" => "Save data to <file_name>", "pattern" => /^save\s+(.+)/, "n_args" => 1, "method" => "save_data_to_json"}, {"name" => "load", "description" => "Load latest saved data from current directory", "pattern" => "load", "n_args" => 0, "method" => "load_data_from_json"}, {"name" => "load <file_name>", "description" => "Load data from <file_name>", "pattern" => /^load\s+(.+)/, "n_args" => 1, "method" => "load_data_from_json"}, {"name" => "config", "description" => "Edit config file", "pattern" => "config", "n_args" => 0, "method" => "show_config"}, {"name" => "response", "description" => "Show last response in JSON", "pattern" => "response", "n_args" => 0, "method" => "show_response_json"}, {"name" => "tokens", "description" => "Show total tokens used", "pattern" => /^tokens?\s*$/, "n_args" => 0, "method" => "show_total_tokens"}, {"name" => "history", "description" => "Show history", "pattern" => "history", "n_args" => 0, "method" => "show_history"}, {"name" => "webapp", "description" => "Open ChatGPT webapp", "pattern" => "webapp", "n_args" => 0, "method" => "open_webapp"}, {"name" => "help", "description" => "Show this help", "pattern" => "help", "n_args" => 0, "method" => "show_help"}]
Constructors
Instance Method Summary
- #clear_messages
- #data : PostData
- #data=(data : PostData)
- #debug_mode_toggle
- #edit_data_json
- #html_data(file_name)
- #html_data
- #key : String
- #load_data_from_json(file_name)
- #load_data_from_json
- #next? : Bool
- #open_webapp
- #response_data : ResponseData
- #resume
- #run(command : String, data : ChatGPT::PostData, response_data : ChatGPT::ResponseData) : Bool
- #save_data_to_json(file_name)
- #save_data_to_json
- #set_model_name(model_name)
- #set_system_messages(message)
- #show_config
- #show_help
- #show_history
- #show_model_name
- #show_response_json
- #show_system_messages
- #show_total_tokens
- #total_tokens : Int32
- #try_run(msg, data, response_data, total_tokens : Int32)
- #undo(n)
- #undo
- #unknown_command_error(command)
- #write_to_file(file_name)