AI rule generation - #576
Conversation
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Debug print statements should be removed from production code or replaced with proper logging using the logger module.
| .replace(",", "") | ||
| .split("/")[-1] | ||
| ) | ||
| print(env_name) |
There was a problem hiding this comment.
Debug print statements should be removed from production code or replaced with proper logging using the logger module.
No description provided.