mirror of
https://github.com/coaidev/coai.git
synced 2025-05-20 05:20:15 +09:00
update transhipment
This commit is contained in:
parent
ca73ebc696
commit
c38181829a
@ -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)
|
||||
|
@ -135,7 +135,7 @@ 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,
|
||||
@ -143,6 +143,7 @@ func sendTranshipmentResponse(c *gin.Context, form TranshipmentForm, id string,
|
||||
{
|
||||
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{
|
||||
|
Loading…
Reference in New Issue
Block a user