- 
                Notifications
    You must be signed in to change notification settings 
- Fork 44
AI rule generation #576
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
base: main
Are you sure you want to change the base?
AI rule generation #576
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the AI rule generation functionality by improving the prompt system and adding context file support. The main goal is to provide better namespacing and context to the AI model when generating Snakemake rules.
- Converts static prompts to parameterized functions that accept extension names for better rule namespacing
- Adds context file support to provide existing Sunbeam rules as examples to the AI model
- Improves environment extraction logic from generated rules
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description | 
|---|---|
| sunbeam/scripts/generate.py | Adds default context files and passes extension name to rule creation function | 
| sunbeam/ai/rule_creator.py | Updates function signature, adds debugging output, and improves environment parsing | 
| sunbeam/ai/prompts.py | Converts static prompts to parameterized functions for better customization | 
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| print("System prompt: ", system) | ||
| print("User prompt: ", user_content) | 
    
      
    
      Copilot
AI
    
    
    
      Sep 9, 2025 
    
  
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug print statements should be removed from production code or replaced with proper logging using the logger module.
| print("Out path: ", out_path) | ||
| print("Envs path: ", envs_path) | 
    
      
    
      Copilot
AI
    
    
    
      Sep 9, 2025 
    
  
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug print statements should be removed from production code or replaced with proper logging using the logger module.
| for env_name, env_text in env_texts.items(): | ||
| (envs_path / f"{env_name}.yaml").write_text(env_text) | ||
| env_fp = envs_path / f"{env_name}.yaml" | ||
| print("Writing env: ", env_fp) | 
    
      
    
      Copilot
AI
    
    
    
      Sep 9, 2025 
    
  
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug print statements should be removed from production code or replaced with proper logging using the logger module.
| .replace(",", "") | ||
| .split("/")[-1] | ||
| ) | ||
| print(env_name) | 
    
      
    
      Copilot
AI
    
    
    
      Sep 9, 2025 
    
  
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug print statements should be removed from production code or replaced with proper logging using the logger module.
No description provided.