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