Skip to content

Commit d7336be

Browse files
committed
Improved output of AI model when continuing an application
1 parent 798e36a commit d7336be

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

cg/CodeGenerator/CodeGenerator/src/main/java/pn/cg/datastorage/constant/QuestionConstants.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public record QuestionConstants() {
116116

117117
public final static String NOTE_TO_KEEP_AS_MUCH_ORIGINAL_STRUCTURE_AS_POSSIBLE="Make sure that your generated code keep the current functionality and only add functionality to the existing code";
118118

119-
public final static String NO_EXISTING_CODE_COMMENTS="I need the actual code without any comments or placeholders referencing existing code";
119+
public final static String NO_EXISTING_CODE_COMMENTS="I need the actual code without any comments and without any placeholders referencing existing code";
120120

121121
public final static String THREAD_PACKAGE="If your code requires the Java Thread package use import java.lang.Thread";
122122

@@ -249,5 +249,7 @@ public record QuestionConstants() {
249249
*/
250250
public final static String DO_NOT_ASSUME_PACKAGE_NAMES="The application won't run if you import non-existent packages, so don't assume package names";
251251

252+
public final static String NEVER_ADD_EXISTING_CODE_REFERENCE_COMMENTS="You will never ever write a comment that references existing code but must instead include that code along with the new code";
253+
252254
/// ***** ///
253255
}

cg/CodeGenerator/CodeGenerator/src/main/java/pn/cg/ollama_ai_remote/request/RequestHandlerImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ public String sendQuestionToOllamaInstance(String question, String pathToJavaFil
102102
.addLine(question)
103103
.addLine(QuestionConstants.NOTE_TO_KEEP_AS_MUCH_ORIGINAL_STRUCTURE_AS_POSSIBLE)
104104
.addLine(QuestionConstants.NO_EXISTING_CODE_COMMENTS)
105+
.add(QuestionConstants.NEVER_ADD_EXISTING_CODE_REFERENCE_COMMENTS)
105106
.addLine(QuestionConstants.AND_CORRECT_IMPORTS)
106107
.addLine(QuestionConstants.MARK_START_CHAR_DELIMITER)
107108
.addLine(QuestionConstants.MARK_THE_END_CHAR_DELIMITER)

0 commit comments

Comments
 (0)