Small fixups

Signed-off-by: mudler <mudler@localai.io>
This commit is contained in:
mudler
2024-12-18 17:44:52 +01:00
parent 735bab5e32
commit c68ff23b01

View File

@@ -348,7 +348,7 @@ func (a *Agent) consumeJob(job *Job, role string) {
// Walk conversation from bottom to top, and find the first message of the user // Walk conversation from bottom to top, and find the first message of the user
// to use it as a query to the KB // to use it as a query to the KB
var userMessage string var userMessage string
for i := len(a.currentConversation); i == 0; i-- { for i := len(a.currentConversation) - 1; i >= 0; i-- {
xlog.Info("[Long term memory] Conversation", "role", a.currentConversation[i].Role, "Content", a.currentConversation[i].Content) xlog.Info("[Long term memory] Conversation", "role", a.currentConversation[i].Role, "Content", a.currentConversation[i].Content)
if a.currentConversation[i].Role == "user" { if a.currentConversation[i].Role == "user" {
userMessage = a.currentConversation[i].Content userMessage = a.currentConversation[i].Content