Skip to content

Commit

Permalink
gemini: Conversation will expire after 30 instead of 10 minutes
Browse files Browse the repository at this point in the history
  • Loading branch information
Brawl345 committed May 25, 2024
1 parent f67d257 commit 1fff403
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion model/sql/gemini.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package sql
import (
"database/sql"
"errors"

"github.com/Brawl345/gobot/logger"
"github.com/Brawl345/gobot/model"
"github.com/PaulSonOfLars/gotgbot/v2"
Expand Down Expand Up @@ -44,7 +45,7 @@ func (db *geminiService) ResetHistory(chat *gotgbot.Chat) error {
func (db *geminiService) SetHistory(chat *gotgbot.Chat, history string) error {
const query = `UPDATE chats
SET gemini_history = ?,
gemini_history_expires_on = NOW() + INTERVAL 10 MINUTE
gemini_history_expires_on = NOW() + INTERVAL 30 MINUTE
WHERE id = ?`
_, err := db.Exec(query, history, chat.Id)
return err
Expand Down

0 comments on commit 1fff403

Please sign in to comment.