19 lines
458 B
Go
19 lines
458 B
Go
package bot
|
|
|
|
import (
|
|
"matrix-gpt-bot/openai"
|
|
)
|
|
|
|
// conversations stores per-user message history.
|
|
var conversations = map[string][]openai.Message{}
|
|
|
|
// GetHistory retrieves the conversation history for a given user.
|
|
func GetHistory(userID string) []openai.Message {
|
|
return conversations[userID]
|
|
}
|
|
|
|
// SetHistory saves the conversation history for a given user.
|
|
func SetHistory(userID string, history []openai.Message) {
|
|
conversations[userID] = history
|
|
}
|