From c02db93243353855b983db2a1562a02b57e66db1 Mon Sep 17 00:00:00 2001 From: Bruce MacDonald Date: Thu, 9 May 2024 16:45:29 -0700 Subject: [PATCH] omit empty done reason --- api/types.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/types.go b/api/types.go index 860330db..c210d419 100644 --- a/api/types.go +++ b/api/types.go @@ -117,7 +117,7 @@ type ChatResponse struct { Model string `json:"model"` CreatedAt time.Time `json:"created_at"` Message Message `json:"message"` - DoneReason string `json:"done_reason"` + DoneReason string `json:"done_reason,omitempty"` Done bool `json:"done"` @@ -311,7 +311,7 @@ type GenerateResponse struct { Done bool `json:"done"` // DoneReason is the reason the model stopped generating text. - DoneReason string `json:"done_reason"` + DoneReason string `json:"done_reason,omitempty"` // Context is an encoding of the conversation used in this response; this // can be sent in the next request to keep a conversational memory.