Skip retry messages when resuming chat task #282
@@ -511,9 +511,15 @@ func main() {
|
||||
var previousTask *interaction.HumanUtterance
|
||||
if request.ConversationID != "" && interactiondomain.IsRetryRequest(utterance.Content) {
|
||||
if history, historyErr := interactionRepository.Utterances(r.Context(), conversation.ID); historyErr == nil && len(history) > 0 {
|
||||
candidate := history[len(history)-1]
|
||||
previousTask = &candidate
|
||||
effectiveTaskMessage = candidate.Content
|
||||
for index := len(history) - 1; index >= 0; index-- {
|
||||
if interactiondomain.IsRetryRequest(history[index].Content) {
|
||||
continue
|
||||
}
|
||||
candidate := history[index]
|
||||
previousTask = &candidate
|
||||
effectiveTaskMessage = candidate.Content
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
semantic, err := interactiondomain.InterpretUtterance(utterance, projects, previousFocus, now)
|
||||
|
||||
Reference in New Issue
Block a user