From c9feb9ee09f2383e8ca19d88b7d95689aebfdc93 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 13 May 2025 20:54:29 -0700 Subject: [PATCH] Accept requests where content is missing entirely - not just null or empty --- tools/server/utils.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/server/utils.hpp b/tools/server/utils.hpp index b8d140e3f05..6ff38478be8 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;