From cfb3b88b34002004f32a69aa543eaefc4f6a4ee8 Mon Sep 17 00:00:00 2001 From: linweiyuan Date: Thu, 5 Oct 2023 12:55:52 +0800 Subject: [PATCH] fix metadata issue (#274) --- api/chatgpt/typings.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/api/chatgpt/typings.go b/api/chatgpt/typings.go index 62bb3f05e..369edc895 100644 --- a/api/chatgpt/typings.go +++ b/api/chatgpt/typings.go @@ -20,9 +20,10 @@ type CreateConversationRequest struct { func (c *CreateConversationRequest) AddMessage(role string, content string) { c.Messages = append(c.Messages, Message{ - ID: uuid.New().String(), - Author: Author{Role: role}, - Content: Content{ContentType: "text", Parts: []interface{}{content}}, + ID: uuid.New().String(), + Author: Author{Role: role}, + Content: Content{ContentType: "text", Parts: []interface{}{content}}, + Metadata: map[string]string{}, }) }