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

PDF and DOCX support in Write File - Feature Improvement, close #548 #1268

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from

Conversation

Arkajit-Datta
Copy link
Contributor

@Arkajit-Datta Arkajit-Datta commented Sep 20, 2023

Description

The Write File Tool can now support writing the results and discussions in a PDF or a DOCX file, with proper formatting and images embedded.

Related Issues

#548

Solution and Design

Libraries called pdfkit and htmldocx are being leveraged to do the writing process.
The content initially used to be stored in a Txt file using the write tool is formatted and styled through an HTML file using an LLM.
Images generated by the agent are extracted and embedded in the same HTML file.
This HTML file is now stored in various formats like PDF & DOCX.

Test Plan

Asking the Agent to store the results in a PDF or DOCX file.
Navigate to the workspace folder to find the generated PDF or DOCX.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Docs update

Checklist

  • My pull request is atomic and focuses on a single change.
  • I have read the contributing guide and my code conforms to the guidelines.
  • I have documented my changes clearly and comprehensively.
  • I have added the required tests.

@codecov
Copy link

codecov bot commented Sep 20, 2023

Codecov Report

Patch coverage: 50.83% and project coverage change: -0.05% ⚠️

Comparison is base (2ccbd4b) 58.93% compared to head (353d911) 58.88%.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1268      +/-   ##
==========================================
- Coverage   58.93%   58.88%   -0.05%     
==========================================
  Files         228      229       +1     
  Lines       11028    11129     +101     
  Branches     1182     1194      +12     
==========================================
+ Hits         6499     6553      +54     
- Misses       4199     4245      +46     
- Partials      330      331       +1     
Files Changed Coverage Δ
superagi/tools/file/write_file.py 41.02% <28.12%> (-53.10%) ⬇️
superagi/exceptions/file_exceptions.py 50.00% <50.00%> (ø)
superagi/resource_manager/file_manager.py 66.08% <81.25%> (+15.48%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Arkajit-Datta
Copy link
Contributor Author

@luciferlinx101, @Fluder-Paradyne, and @TransformerOptimus This PR was recreated after the dev was reverted, have added all the features related to the previous Feature Update. Have a look.

@Arkajit-Datta
Copy link
Contributor Author

@luciferlinx101 @Fluder-Paradyne and @TransformerOptimus A gentle reminder to review the PR. Thanks

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.

None yet

1 participant