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(frontend): Add field extraction handle for block with object output #8900

Conversation

majdyz
Copy link
Contributor

@majdyz majdyz commented Dec 6, 2024

This addresses #8741

We have quite a few blocks with (object) outputs. The only way to really use these is to use a "Find In Dictionary" block to pick out that property.

If the structure of the output object is known, we should expose the properties of the object directly as sub-outputs. This will make a huge difference in UX and make using these blocks much much easier.

Changes 🏗️

Recursively flatten object fields into output node handles

image image

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 Pwuts December 6, 2024 19:47
@majdyz majdyz requested a review from a team as a code owner December 6, 2024 19:47
@majdyz majdyz requested review from Torantulino and removed request for a team December 6, 2024 19:47
@github-actions github-actions bot added platform/frontend AutoGPT Platform - Front end platform/backend AutoGPT Platform - Back end labels Dec 6, 2024
Copy link

qodo-merge-pro bot commented Dec 6, 2024

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis ✅

8741 - Fully compliant

Compliant requirements:

  • Expose properties of object outputs as sub-outputs in blocks
  • Make object properties directly accessible without using "Find In Dictionary" block
  • Improve UX by making block usage easier through direct property access
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Potential Memory Leak
The recursive rendering of handles in renderHandles function might cause performance issues with deeply nested objects. Consider adding a maximum depth limit.

Code Smell
The keyPrefix concatenation using '#' separator is a magic string that could lead to maintenance issues. Consider defining it as a constant.

Copy link

netlify bot commented Dec 6, 2024

Deploy Preview for auto-gpt-docs-dev canceled.

Name Link
🔨 Latest commit c74b9d3
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs-dev/deploys/675354c20f558b00088b8a50

Copy link

netlify bot commented Dec 6, 2024

Deploy Preview for auto-gpt-docs canceled.

Name Link
🔨 Latest commit c74b9d3
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/675354c2b7c5f40008505739

Copy link

netlify bot commented Dec 6, 2024

Deploy Preview for auto-gpt-docs-dev canceled.

Name Link
🔨 Latest commit d4596f7
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs-dev/deploys/67575f0853891b000874aa52

Copy link

netlify bot commented Dec 6, 2024

Deploy Preview for auto-gpt-docs canceled.

Name Link
🔨 Latest commit d4596f7
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/67575f085fed8b0007c3a01b

@ntindle ntindle enabled auto-merge December 9, 2024 20:51
@ntindle ntindle added this pull request to the merge queue Dec 9, 2024
Merged via the queue into dev with commit 79c0c31 Dec 9, 2024
19 checks passed
@ntindle ntindle deleted the zamilmajdy/open-2076-expose-properties-of-object-outputs-as-sub-outputs branch December 9, 2024 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform/backend AutoGPT Platform - Back end platform/frontend AutoGPT Platform - Front end Review effort [1-5]: 2 size/m
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants