Documentation ¶
Index ¶
- Variables
- func NewModel() func(NewModelParams) (*Model, error)
- type FeedbackChatHistoriesRecapsReactionsCounts
- type FromPlatform
- type Model
- func (m *Model) DeleteAllChatHistoriesByChatID(chatID int64) error
- func (m *Model) DisableRecapForwardedFromPrivateMessages(userID int64) error
- func (m *Model) EnabledRecapForwardedFromPrivateMessages(userID int64) error
- func (m *Model) ExtractTextFromMessage(message *tgbotapi.Message) string
- func (m *Model) FeedbackRecapsReactToChatIDAndLogID(chatID int64, logID uuid.UUID, userID int64, ...) error
- func (m *Model) FindChatHistoriesByTimeBefore(chatID int64, before time.Duration) ([]*ent.ChatHistories, error)
- func (m *Model) FindFeedbackRecapsReactionCountsForChatIDAndLogID(chatID int64, logID uuid.UUID) (FeedbackChatHistoriesRecapsReactionsCounts, error)
- func (m *Model) FindLast12HourChatHistories(chatID int64) ([]*ent.ChatHistories, error)
- func (m *Model) FindLast6HourChatHistories(chatID int64) ([]*ent.ChatHistories, error)
- func (m *Model) FindLast8HourChatHistories(chatID int64) ([]*ent.ChatHistories, error)
- func (m *Model) FindLastOneHourChatHistories(chatID int64) ([]*ent.ChatHistories, error)
- func (m *Model) FindLastTelegramPinnedMessage(chatID int64) (*ent.SentMessages, error)
- func (m *Model) FindPrivateForwardedChatHistories(userID int64) ([]telegramPrivateForwardedReplayChatHistory, error)
- func (m *Model) HasOngoingRecapForwardedFromPrivateMessages(userID int64) (bool, error)
- func (m *Model) MigrateChatHistoriesOfChatFromChatIDToChatID(fromChatID, toChatID int64) error
- func (m *Model) NewFeedbackRecapsDownVoteButton(bot *tgbot.Bot, chatID int64, logID uuid.UUID, downVoteCount int) (tgbotapi.InlineKeyboardButton, error)
- func (m *Model) NewFeedbackRecapsLmaoButton(bot *tgbot.Bot, chatID int64, logID uuid.UUID, downVoteCount int) (tgbotapi.InlineKeyboardButton, error)
- func (m *Model) NewFeedbackRecapsUpVoteButton(bot *tgbot.Bot, chatID int64, logID uuid.UUID, upVoteCount int) (tgbotapi.InlineKeyboardButton, error)
- func (m *Model) NewVoteRecapInlineKeyboardMarkup(bot *tgbot.Bot, chatID int64, logID uuid.UUID, upVoteCount int, ...) (tgbotapi.InlineKeyboardMarkup, error)
- func (m *Model) NewVoteRecapWithUnsubscribeInlineKeyboardMarkup(bot *tgbot.Bot, chatID int64, chatTitle string, fromID int64, logID uuid.UUID, ...) (tgbotapi.InlineKeyboardMarkup, error)
- func (m *Model) SaveOneTelegramChatHistory(message *tgbotapi.Message) error
- func (m *Model) SaveOneTelegramPrivateForwardedReplayChatHistory(message *tgbotapi.Message) error
- func (m *Model) SaveOneTelegramSentMessage(message *tgbotapi.Message, isPinned bool) error
- func (m *Model) SummarizeChatHistories(chatID int64, chatType telegram.ChatType, histories []*ent.ChatHistories) (uuid.UUID, []string, error)
- func (m *Model) SummarizePrivateForwardedChatHistories(userID int64, histories []telegramPrivateForwardedReplayChatHistory) ([]string, error)
- func (m *Model) UpdateOneTelegramChatHistory(message *tgbotapi.Message) error
- func (m *Model) UpdatePinnedMessage(chatID int64, messageID int, isPinned bool) error
- type NewModelParams
- type RecapOutputTemplateInputs
- type RecapType
Constants ¶
This section is empty.
Variables ¶
View Source
var RecapOutputTemplate = lo.Must(template. New("recap output markdown template"). Funcs(template.FuncMap{ "join": strings.Join, "sub": func(a, b int) int { return a - b }, "add": func(a, b int) int { return a + b }, "escape": tgbot.EscapeHTMLSymbols, }). Parse(`{{ $chatID := .ChatID }}{{ if .Recap.SinceID }}## <a href="https://t.me/c/{{ $chatID }}/{{ .Recap.SinceID }}">{{ escape .Recap.TopicName }}</a>{{ else }}## {{ escape .Recap.TopicName }}{{ end }} 参与人:{{ join .Recap.Participants "," }} 讨论:{{ range $di, $d := .Recap.Discussion }} - {{ escape $d.Point }}{{ if len $d.KeyIDs }} {{ range $cIndex, $c := $d.KeyIDs }}<a href="https://t.me/c/{{ $chatID }}/{{ $c }}">[{{ add $cIndex 1 }}]</a>{{ if not (eq $cIndex (sub (len $d.KeyIDs) 1)) }} {{ end }}{{ end }}{{ end }}{{ end }}{{ if .Recap.Conclusion }} 结论:{{ escape .Recap.Conclusion }}{{ end }}`))
View Source
var RecapWithoutLinksOutputTemplate = lo.Must(template. New("recap output markdown template"). Funcs(template.FuncMap{ "join": strings.Join, "sub": func(a, b int) int { return a - b }, "add": func(a, b int) int { return a + b }, "escape": tgbot.EscapeHTMLSymbols, }). Parse(`{{ $chatID := .ChatID }}{{ if .Recap.SinceID }}## {{ escape .Recap.TopicName }}{{ else }}## {{ escape .Recap.TopicName }}{{ end }} 参与人:{{ join .Recap.Participants "," }} 讨论:{{ range $di, $d := .Recap.Discussion }} - {{ escape $d.Point }}{{ end }}{{ if .Recap.Conclusion }} 结论:{{ escape .Recap.Conclusion }}{{ end }}`))
Functions ¶
func NewModel ¶
func NewModel() func(NewModelParams) (*Model, error)
Types ¶
type FeedbackChatHistoriesRecapsReactionsCounts ¶ added in v0.19.0
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func (*Model) DeleteAllChatHistoriesByChatID ¶ added in v0.17.0
func (*Model) DisableRecapForwardedFromPrivateMessages ¶ added in v0.14.0
func (*Model) EnabledRecapForwardedFromPrivateMessages ¶ added in v0.14.0
func (*Model) ExtractTextFromMessage ¶
func (*Model) FeedbackRecapsReactToChatIDAndLogID ¶ added in v0.19.0
func (*Model) FindChatHistoriesByTimeBefore ¶
func (*Model) FindFeedbackRecapsReactionCountsForChatIDAndLogID ¶ added in v0.19.0
func (*Model) FindLast12HourChatHistories ¶ added in v0.23.2
func (m *Model) FindLast12HourChatHistories(chatID int64) ([]*ent.ChatHistories, error)
func (*Model) FindLast6HourChatHistories ¶ added in v0.23.2
func (m *Model) FindLast6HourChatHistories(chatID int64) ([]*ent.ChatHistories, error)
func (*Model) FindLast8HourChatHistories ¶ added in v0.23.2
func (m *Model) FindLast8HourChatHistories(chatID int64) ([]*ent.ChatHistories, error)
func (*Model) FindLastOneHourChatHistories ¶
func (m *Model) FindLastOneHourChatHistories(chatID int64) ([]*ent.ChatHistories, error)
func (*Model) FindLastTelegramPinnedMessage ¶ added in v0.24.1
func (m *Model) FindLastTelegramPinnedMessage(chatID int64) (*ent.SentMessages, error)
func (*Model) FindPrivateForwardedChatHistories ¶ added in v0.14.0
func (*Model) HasOngoingRecapForwardedFromPrivateMessages ¶ added in v0.14.0
func (*Model) MigrateChatHistoriesOfChatFromChatIDToChatID ¶ added in v0.20.0
func (*Model) NewFeedbackRecapsDownVoteButton ¶ added in v0.19.0
func (*Model) NewFeedbackRecapsLmaoButton ¶ added in v0.19.0
func (*Model) NewFeedbackRecapsUpVoteButton ¶ added in v0.19.0
func (*Model) NewVoteRecapInlineKeyboardMarkup ¶ added in v0.19.0
func (*Model) NewVoteRecapWithUnsubscribeInlineKeyboardMarkup ¶ added in v0.19.0
func (*Model) SaveOneTelegramChatHistory ¶
func (*Model) SaveOneTelegramPrivateForwardedReplayChatHistory ¶ added in v0.14.0
func (*Model) SaveOneTelegramSentMessage ¶ added in v0.24.1
func (*Model) SummarizeChatHistories ¶
func (*Model) SummarizePrivateForwardedChatHistories ¶ added in v0.14.0
func (*Model) UpdateOneTelegramChatHistory ¶
type NewModelParams ¶
type RecapOutputTemplateInputs ¶
type RecapOutputTemplateInputs struct { ChatID string Recap *openai.ChatHistorySummarizationOutputs }
Click to show internal directories.
Click to hide internal directories.