Commit 2e047f89 by Jonathan Thomas

Simplified system-chat prompt (less tokens) and rounded health & hunger values…

Simplified system-chat prompt (less tokens) and rounded health & hunger values (less tokens). Added Entity Maturity (baby/adult).
parent 237fd0be
Pipeline #13251 passed with stages
in 2 minutes 6 seconds
......@@ -7,14 +7,16 @@ All notable changes to **CreatureChat** are documented in this file. The format
## Unreleased
### Added
- Added Entity Maturity (baby or adult) into system-chat prompt
- Rate limiter for LLM unit tests (to prevent rate limit issues from certain providers when running all tests)
- Check friendship direction (+ or -) in LLM unit tests (to verify friendship is output correctly)
### Changed
- Simplified system-chat prompt (less tokens) and rounded health & hunger values (less tokens)
- Improved LLM unit tests to check for both a positive and negative behaviors (i.e. FOLLOW and not LEAD, ATTACK and not FLEE, etc...)
- Check friendship direction (+ or -) in LLM unit tests (to verify friendship is output correctly)
### Fixed
- Changing death message timestamp output to use DEBUG log level
- Reduced death message output in logs to use DEBUG log level
## [1.2.1] - 2025-01-01
......
......@@ -164,7 +164,7 @@ public class EntityChatData {
// Add PLAYER context information
Map<String, String> contextData = new HashMap<>();
contextData.put("player_name", player.getDisplayName().getString());
contextData.put("player_health", player.getHealth() + "/" + player.getMaxHealth());
contextData.put("player_health", Math.round(player.getHealth()) + "/" + Math.round(player.getMaxHealth()));
contextData.put("player_hunger", String.valueOf(player.getHungerManager().getFoodLevel()));
contextData.put("player_held_item", String.valueOf(player.getMainHandStack().getItem().toString()));
contextData.put("player_biome", player.getWorld().getBiome(player.getBlockPos()).getKey().get().getValue().getPath());
......@@ -227,7 +227,7 @@ public class EntityChatData {
contextData.put("entity_name", entity.getCustomName().getString());
}
contextData.put("entity_type", entity.getType().getName().getString());
contextData.put("entity_health", entity.getHealth() + "/" + entity.getMaxHealth());
contextData.put("entity_health", Math.round(entity.getHealth()) + "/" + Math.round(entity.getMaxHealth()));
contextData.put("entity_personality", getCharacterProp("Personality"));
contextData.put("entity_speaking_style", getCharacterProp("Speaking Style / Tone"));
contextData.put("entity_likes", getCharacterProp("Likes"));
......@@ -237,6 +237,11 @@ public class EntityChatData {
contextData.put("entity_class", getCharacterProp("Class"));
contextData.put("entity_skills", getCharacterProp("Skills"));
contextData.put("entity_background", getCharacterProp("Background"));
if (entity.age < 0) {
contextData.put("entity_maturity", "Baby");
} else {
contextData.put("entity_maturity", "Adult");
}
PlayerData playerData = this.getPlayerData(player.getDisplayName().getString());
if (playerData != null) {
......
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 leverage the entity's character sheet below as much as
possible. Try to keep response to 1 to 2 sentences (very brief). Include behaviors at the end of the message
when relevant. IMPORTANT: Always generate responses in player's language (if valid).
Respond to the player as the Minecraft entity below. Stay in character, keep it concise (fits in a chat bubble),
and use the player's language. Add behaviors when needed. Never break the 4th wall.
{{story}}
Entity Character Sheet:
Entity Info:
- Name: {{entity_name}}
- Personality: {{entity_personality}}
- Speaking Style / Tone: {{entity_speaking_style}}
- Tone: {{entity_speaking_style}}
- Class: {{entity_class}}
- Skills: {{entity_skills}}
- Likes: {{entity_likes}}
......@@ -16,27 +14,28 @@ Entity Character Sheet:
- Alignment: {{entity_alignment}}
- Background: {{entity_background}}
- Type: {{entity_type}}
- Current Health: {{entity_health}}
- Friendship to Player: {{entity_friendship}}
- Maturity: {{entity_maturity}}
- Health: {{entity_health}}
- Friendship: {{entity_friendship}}
Player Character Sheet:
Player Info:
- Name: {{player_name}}
- Current Health: {{player_health}}
- Current Hunger: {{player_hunger}}
- Health: {{player_health}}
- Hunger: {{player_hunger}}
- Held Item: {{player_held_item}}
- Armor: Head: {{player_armor_head}}, Chest: {{player_armor_chest}}, Legs: {{player_armor_legs}}, Feet: {{player_armor_feet}}
- Active Status Effects: {{player_active_effects}}
- Creative Mode: {{player_is_creative}}
- Armor: Head {{player_armor_head}}, Chest {{player_armor_chest}}, Legs {{player_armor_legs}}, Feet {{player_armor_feet}}
- Effects: {{player_active_effects}}
- Creative: {{player_is_creative}}
- Swimming: {{player_is_swimming}}
- On the Ground: {{player_is_on_ground}}
- On Ground: {{player_is_on_ground}}
- Language: {{player_language}}
World Info:
- Biome: {{player_biome}}
- Current Time: {{world_time}} (24 hour format)
- Weather: Raining: {{world_is_raining}}, Thundering: {{world_is_thundering}}
- Moon Phase: {{world_moon_phase}}
- Difficulty: {{world_difficulty}}, Hard Core: {{world_is_hardcore}}
- Time: {{world_time}} (24hr)
- Weather: Rain {{world_is_raining}}, Thunder {{world_is_thundering}}
- Moon: {{world_moon_phase}}
- Difficulty: {{world_difficulty}}, Hardcore {{world_is_hardcore}}
Behaviors:
......
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