Commit 12e2658
authored
Enhance prompt processing with existing file content support (#43)
### Overview
This PR improves the prompt-based file generation functionality by
allowing the OpenAI-assisted file generation process to consider and
modify existing file content when applicable.
### Changes
- **Added** support for passing existing file content to the OpenAI
prompt within `file_item.py`.
- **Updated** default OpenAI model to `gpt-4.1` from `gpt-3.5-turbo`.
- **Modified** `generate.py` to read existing file content and pass it
to the `process_prompt()` method.
- **Created** a new example configuration file `example/gpt.yaml`
demonstrating usage with user prompts.
### Justification
This change provides more intelligent and context-aware file generation
by allowing existing content to be passed into the prompt. It helps to
enhance productivity and avoid overwriting relevant content
unintentionally.
### Impact
- Improves integration with OpenAI by enabling content-aware generation.
- Prevents accidental data loss when regenerating files.
- Demonstrates usage with an example YAML file, aiding users in
understanding configuration.1 parent cf8f980 commit 12e2658
File tree
3 files changed
+29
-7
lines changed- example
- struct_module
- commands
3 files changed
+29
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
93 | 105 | | |
94 | | - | |
95 | 106 | | |
96 | 107 | | |
97 | 108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | | - | |
61 | | - | |
62 | 60 | | |
63 | 61 | | |
64 | 62 | | |
| |||
68 | 66 | | |
69 | 67 | | |
70 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
71 | 77 | | |
72 | 78 | | |
73 | 79 | | |
74 | 80 | | |
75 | 81 | | |
76 | | - | |
| 82 | + | |
77 | 83 | | |
78 | 84 | | |
79 | 85 | | |
80 | 86 | | |
81 | | - | |
| 87 | + | |
82 | 88 | | |
83 | 89 | | |
84 | 90 | | |
| |||
0 commit comments