File tree Expand file tree Collapse file tree 3 files changed +6
-37
lines changed
src/main/scala/functorcoder/llm Expand file tree Collapse file tree 3 files changed +6
-37
lines changed Original file line number Diff line number Diff line change @@ -30,8 +30,8 @@ object llmMain {
3030 val openAiRequest = openaiReq
3131 .OpenAiRequest (
3232 List (
33- openaiReq.Message (roles.user , inputPrompt.generatePrompt ),
34- openaiReq.Message (roles.system , inputPrompt.getAssistantMessage )
33+ openaiReq.Message (roles.system , inputPrompt.getSysMessage ),
34+ openaiReq.Message (roles.user , inputPrompt.generatePrompt )
3535 ),
3636 editorCfg.model,
3737 max_tokens = Some (editorCfg.maxTokens)
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ object llmPrompt {
2828 // trait will have undefined value, so we use abstract class
2929 sealed abstract class Prompt (val assistantMsg : String ) {
3030 def generatePrompt : String
31- def getAssistantMessage : String = assistantMsg
31+ def getSysMessage : String = assistantMsg
3232 }
3333
3434 /** code completion prompt
@@ -51,7 +51,7 @@ object llmPrompt {
5151 case class Completion (
5252 codeWithHole : String , // code with a hole to fill like {{FILL_HERE}}
5353 // taskRequirement: String, // like "Fill the {{FILL_HERE}} hole."
54- assistantMessage : String = promptText.promptComp1
54+ assistantMessage : String = promptText.promptComp3
5555 ) extends Prompt (assistantMessage) {
5656 def generatePrompt = {
5757
@@ -122,6 +122,8 @@ object llmPrompt {
122122 " you replace this hole with your reply." +
123123 " only return the string for the hole with indentation, without any quotes"
124124
125+ val promptComp3 = s " Fill in the missing text specified by $hole. Only return the string which replace the hole. " +
126+ " Don't wrap it with backticks or any other tags"
125127 }
126128
127129 def generateDocs (language : String ) = {
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments