fix: do not track an internal currentConversation (#91)

It is prone to races, and does not really track all conversations for
each job

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
Ettore Di Giacinto
2025-03-25 00:36:09 +01:00
committed by GitHub
parent b09749dddb
commit 53c1554d55
5 changed files with 115 additions and 177 deletions

View File

@@ -216,7 +216,6 @@ func (t *Slack) handleChannelMessage(
}
agentOptions := []types.JobOption{
types.WithText(message),
types.WithUUID(ev.ThreadTimeStamp),
}
@@ -228,8 +227,10 @@ func (t *Slack) handleChannelMessage(
if err != nil {
xlog.Error(fmt.Sprintf("Error encoding image to base64: %v", err))
} else {
agentOptions = append(agentOptions, types.WithImage(fmt.Sprintf("data:%s;base64,%s", mimeType, imgBase64)))
agentOptions = append(agentOptions, types.WithTextImage(message, fmt.Sprintf("data:%s;base64,%s", mimeType, imgBase64)))
}
} else {
agentOptions = append(agentOptions, types.WithText(message))
}
res := a.Ask(