Skip to content

Commit

Permalink
fix: handle EOF (#1434)
Browse files Browse the repository at this point in the history
  • Loading branch information
vansangpfiev authored Oct 4, 2024
1 parent 4807899 commit 1b6e1d0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion engine/commands/chat_completion_cmd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ void ChatCompletionCmd::Exec(const std::string& host, int port,
std::string user_input = std::move(msg);
if (user_input.empty()) {
std::cout << "> ";
std::getline(std::cin, user_input);
if (!std::getline(std::cin, user_input)) {
break;
}
}
if (user_input == kExitChat) {
break;
Expand Down

0 comments on commit 1b6e1d0

Please sign in to comment.