-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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: add code generator #9051
Merged
crazywoola
merged 9 commits into
langgenius:main
from
Kota-Yamaguchi:feature/add_code_generator
Oct 22, 2024
Merged
feat: add code generator #9051
crazywoola
merged 9 commits into
langgenius:main
from
Kota-Yamaguchi:feature/add_code_generator
Oct 22, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- en-US - ja-JP - zh-Hans
- Add generateRuleCode function to handle API request - Define CodeGenRes type for the response - Implement POST request to '/rule-code-generate' endpoint
- Create button to trigger code generation - Implement modal for code generation interface - Add functionality to display generated code - Include options for code language selection - Integrate with existing code generation API
- Adjust button placement for better user experience - Modify interface to accommodate new button layout - Add handler for code generation functionality - Update component props to support new features
dosubot
bot
added
size:L
This PR changes 100-499 lines, ignoring generated files.
💪 enhancement
New feature or request
labels
Oct 7, 2024
crazywoola
previously approved these changes
Oct 22, 2024
crazywoola
approved these changes
Oct 22, 2024
idonotknow
pushed a commit
to AceDataCloud/Dify
that referenced
this pull request
Nov 16, 2024
Co-authored-by: crazywoola <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
💪 enhancement
New feature or request
lgtm
This PR has been approved by a maintainer
size:L
This PR changes 100-499 lines, ignoring generated files.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist:
Important
Please review the checklist below before submitting your pull request.
dev/reformat
(backend) andcd web && npx lint-staged
(frontend) to appease the lint godsDescription
Background
As a user of Dify, I have personally experienced the challenges of writing code directly on the platform. Unlike in local environments where tools like GitHub Copilot or Cursor can assist me in generating code, Dify currently lacks similar features. This makes it difficult to efficiently implement functionalities, particularly for users like me who may not have advanced programming skills. Writing code from scratch without assistance can be time-consuming and discouraging, which limits productivity and creativity.
My company used to do a Dify course for people who couldn't write code, and they had a very hard time with code blocks. I wish I could get them to face LLM more.
So I suggest adding a code generator to the code node. I made a demo to give you an idea.
Close #9021
Added code
Frontend
Backend
Things not implemented
Considering the minimal functionality, I deemed these features unnecessary for this PR, so I did not implement them.
Type of Change
Testing Instructions
You can verify this functionality by following these steps
At First , Launch Workflow/ChatFlow.
⇨ Create a node code. (You can use python and javascript)
⇨ Click on the Generateicon button in the header
⇨ Tell the modal that comes up what code you want to write.
⇨ Apply.
I will post a demonstration.
https://github.com/user-attachments/assets/abaf890d-7ad4-4192-8f2a-9f7a679d6178