diff --git a/tools/server/utils.hpp b/tools/server/utils.hpp index b8d140e3f051c..6ff38478be8b5 100644 --- a/tools/server/utils.hpp +++ b/tools/server/utils.hpp @@ -643,6 +643,10 @@ static json oaicompat_completion_params_parse( throw std::runtime_error("Expected 'messages' to be an array"); } for (auto & msg : messages) { + if (!msg.contains("content")) { + continue; + } + json & content = msg.at("content"); if (content.is_string() || content.is_null()) { continue;