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

🔧 fix: Improve Assistants File Citation & Download Handling #2248

Merged
merged 5 commits into from
Mar 29, 2024

Conversation

danny-avila
Copy link
Owner

@danny-avila danny-avila commented Mar 29, 2024

Summary

Thank you @jimgoo for reporting this here: #2247

This change addresses the handling of file citations provided by the assistant and improves the overall user experience when downloading and accessing referenced files within the application.

Implemented improvements to the file citation handling and download experience:

  • Properly handle assistant file citations within the processMessages function, ensuring accurate source attribution as well as handling mismanaged undefined basename condition.
  • Add a sources list to display referenced files from file citations.
  • Enhance the file download UX, making downloaded files accessible within the application for seamless user experience.
  • Refactor processOpenAIImageOutput to correctly handle different outputs for images from OpenAI.
  • Create addFileToCache helper to consistently add files to the cache across the frontend.
  • Refactor to add ImageFile parts to the cache when processing the content stream.

Change Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Testing

To test these changes, you can try reproducing the original steps highlighted in this discussion: #2247

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • I have made pertinent documentation changes
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes
  • Any changes dependent on mine have been merged and published in downstream modules

@danny-avila danny-avila merged commit 6a6b2e7 into main Mar 29, 2024
3 checks passed
@danny-avila danny-avila deleted the fix-citations branch March 29, 2024 23:09
@jimgoo
Copy link

jimgoo commented Mar 29, 2024

Thanks @danny-avila, amazing work you’ve done with LibreChat, what an incredible project!

@danny-avila
Copy link
Owner Author

Thanks @danny-avila, amazing work you’ve done with LibreChat, what an incredible project!

Thank you for checking it out!

jinzishuai pushed a commit to aitok-ai/LibreChat that referenced this pull request May 20, 2024
…ila#2248)

* fix(processMessages): properly handle assistant file citations and add sources list

* feat: improve file download UX by making any downloaded files accessible within the app post-download

* refactor(processOpenAIImageOutput): correctly handle two different outputs for images since OpenAI generates a file in their storage, shares filepath for image rendering

* refactor: create `addFileToCache` helper to use across frontend

* refactor: add ImageFile parts to cache on processing content stream
kenshinsamue pushed a commit to intelequia/LibreChat that referenced this pull request Sep 17, 2024
…ila#2248)

* fix(processMessages): properly handle assistant file citations and add sources list

* feat: improve file download UX by making any downloaded files accessible within the app post-download

* refactor(processOpenAIImageOutput): correctly handle two different outputs for images since OpenAI generates a file in their storage, shares filepath for image rendering

* refactor: create `addFileToCache` helper to use across frontend

* refactor: add ImageFile parts to cache on processing content stream
BertKiv pushed a commit to BertKiv/LibreChat that referenced this pull request Dec 10, 2024
…ila#2248)

* fix(processMessages): properly handle assistant file citations and add sources list

* feat: improve file download UX by making any downloaded files accessible within the app post-download

* refactor(processOpenAIImageOutput): correctly handle two different outputs for images since OpenAI generates a file in their storage, shares filepath for image rendering

* refactor: create `addFileToCache` helper to use across frontend

* refactor: add ImageFile parts to cache on processing content stream
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.

2 participants