mirror of
https://github.com/coaidev/coai.git
synced 2025-05-20 05:20:15 +09:00
fix type error
This commit is contained in:
parent
5e67bd49e0
commit
b9b0b94d73
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user