User message is the last

This commit is contained in:
Ettore Di Giacinto
2024-04-10 23:34:01 +02:00
parent 230d012915
commit ac580b562e

View File

@@ -200,13 +200,6 @@ func (a *Agent) consumeJob(job *Job, role string) {
// TODO: Use llava to explain the image content
//}
if job.Text != "" {
a.currentConversation = append(a.currentConversation, openai.ChatCompletionMessage{
Role: role,
Content: job.Text,
})
}
if a.options.systemPrompt != "" {
if !Messages(a.currentConversation).Exist(a.options.systemPrompt) {
a.currentConversation = append([]openai.ChatCompletionMessage{
@@ -256,6 +249,13 @@ func (a *Agent) consumeJob(job *Job, role string) {
}
}
if job.Text != "" {
a.currentConversation = append(a.currentConversation, openai.ChatCompletionMessage{
Role: role,
Content: job.Text,
})
}
var pickTemplate string
var reEvaluationTemplate string