-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
38d8db1
commit d539fd5
Showing
11 changed files
with
62 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/main/java/com/zhongan/devpilot/constant/PromptConst.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.zhongan.devpilot.constant; | ||
|
||
public class PromptConst { | ||
|
||
public final static String RESPONSE_FORMAT = "You are a coding expert.\n" + | ||
"You must obey ALL of the following rules:\n\n" + | ||
"- quote variable name with single backtick such as `name`.\n" + | ||
"- quote code block with triple backticks such as ```...```"; | ||
|
||
public final static String ANSWER_IN_CHINESE = "\nPlease answer in Chinese."; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.zhongan.devpilot.util; | ||
|
||
import com.zhongan.devpilot.integrations.llms.entity.DevPilotMessage; | ||
|
||
public class MessageUtil { | ||
|
||
public static DevPilotMessage createMessage(String role, String content) { | ||
DevPilotMessage message = new DevPilotMessage(); | ||
message.setRole(role); | ||
message.setContent(content); | ||
return message; | ||
} | ||
|
||
public static DevPilotMessage createUserMessage(String content) { | ||
return createMessage("user", content); | ||
} | ||
|
||
public static DevPilotMessage createSystemMessage(String content) { | ||
return createMessage("system", content); | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters