From 52014fbd8b9a8b959beb00f2f513805882153f15 Mon Sep 17 00:00:00 2001 From: James Date: Mon, 21 Oct 2024 21:55:42 +0700 Subject: [PATCH] fix: remove chat command --- engine/cli/command_line_parser.cc | 32 ------------------------------- 1 file changed, 32 deletions(-) diff --git a/engine/cli/command_line_parser.cc b/engine/cli/command_line_parser.cc index 8d0b35d33..23b4c263f 100644 --- a/engine/cli/command_line_parser.cc +++ b/engine/cli/command_line_parser.cc @@ -1,8 +1,6 @@ #include "command_line_parser.h" #include #include -#include "commands/chat_cmd.h" -#include "commands/chat_completion_cmd.h" #include "commands/cortex_upd_cmd.h" #include "commands/engine_get_cmd.h" #include "commands/engine_install_cmd.h" @@ -152,36 +150,6 @@ void CommandLineParser::SetupCommonCommands() { cml_data_.model_id, download_service_); rc.Exec(cml_data_.run_detach); }); - - auto chat_cmd = app_.add_subcommand( - "chat", - "Shortcut for `cortex run --chat` or send a chat completion request"); - chat_cmd->group(kCommonCommandsGroup); - chat_cmd->usage("Usage:\n" + commands::GetCortexBinary() + - " chat [model_id] -m [msg]"); - chat_cmd->add_option("model_id", cml_data_.model_id, ""); - chat_cmd->add_option("-m,--message", cml_data_.msg, - "Message to chat with model"); - chat_cmd->callback([this, chat_cmd] { - if (std::exchange(executed_, true)) - return; - if (cml_data_.model_id.empty()) { - CLI_LOG("[model_id] is required\n"); - CLI_LOG(chat_cmd->help()); - return; - } - - if (cml_data_.msg.empty()) { - commands::ChatCmd().Exec(cml_data_.config.apiServerHost, - std::stoi(cml_data_.config.apiServerPort), - cml_data_.model_id, download_service_); - } else { - commands::ChatCompletionCmd(model_service_) - .Exec(cml_data_.config.apiServerHost, - std::stoi(cml_data_.config.apiServerPort), cml_data_.model_id, - cml_data_.msg); - } - }); } void CommandLineParser::SetupInferenceCommands() {