-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Conversation
def message_mutation(self, message: Message) -> Message: | ||
|
||
new_message = message.copy() | ||
if '__retrieved-docs__' not in message: |
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 suggest replacing the hard-coded key values with the names from here
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.
nit: also this if condition could go before the deep copy (slight speed up).
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.
ok
new_message = message.copy() | ||
if '__retrieved-docs__' not in message: | ||
return message | ||
del new_message['__retrieved-docs__'] |
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.
Is this del
necessary given that it gets set later in line 726?
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.
you either have to do this or a force_set on the message I think..
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.
Some very minor comments, but LGTM.
No description provided.