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(block): Support find all regex extraction for ExtractTextInformationBlock #8934

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

majdyz
Copy link
Contributor

@majdyz majdyz commented Dec 10, 2024

ExtractTextInformationBlock is only supporting extracting one match.

Changes πŸ—οΈ

Adding find_all option to ExtractTextInformationBlock.

Checklist πŸ“‹

For code changes:

  • I have clearly listed my changes in the PR description
  • I have made a test plan
  • I have tested my changes according to the test plan:
    • ...
Example test plan
  • Create from scratch and execute an agent with at least 3 blocks
  • Import an agent from file upload, and confirm it executes correctly
  • Upload agent to marketplace
  • Import an agent from marketplace and confirm it executes correctly
  • Edit an agent from monitor, and confirm it executes correctly

For configuration changes:

  • .env.example is updated or already compatible with my changes
  • docker-compose.yml is updated or already compatible with my changes
  • I have included a list of my configuration changes in the PR description (under Changes)
Examples of configuration changes
  • Changing ports
  • Adding new services that need to communicate with each other
  • Secrets or environment variable changes
  • New or infrastructure changes such as databases

@majdyz majdyz requested a review from Torantulino December 10, 2024 18:05
@majdyz majdyz requested a review from a team as a code owner December 10, 2024 18:05
@majdyz majdyz requested review from Bentlybro and kcze and removed request for a team December 10, 2024 18:05
Copy link

PR Reviewer Guide πŸ”

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 πŸ”΅πŸ”΅βšͺβšͺβšͺ
πŸ§ͺΒ PR contains tests
πŸ”’Β Security concerns

Regular Expression Denial of Service (ReDoS):
The implementation accepts arbitrary regex patterns that could be malicious and cause catastrophic backtracking, leading to a denial of service. Consider adding pattern validation or timeout limits for the regex matching.

⚑ Recommended focus areas for review

Error Handling
The regex pattern matching should have proper error handling for invalid regex patterns that could raise re.error exceptions

Performance
For large input texts with many matches, storing all matches in a list before yielding them could consume unnecessary memory. Consider yielding matches one at a time directly from finditer

Copy link

netlify bot commented Dec 10, 2024

βœ… Deploy Preview for auto-gpt-docs-dev canceled.

Name Link
πŸ”¨ Latest commit 311ae80
πŸ” Latest deploy log https://app.netlify.com/sites/auto-gpt-docs-dev/deploys/675882e9d4c8dd00089ac160

Copy link

netlify bot commented Dec 10, 2024

βœ… Deploy Preview for auto-gpt-docs-dev canceled.

Name Link
πŸ”¨ Latest commit 13b2d28
πŸ” Latest deploy log https://app.netlify.com/sites/auto-gpt-docs-dev/deploys/675882f5b1d451000811557a

Copy link

netlify bot commented Dec 10, 2024

βœ… Deploy Preview for auto-gpt-docs ready!

Name Link
πŸ”¨ Latest commit 311ae80
πŸ” Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/675882e95da0a50008d9f883
😎 Deploy Preview https://deploy-preview-8934--auto-gpt-docs.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Dec 10, 2024

βœ… Deploy Preview for auto-gpt-docs ready!

Name Link
πŸ”¨ Latest commit 13b2d28
πŸ” Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/675882f579d9dc0007ab3b28
😎 Deploy Preview https://deploy-preview-8934--auto-gpt-docs.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@majdyz majdyz added this pull request to the merge queue Dec 10, 2024
Merged via the queue into dev with commit d827d4f Dec 10, 2024
19 checks passed
@majdyz majdyz deleted the zamilmajdy/add_findall_regex branch December 10, 2024 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants