@@ -432,7 +432,7 @@ func (h *Handler) handleChat(w http.ResponseWriter, r *http.Request) {
432432 openAIReq := map [string ]interface {}{
433433 "model" : modelName ,
434434 "messages" : convertMessages (req .Messages ),
435- "stream" : req .Stream != nil && * req .Stream ,
435+ "stream" : req .Stream == nil || * req .Stream ,
436436 }
437437
438438 // Add options if present
@@ -446,7 +446,7 @@ func (h *Handler) handleChat(w http.ResponseWriter, r *http.Request) {
446446 }
447447
448448 // Make request to scheduler
449- h .proxyToChatCompletions (ctx , w , r , openAIReq , modelName , req .Stream != nil && * req .Stream )
449+ h .proxyToChatCompletions (ctx , w , r , openAIReq , modelName , req .Stream == nil || * req .Stream )
450450}
451451
452452// handleGenerate handles POST /api/generate
@@ -499,7 +499,7 @@ func (h *Handler) handleGenerate(w http.ResponseWriter, r *http.Request) {
499499 "messages" : convertMessages ([]Message {
500500 {Role : "user" , Content : req .Prompt },
501501 }),
502- "stream" : req .Stream != nil && * req .Stream ,
502+ "stream" : req .Stream == nil || * req .Stream ,
503503 }
504504
505505 // Add options if present
0 commit comments