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

Fixed Several Exceptions in Workflow Usage #12075

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

ndhjm
Copy link

@ndhjm ndhjm commented Dec 25, 2024

This pull request includes several changes across multiple files to improve functionality, fix bugs, and enhance code readability. The most important changes include the addition of a new package in the Dockerfile, a fix for file name encoding in HTTP headers, and various bug fixes and improvements in the workflow nodes.

Resolves #12074

Improvements and Bug Fixes:

  • Dockerfile Update:

    • Added libreoffice to the list of packages installed in the Dockerfile to support additional functionalities.
  • File Name Encoding:

    • Fixed the encoding of file names in the Content-Disposition header to handle special characters properly by using urllib.parse.quote.
  • Tool Parameter Type Fix:

    • Corrected a typo in the ToolParameterType class by changing systme-files to system-files.
  • Encoding Detection:

    • Added chardet to detect file encoding dynamically when extracting text from CSV files, improving robustness against various encodings. [1] [2]
  • Equality Check Fix:

    • Fixed the equality check in the _is function to use == instead of is for string comparison.This pull request includes several changes across multiple files to improve functionality and fix bugs. The most important changes include adding a new package to the Dockerfile, fixing a typo in an enum, enhancing file handling in the image preview controller, improving text extraction from CSV files, and updating the question classifier node to handle different query types.

Improvements to Dockerfile:

  • Added libreoffice installation to the Dockerfile to support additional functionalities.

Bug Fixes:

  • Fixed a typo in the ToolParameterType enum from "systme-files" to "system-files".
  • Corrected the _is function to use == instead of is for string comparison in list_operator/node.py.

Enhancements:

  • Enhanced file handling in the image_preview.py controller by safely encoding filenames for the Content-Disposition header.
  • Improved text extraction from CSV files by detecting and using the correct file encoding with the chardet library. [1] [2]

Updates to Question Classifier Node:

  • Updated the question_classifier_node.py to handle different query types, including converting non-string types to JSON strings. [1] [2]This pull request includes several changes to the api module, focusing on enhancements, bug fixes, and improvements to the codebase. The most important changes include adding a new package to the Dockerfile, fixing a typo in an enumeration value, improving file handling in the image_preview controller, and updating text extraction and comparison logic.

Enhancements:

  • api/Dockerfile: Added libreoffice to the list of packages installed during the Docker image build process.

Bug fixes:

Codebase improvements:

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Tip

Close issue syntax: Fixes #<issue number> or Resolves #<issue number>, see documentation for more details.

Screenshots

Before After
... ...

Checklist

Important

Please review the checklist below before submitting your pull request.

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. 🐞 bug Something isn't working 💪 enhancement New feature or request labels Dec 25, 2024
@yihong0618
Copy link
Contributor

very clean Pull Request message learned that, thank you for the content

This reverts commit 2f0823d.
@crazywoola crazywoola requested a review from laipz8200 December 27, 2024 12:22
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Dec 27, 2024
@ndhjm
Copy link
Author

ndhjm commented Dec 27, 2024

I have standardized my code format and look forward to review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 💪 enhancement New feature or request size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some Exceptions Occurring with Workflow Usage
2 participants