-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/redbox 367 show citation text #696
Conversation
@@ -209,6 +209,9 @@ def expires_at(self) -> datetime: | |||
def expires(self) -> timedelta: | |||
return self.expires_at - datetime.now(tz=UTC) | |||
|
|||
def __lt__(self, other): | |||
return self.id < other.id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would created_at
be a better metric to sort by? Or does the order not matter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now, it doesn't matter - we only need a total ordering so that we can group citations by file. If one day we need some specific order, we can revisit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've put in another comment about the grouping by file - can we preserve the order of the 'most relevant file'? Or is that for a later PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now we don't store the citation order in the DB at all AFAICT. We might need to revisit that, because while streaming chat shows them in the order they came in, revisiting the chats page might show them in any order, even before this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think order_by("created_at")
for Citations could do this, but it might need some more testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One problem of this approach is that the order of the source responses is lost on the citations page.
e.g. on the chat view - which has the most relevant source file listed first:
and in the citations page view - which loses this ordering
Given that this is the 'quick' initial round of showing citations, I would be happy with this discrepancy if Charlotte and Gabe are.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A good quick pass at this, which I think will add a lot of user value. Approved pending approval from Gabe/Charlotte re the discrepancy in File order.
Context
Allow the user to see some detail of the citations.
Changes proposed in this pull request
Guidance to review
Relevant links
https://technologyprogramme.atlassian.net/browse/REDBOX-367
Things to check