Skip to content

Commit c9feb9e

Browse files
committed
Accept requests where content is missing entirely - not just null or empty
1 parent e5c834f commit c9feb9e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tools/server/utils.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,10 @@ static json oaicompat_completion_params_parse(
643643
throw std::runtime_error("Expected 'messages' to be an array");
644644
}
645645
for (auto & msg : messages) {
646+
if (!msg.contains("content")) {
647+
continue;
648+
}
649+
646650
json & content = msg.at("content");
647651
if (content.is_string() || content.is_null()) {
648652
continue;

0 commit comments

Comments
 (0)