Documentation ¶
Index ¶
- Variables
- func NewModel() func(NewModelParams) (*Model, error)
- type FromPlatform
- type Model
- 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) FindChatHistoriesByTimeBefore(chatID int64, before time.Duration) ([]*ent.ChatHistories, error)
- func (m *Model) FindLastOneHourChatHistories(chatID int64) ([]*ent.ChatHistories, error)
- func (m *Model) FindLastSixHourChatHistories(chatID int64) ([]*ent.ChatHistories, error)
- func (m *Model) FindPrivateForwardedChatHistories(userID int64) ([]telegramPrivateForwardedReplayChatHistory, error)
- func (m *Model) HasOngoingRecapForwardedFromPrivateMessages(userID int64) (bool, error)
- func (m *Model) SaveOneTelegramChatHistory(message *tgbotapi.Message) error
- func (m *Model) SaveOneTelegramPrivateForwardedReplayChatHistory(message *tgbotapi.Message) error
- func (m *Model) SummarizeChatHistories(chatID int64, histories []*ent.ChatHistories) ([]string, error)
- func (m *Model) SummarizePrivateForwardedChatHistories(userID int64, histories []telegramPrivateForwardedReplayChatHistory) ([]string, error)
- func (m *Model) UpdateOneTelegramChatHistory(message *tgbotapi.Message) 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.ParticipantsNamesWithoutUsername "," }} 讨论:{{ 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 }}`))
Functions ¶
func NewModel ¶
func NewModel() func(NewModelParams) (*Model, error)
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func (*Model) DisableRecapForwardedFromPrivateMessages ¶ added in v0.14.0
func (*Model) EnabledRecapForwardedFromPrivateMessages ¶ added in v0.14.0
func (*Model) ExtractTextFromMessage ¶
func (*Model) FindChatHistoriesByTimeBefore ¶
func (*Model) FindLastOneHourChatHistories ¶
func (m *Model) FindLastOneHourChatHistories(chatID int64) ([]*ent.ChatHistories, error)
func (*Model) FindLastSixHourChatHistories ¶
func (m *Model) FindLastSixHourChatHistories(chatID int64) ([]*ent.ChatHistories, error)
func (*Model) FindPrivateForwardedChatHistories ¶ added in v0.14.0
func (*Model) HasOngoingRecapForwardedFromPrivateMessages ¶ added in v0.14.0
func (*Model) SaveOneTelegramChatHistory ¶
func (*Model) SaveOneTelegramPrivateForwardedReplayChatHistory ¶ added in v0.14.0
func (*Model) SummarizeChatHistories ¶
func (*Model) SummarizePrivateForwardedChatHistories ¶ added in v0.14.0
type NewModelParams ¶
type RecapOutputTemplateInputs ¶
type RecapOutputTemplateInputs struct { ChatID string Recap *openai.ChatHistorySummarizationOutputs }
Click to show internal directories.
Click to hide internal directories.