fix: Enable sorting of chat inputs to improve UI message speed (#4480)

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-11-11 11:22:04 -03:00 committed by GitHub
commit 76c91de563
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 3 deletions

View file

@ -2006,7 +2006,8 @@ class Graph:
vertices_layers = self.layered_topological_sort(vertices)
vertices_layers = self.sort_by_avg_build_time(vertices_layers)
# vertices_layers = self.sort_chat_inputs_first(vertices_layers)
# Sort the chat inputs first to speed up sending the User message to the UI
vertices_layers = self.sort_chat_inputs_first(vertices_layers)
# Now we should sort each layer in a way that we make sure
# vertex V does not depend on vertex V+1
vertices_layers = self.sort_layer_by_dependency(vertices_layers)