From 1b8feae0b6767e9334a45d1381a4e26c667df0d4 Mon Sep 17 00:00:00 2001 From: quzard <1191890118@qq.com> Date: Wed, 3 May 2023 01:41:21 +0800 Subject: [PATCH] Do not return when not present (#294) --- chat_stream.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chat_stream.go b/chat_stream.go index b5257ccc4..9ed0bc70a 100644 --- a/chat_stream.go +++ b/chat_stream.go @@ -7,7 +7,8 @@ import ( ) type ChatCompletionStreamChoiceDelta struct { - Content string `json:"content"` + Content string `json:"content,omitempty"` + Role string `json:"role,omitempty"` } type ChatCompletionStreamChoice struct {