update transhipment

This commit is contained in:
Zhang Minghan 2023-11-12 10:37:53 +08:00
parent ca73ebc696
commit c38181829a
2 changed files with 7 additions and 6 deletions

View File

@ -105,7 +105,7 @@ func CreateConversationTable(db *sql.DB) {
user_id INT,
conversation_id INT,
conversation_name VARCHAR(255),
data TEXT,
data MEDIUMTEXT,
model VARCHAR(255) NOT NULL DEFAULT 'gpt-3.5-turbo-0613',
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
UNIQUE KEY (user_id, conversation_id)

View File

@ -135,14 +135,15 @@ func sendTranshipmentResponse(c *gin.Context, form TranshipmentForm, id string,
CollectQuota(c, user, buffer, plan)
c.JSON(http.StatusOK, TranshipmentResponse{
Id: id,
Id: fmt.Sprintf("chatcmpl-%s", id),
Object: "chat.completion",
Created: created,
Model: form.Model,
Choices: []Choice{
{
Index: 0,
Message: globals.Message{Role: "assistant", Content: buffer.ReadWithDefault(defaultMessage)},
Index: 0,
Message: globals.Message{Role: "assistant", Content: buffer.ReadWithDefault(defaultMessage)},
FinishReason: "stop",
},
},
Usage: Usage{
@ -156,8 +157,8 @@ func sendTranshipmentResponse(c *gin.Context, form TranshipmentForm, id string,
func getStreamTranshipmentForm(id string, created int64, form TranshipmentForm, data string, buffer *utils.Buffer, end bool) TranshipmentStreamResponse {
return TranshipmentStreamResponse{
Id: id,
Object: "chat.completion",
Id: fmt.Sprintf("chatcmpl-%s", id),
Object: "chat.completion.chunk",
Created: created,
Model: form.Model,
Choices: []ChoiceDelta{