Skip to content
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

Merged
merged 5 commits into from
Dec 3, 2024

Conversation

estohlmann
Copy link
Member

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.

@estohlmann estohlmann marked this pull request as ready for review December 3, 2024 18:24
@@ -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,
Copy link
Contributor

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?

Copy link
Member Author

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

Copy link
Contributor

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.

Copy link
Member Author

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.

@estohlmann estohlmann merged commit 6dcb60b into develop Dec 3, 2024
4 checks passed
@estohlmann estohlmann deleted the feature/close-file-context-if-upload-is-success branch December 3, 2024 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants