Skip to content

Commit

Permalink
check messages > 0
Browse files Browse the repository at this point in the history
  • Loading branch information
ad-astra-video committed Jan 14, 2025
1 parent eaba8ca commit 08ad6e3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/ai_mediaserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ func (ls *LivepeerServer) LLM() http.Handler {
return
}

if req.Model == nil || req.Messages == nil || req.Stream == nil || req.MaxTokens == nil {
//check required fields
if req.Model == nil || req.Messages == nil || req.Stream == nil || req.MaxTokens == nil || len(req.Messages) == 0 {
respondJsonError(ctx, w, errors.New("missing required fields"), http.StatusBadRequest)
return
}
Expand Down

0 comments on commit 08ad6e3

Please sign in to comment.