Skip to content

Commit

Permalink
update transhipment
Browse files Browse the repository at this point in the history
  • Loading branch information
zmh-program committed Nov 12, 2023
1 parent ca73ebc commit c381818
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion connection/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 6 additions & 5 deletions manager/transhipment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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{
Expand Down

0 comments on commit c381818

Please sign in to comment.