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

feat(assistants): Add PDF generation functionality and nice emails #2436

Merged
merged 3 commits into from
Apr 17, 2024

Conversation

StanGirard
Copy link
Collaborator

@StanGirard StanGirard commented Apr 17, 2024

This pull request adds PDF generation functionality and improves the formatting of emails. It includes a new module for generating PDFs using the fpdf2 library and updates the email templates to use markdown formatting for better readability.


Ellipsis 🚀 This PR description was created by Ellipsis for commit ccecff7.

Summary:

This PR introduces PDF generation functionality, improves email formatting, sanitizes filenames, updates various files and dependencies, and updates docker-compose.dev.yml.

Key points:

  • Added PDF generation functionality using the fpdf2 library
  • Improved email formatting
  • Sanitized filenames using the unidecode library
  • Updated backend/modules/assistant/ito/ito.py to generate PDFs and sanitize filenames
  • Added pdf_generator.py in backend/modules/assistant/ito/utils/ for PDF generation
  • Updated Pipfile and Pipfile.lock in backend/modules/assistant/ito/utils/ to include unidecode
  • Updated requirements.txt with new dependencies
  • Updated docker-compose.dev.yml

Generated with ❤️ by ellipsis.dev

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Apr 17, 2024
Copy link

vercel bot commented Apr 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
quivrapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 17, 2024 11:59am

@dosubot dosubot bot added the area: backend Related to backend functionality or under the /backend directory label Apr 17, 2024
Copy link
Contributor

ellipsis-dev bot commented Apr 17, 2024

⚠️ This PR is too large for Ellipsis, but support for larger PRs is coming soon.


Generated with ❤️ by ellipsis.dev

Copy link
Contributor

ellipsis-dev bot commented Apr 17, 2024

Sorry, Ellipsis encountered a problem while reviewing this PR at commit cb0051f. Our team has been alerted and is investigating. (wflow_qCdvuPoJaIKZgSLT) 🤖

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested.

  • Performed an incremental review on 8921eb9
  • Looked at 272 lines of code in 7 files
  • Took 5 minutes and 33 seconds to review
More info
  • Skipped 0 files when reviewing.
  • Skipped posting 6 additional comments because they didn't meet confidence threshold of 50%.
1. backend/modules/assistant/ito/utils/Pipfile:7:
  • Assessed confidence : 100%
  • Grade: 0%
  • Comment:
    The 'unidecode' package is added twice in the project. Once in the main Pipfile and again in the Pipfile inside the 'ito/utils' directory. This could lead to version conflicts and is generally not a good practice. The package should be included in the main Pipfile and removed from the 'ito/utils' Pipfile.
  • Reasoning:
    The 'unidecode' package is added twice in the project. Once in the main Pipfile and again in the Pipfile inside the 'ito/utils' directory. This could lead to version conflicts and is generally not a good practice. The package should be included in the main Pipfile and removed from the 'ito/utils' Pipfile.
2. backend/modules/assistant/ito/utils/Pipfile:1:
  • Assessed confidence : 100%
  • Grade: 0%
  • Comment:
    This directory has its own Pipfile and Pipfile.lock, which is unusual. Typically, a Python project has a single set of these files at the root level. Having multiple sets of these files can lead to dependency conflicts and make the project harder to manage. It would be better to consolidate these files at the project root level.
  • Reasoning:
    The 'ito/utils' directory has its own Pipfile and Pipfile.lock, which is unusual. Typically, a Python project has a single set of these files at the root level. Having multiple sets of these files can lead to dependency conflicts and make the project harder to manage. It would be better to consolidate these files at the project root level.
3. backend/modules/assistant/ito/utils/Pipfile.lock:1:
  • Assessed confidence : 100%
  • Grade: 40%
  • Comment:
    This directory has its own Pipfile.lock, which is unusual. Typically, a Python project has a single Pipfile.lock at the root level. Having multiple Pipfile.lock files can lead to dependency conflicts and make the project harder to manage. It would be better to consolidate this file at the project root level.
  • Reasoning:
    The 'ito/utils' directory has its own Pipfile.lock, which is unusual. Typically, a Python project has a single Pipfile.lock at the root level. Having multiple Pipfile.lock files can lead to dependency conflicts and make the project harder to manage. It would be better to consolidate this file at the project root level.
4. backend/modules/assistant/ito/utils/pdf_generator.py:38:
  • Assessed confidence : 100%
  • Grade: 0%
  • Comment:
    The 'header' function is missing a docstring. According to PEP 257, all public functions should have a docstring. This docstring should provide a brief overview of the function's purpose, its inputs, outputs, and any important details the user of the function should know.
  • Reasoning:
    The 'pdf_generator.py' file is missing a docstring at the function level for 'header'. This is a violation of PEP 257, which recommends that all public functions should have a docstring. This docstring should provide a brief overview of the function's purpose, its inputs, outputs, and any important details the user of the function should know.
5. backend/modules/assistant/ito/utils/pdf_generator.py:51:
  • Assessed confidence : 100%
  • Grade: 0%
  • Comment:
    The 'footer' function is missing a docstring. According to PEP 257, all public functions should have a docstring. This docstring should provide a brief overview of the function's purpose, its inputs, outputs, and any important details the user of the function should know.
  • Reasoning:
    The 'pdf_generator.py' file is missing a docstring at the function level for 'footer'. This is a violation of PEP 257, which recommends that all public functions should have a docstring. This docstring should provide a brief overview of the function's purpose, its inputs, outputs, and any important details the user of the function should know.
6. backend/modules/assistant/ito/utils/pdf_generator.py:62:
  • Assessed confidence : 100%
  • Grade: 0%
  • Comment:
    The 'chapter_body' function is missing a docstring. According to PEP 257, all public functions should have a docstring. This docstring should provide a brief overview of the function's purpose, its inputs, outputs, and any important details the user of the function should know.
  • Reasoning:
    The 'pdf_generator.py' file is missing a docstring at the function level for 'chapter_body'. This is a violation of PEP 257, which recommends that all public functions should have a docstring. This docstring should provide a brief overview of the function's purpose, its inputs, outputs, and any important details the user of the function should know.

Workflow ID: wflow_Zt5oGm4vyzUS0TKG


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. We'll respond in a few minutes. Learn more here.

⌛ You have 2 days remaining in your free trial. Upgrade at https://app.ellipsis.dev for $20/developer/month. If you have any questions, reach us at help@ellipsis.dev

[dev-packages]

[requires]
python_version = "3.12"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Python version specified here is '3.12', which is not a released version of Python. This could cause issues when trying to install the dependencies in this environment. The Python version should be changed to a valid released version.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me!

  • Performed an incremental review on ccecff7
  • Looked at 117 lines of code in 4 files
  • Took 2 minutes and 14 seconds to review
More info
  • Skipped 0 files when reviewing.
  • Skipped posting 1 additional comments because they didn't meet confidence threshold of 50%.
1. docker-compose.dev.yml:46:
  • Assessed confidence : 80%
  • Grade: 0%
  • Comment:
    The build context and Dockerfile have been removed from the worker, beat, and flower services. Please ensure that these services do not require a specific build context or Dockerfile.
  • Reasoning:
    The docker-compose.dev.yml file has been modified. The build context and Dockerfile have been removed from the worker, beat, and flower services. This could potentially cause issues if these services require a specific build context or Dockerfile. I need to check if these changes are appropriate and won't cause any issues.

Workflow ID: wflow_pbxOzJi21xRS8P1t


Not what you expected? You can customize the content of the reviews using rules. Learn more here.

⌛ You have 2 days remaining in your free trial. Upgrade at https://app.ellipsis.dev for $20/developer/month. If you have any questions, reach us at help@ellipsis.dev

@StanGirard StanGirard merged commit b622973 into main Apr 17, 2024
5 checks passed
StanGirard added a commit that referenced this pull request Apr 19, 2024
🤖 I have created a release *beep* *boop*
---


## 0.0.231 (2024-04-19)

## What's Changed
* feat(assistants): Add user usage update and pricing calculation to ITO
assistant by @StanGirard in #2433
* feat(assistant): improve prompt summary by @StanGirard in
#2435
* feat(assistants): Add PDF generation functionality and nice emails by
@StanGirard in #2436
* feat(analytics): rely on sql rather that python loop for brains by
@StanGirard in #2437
* fix(assistant): summary now can output 2000 tokens by @StanGirard in
#2440
* feat(assistant): check if key of file is same as filename uploaded by
@StanGirard in #2439
* feat: Update Docker build commands and dependencies by @StanGirard in
#2441
* feat(rag): Refactor DEFAULT_DOCUMENT_PROMPT in quivr_rag.py by
@StanGirard in #2442
* Enable Porter Application quivr-back by @porter-deployment-app in
#2443
* Enable Porter Application quivr-demo-front by @porter-deployment-app
in #2444
* fix(assistants): brain id is null by @StanGirard in
#2445
* feat(summary): improve prompt to get more insights by @StanGirard in
#2446
* feat(aws): Update CPU and memory configurations for task definitions
by @StanGirard in #2447
* feat(frontend): Quivr Assistants by @Zewed in
#2448


**Full Changelog**:
v0.0.230...v0.0.231

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

<!--
ELLIPSIS_HIDDEN
-->


----

| 🚀 This description was created by
[Ellipsis](https://www.ellipsis.dev) for commit
a16fa4d |
|--------|

### Summary:
This PR releases version 0.0.231, introducing several feature
enhancements and bug fixes across the assistant, analytics, Docker, and
frontend modules.

**Key points**:
- Release version 0.0.231 with feature enhancements and bug fixes across
multiple modules
- User usage update and pricing calculation added to ITO assistant
- Improved prompt summary in assistant module
- PDF generation functionality and email enhancements added
- Analytics optimized by relying on SQL instead of Python loop
- Token output limit fixed in assistant summary
- Docker build commands and dependencies updated
- DEFAULT_DOCUMENT_PROMPT in quivr_rag.py refactored
- Porter Applications for quivr-back and quivr-demo-front enabled
- Null brain id issue fixed in assistants module
- Prompt improved for better insights in summary module
- CPU and memory configurations for AWS task definitions updated
- Quivr Assistants added in frontend


----
Generated with ❤️ by [ellipsis.dev](https://www.ellipsis.dev)



<!--
ELLIPSIS_HIDDEN
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: backend Related to backend functionality or under the /backend directory size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant