-
Notifications
You must be signed in to change notification settings - Fork 8
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
Closing file context manager if upload is success #202
Closing file context manager if upload is success #202
Conversation
@@ -434,7 +434,7 @@ export default function Chat ({ sessionId }) { | |||
new LisaChatMessage({ | |||
type: 'ai', | |||
content: result, | |||
metadata: metadata, | |||
metadata: useRag ? { ...metadata, ...prev.history[prev.history.length - 1].metadata } : metadata, |
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.
Are we handling an empty history array?
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.
It won't be empty is RAG is used because when we get the context back it sets a chat history message already
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.
…if we're already talking about this line it might be cleaner to use prev.history.slice(-1)[0].metadata
? I already approved so not blocking at all…more of a preference.
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.
Honestly looking at this code today, it all needs to be re-written, it is pretty nasty. Let's make note of this and I will get a task written to do some cleanup around this chat piece.
Close the file context manager if file ingestion/upload is successful
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.