浏览代码

omit empty done reason

Bruce MacDonald 11 月之前
父节点
当前提交
c02db93243
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      api/types.go

+ 2 - 2
api/types.go

@@ -117,7 +117,7 @@ type ChatResponse struct {
 	Model      string    `json:"model"`
 	Model      string    `json:"model"`
 	CreatedAt  time.Time `json:"created_at"`
 	CreatedAt  time.Time `json:"created_at"`
 	Message    Message   `json:"message"`
 	Message    Message   `json:"message"`
-	DoneReason string    `json:"done_reason"`
+	DoneReason string    `json:"done_reason,omitempty"`
 
 
 	Done bool `json:"done"`
 	Done bool `json:"done"`
 
 
@@ -311,7 +311,7 @@ type GenerateResponse struct {
 	Done bool `json:"done"`
 	Done bool `json:"done"`
 
 
 	// DoneReason is the reason the model stopped generating text.
 	// 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
 	// Context is an encoding of the conversation used in this response; this
 	// can be sent in the next request to keep a conversational memory.
 	// can be sent in the next request to keep a conversational memory.