feat: update auto reply and packaging

This commit is contained in:
ly1213
2026-06-29 17:44:22 +08:00
parent 1ca66dc0af
commit 2d5ee7f08d
19 changed files with 1147 additions and 227 deletions

View File

@@ -125,6 +125,10 @@ func (e *AutoReplyEngine) processJob(job AutoReplyJob) {
if name := e.displayNameForMessage(msg); name != "" {
msg.FromNickName = name
}
if cfg.Identity.ReplyExternalOnly && identity.isInternal() {
e.ignoreMessage(msg, "internal_ignored_external_only")
return
}
if identity.Source == identitySourceUnknownAsCustomer {
e.noteReason(identitySourceUnknownAsCustomer)
if !msg.IsGroup {
@@ -269,7 +273,11 @@ func (e *AutoReplyEngine) processJob(job AutoReplyJob) {
}
e.setLastRetrievalScores(searchResult.KeywordScore, searchResult.VectorScore, searchResult.RerankScore)
if len(materialMatches) > 0 {
if err := e.sendMaterials(msg, materialMatches, "materials_replied", withSearchMetadata(currentTimings(), searchResult)); err != nil {
materialMatches = e.filterRecentlySentMaterials(msg, materialMatches)
}
if len(materialMatches) > 0 {
tutorialText := materialTutorialTextFromHits(hits)
if err := e.sendMaterials(msg, materialMatches, "materials_replied", withSearchMetadata(currentTimings(), searchResult), tutorialText); err != nil {
e.setLastErrorWithScope(autoReplyErrorScopeRecords, "material send failed: "+err.Error())
}
return