Skip to content

Commit

Permalink
fix type error
Browse files Browse the repository at this point in the history
  • Loading branch information
zmh-program committed Oct 24, 2023
1 parent 5e67bd4 commit b9b0b94
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions manager/conversation/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,20 @@ func LoadConversation(db *sql.DB, userId int64, conversationId int64) *Conversat
Id: conversationId,
}

var data string
var (
data string
model interface{}
)
err := db.QueryRow(`
SELECT conversation_name, model, data FROM conversation
WHERE user_id = ? AND conversation_id = ?
`, userId, conversationId).Scan(&conversation.Name, &data, &conversation.Model)
`, userId, conversationId).Scan(&conversation.Name, &model, &data)
if value, ok := model.(string); ok {
conversation.Model = value
} else {
conversation.Model = globals.GPT3Turbo
}

if err != nil {
return nil
}
Expand Down

0 comments on commit b9b0b94

Please sign in to comment.