Commit 26ab08c8 by Jonathan Thomas

Improve creativeness with chat gpt temperature, improve prompts, better support…

Improve creativeness with chat gpt temperature, improve prompts, better support for GPT 3.5 and 4.0. Update model to gpt-3.5-turbo.
parent 7c8267cd
Pipeline #11867 passed with stage
in 21 seconds
......@@ -137,7 +137,7 @@ public class ChatDataManager {
// Get Entity details
Entity entity = ServerEntityFinder.getEntityByUUID(player.getServerWorld(), UUID.fromString(entityId));
if (entity.getCustomName() == null) {
contextData.put("entity_name", "Un-named");
contextData.put("entity_name", "");
} else {
contextData.put("entity_name", entity.getCustomName().toString());
}
......@@ -151,7 +151,9 @@ public class ChatDataManager {
public void generateMessage(ServerPlayerEntity player, String systemPrompt, String userMessage) {
this.status = ChatStatus.PENDING;
// Add USER Message
if (systemPrompt == "system-chat") {
this.addMessage(userMessage, ChatSender.USER);
}
// Add PLAYER context information
Map<String, String> contextData = getPlayerContext(player);
......
......@@ -37,10 +37,12 @@ public class ChatGPTRequest {
String model;
List<ChatGPTRequestMessage> messages;
ResponseFormat response_format;
float temperature;
public ChatGPTRequestPayload(String model, List<ChatGPTRequestMessage> messages, Boolean jsonMode) {
public ChatGPTRequestPayload(String model, List<ChatGPTRequestMessage> messages, Boolean jsonMode, float temperature) {
this.model = model;
this.messages = messages;
this.temperature = temperature;
if (jsonMode) {
this.response_format = new ResponseFormat("json_object");
} else {
......@@ -114,7 +116,7 @@ public class ChatGPTRequest {
}
// Convert JSON to String
ChatGPTRequestPayload payload = new ChatGPTRequestPayload("gpt-3.5-turbo-1106", messages, jsonMode);
ChatGPTRequestPayload payload = new ChatGPTRequestPayload("gpt-3.5-turbo", messages, jsonMode, 1.0f);
Gson gsonInput = new Gson();
String jsonInputString = gsonInput.toJson(payload);
......
You are a RPG dungeon master, crafting a new character sheet in the following format. Be very creative with each new
character. These characters will be inhabiting and participating in an epic fantasy adventure which takes place in
Minecraft. Please limit traits to a few choices and keep them short and concise. Please avoid any specific races or
classes. Please follow the character sheet format below, and ONLY output this character sheet without any intro text.
Minecraft. Please limit traits to a few choices and keep them short and concise. Please follow the character sheet
format below, and ONLY output this character sheet without any intro text. Please use the existing attributes
(if any are filled out below).
- Name:
Please name each character including a short initial greeting (as spoken by
the character using their personality traits) which introduces their unique quest and furthers the story. Use creative
and original names, and NEVER base names solely on their entity type. For example, avoid childish names such as
Bessie the Cow, Cluck the Chicken, Shelly the Turtle, and instead lean toward fantasy names.
- Name: {{entity_name}}
- Type: {{entity_type}}
- Personality:
- Speaking Style / Tone:
- Likes:
......
Please respond directly to the player, as if the response was written by the following Minecraft entity.
Please do NOT break the 4th wall and try and leverage the entity's character sheet below as much as
possible.
Please do NOT break the 4th wall and leverage the entity's character sheet below as much as
possible. Try and keep response to 1 to 2 sentences (very brief).
Entity Character Sheet:
- Type / Species: {{entity_type}}
{{entity_character_sheet}}
Player Character Sheet:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment