-
Notifications
You must be signed in to change notification settings - Fork 21.2k
AI-Powered Prompt and Code Generation Enhancement #24096
Description
Self Checks
- I have read the Contributing Guide and Language Policy.
- I have searched for existing issues search for existing issues, including closed ones.
- I confirm that I am using English to submit this report, otherwise it will be closed.
- Please do not modify this template :) and fill in all the required fields.
1. Is this request related to a challenge you're experiencing? Tell me about your story.
When building LLM applications in Dify, users often struggle with crafting effective prompts and writing code for various integrations. The process of creating optimal prompts requires multiple iterations and understanding of prompt engineering best practices. Similarly, generating code for workflows, especially in Python or JavaScript, can be time-consuming and error-prone for users who are not experienced developers.
PR #23633 addressed these challenges by implementing AI-powered assistance features that help users:
- Automatically generate and refine prompts based on instructions
- Generate code snippets for workflow nodes with proper context
- Modify existing prompts and code using AI suggestions
- View last run results and error messages directly in the prompt editor
This enhancement significantly improves the developer experience by reducing the time and expertise required to create effective LLM applications.
2. Additional context or comments
Implementation Details from PR #23633:
Backend Enhancements:
- New API endpoints for LLM-based generation (
/api/controllers/console/app/generator.py) - Core LLM generator logic with templates for JavaScript, Python, and prompt generation
- Support for rule configuration generation and code/prompt modification
Frontend Improvements:
- New automatic prompt generation UI components in workflow configuration
- Enhanced prompt editor with special blocks for:
- Current block replacement
- Error message display
- Last run results visualization
- Version selector for iterating on generated content
- Magic edit and code assistant icons for better UX
- Improved variable inspection panel in workflows
Key Features:
- Structured output generation with system prompts
- Context-aware code generation that considers workflow variables
- Real-time prompt refinement suggestions
- Integration between prompt editing and code generation in both app configuration and workflow nodes
This feature has been successfully merged in PR #23633 and provides a foundation for further AI-assisted development capabilities within Dify.
3. Can you help us with this feature?
- I am interested in contributing to this feature.