fix(slack): track user messages when writing on channel

Signed-off-by: mudler <mudler@localai.io>
This commit is contained in:
mudler
2025-03-26 16:58:25 +01:00
parent d5df14a714
commit 9d6b81d9c2

View File

@@ -300,6 +300,10 @@ func (t *Slack) handleChannelMessage(
}) })
} }
t.conversationTracker.AddMessage(
t.channelID, currentConv[len(currentConv)-1],
)
agentOptions = append(agentOptions, types.WithConversationHistory(currentConv)) agentOptions = append(agentOptions, types.WithConversationHistory(currentConv))
// Add channel to metadata for tracking // Add channel to metadata for tracking
@@ -685,16 +689,12 @@ func (t *Slack) handleMention(
} }
func (t *Slack) Start(a *agent.Agent) { func (t *Slack) Start(a *agent.Agent) {
<<<<<<< Updated upstream
<<<<<<< Updated upstream
postMessageParams := slack.PostMessageParameters{ postMessageParams := slack.PostMessageParameters{
LinkNames: 1, LinkNames: 1,
Markdown: true, Markdown: true,
} }
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
// Store the agent reference for use in cancellation // Store the agent reference for use in cancellation
t.agent = a t.agent = a