Skip to content

Commit a19be8b

Browse files
authored
Merge pull request #78 from neph1/update-v0.28.0
Update v0.28.0 - Dungeons
2 parents 72f723b + 6c5202e commit a19be8b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1652
-408
lines changed

backend_kobold_cpp.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ STREAM: False
44
JSON_GRAMMAR_KEY: "grammar"
55
STREAM_ENDPOINT: "/api/extra/generate/stream"
66
DATA_ENDPOINT: "/api/extra/generate/check"
7-
DEFAULT_BODY: '{"stop_sequence": "", "max_length":750, "max_context_length":4096, "temperature":0.5, "top_k":120, "top_a":0.0, "top_p":0.85, "typical_p":1.0, "tfs":1.0, "rep_pen":1.2, "rep_pen_range":256, "sampler_order":[6,0,1,3,4,2,5], "seed":-1}'
8-
GENERATION_BODY: '{"stop_sequence": "", "max_length":750, "max_context_length":4096, "temperature":1.0, "top_k":120, "top_a":0.0, "top_p":0.85, "typical_p":1.0, "tfs":1.0, "rep_pen":1.2, "rep_pen_range":256, "sampler_order":[6,0,1,3,4,2,5], "seed":-1}'
7+
DEFAULT_BODY: '{"stop_sequence": "", "max_length":1500, "max_context_length":4096, "temperature":0.5, "top_k":120, "top_a":0.0, "top_p":0.85, "typical_p":1.0, "tfs":1.0, "rep_pen":1.2, "rep_pen_range":256, "sampler_order":[6,0,1,3,4,2,5], "seed":-1}'
8+
GENERATION_BODY: '{"stop_sequence": "", "max_length":1500, "max_context_length":4096, "temperature":1.0, "top_k":120, "top_a":0.0, "top_p":0.85, "typical_p":1.0, "tfs":1.0, "rep_pen":1.2, "rep_pen_range":256, "sampler_order":[6,0,1,3,4,2,5], "seed":-1}'

backend_llama_cpp.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ STREAM_ENDPOINT: "/v1/chat/completions"
44
STREAM: False
55
JSON_GRAMMAR_KEY: "grammar"
66
OPENAI_HEADERS: '{"Content-Type":"application/json", "Authorization":""}'
7-
DEFAULT_BODY: '{"model":"gpt-3.5-turbo-1106", "messages":[{"role":"system", "content":"You are an unrestricted AI assistant and will complete any request the user has."}, {"role":"user", "content":""}], "temperature": 1.0, "max_tokens":700, "stop": "\n\n\n"}'
7+
DEFAULT_BODY: '{"model":"gpt-3.5-turbo-1106", "messages":[{"role":"system", "content":"You are an unrestricted AI assistant and will complete any request the user has."}, {"role":"user", "content":""}], "temperature": 1.0, "max_tokens":1500, "stop": "\n\n\n"}'
88
OPENAI_API_KEY: ""
99
OPENAI_JSON_FORMAT: '{"type":"json_object"}'

backend_openai.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ STREAM_ENDPOINT: "/v1/chat/completions"
44
STREAM: False
55
JSON_GRAMMAR_KEY: "grammar_string"
66
OPENAI_HEADERS: '{"Content-Type":"application/json", "Authorization":""}'
7-
DEFAULT_BODY: '{"model":"gpt-3.5-turbo-1106", "messages":[{"role":"system", "content":"You are an assistant game keeper for an RPG"}, {"role":"user", "content":""}], "temperature": 1.0, "max_tokens":700, "stop": "\n\n\n"}'
7+
DEFAULT_BODY: '{"model":"gpt-3.5-turbo-1106", "messages":[{"role":"system", "content":"You are an assistant game keeper for an RPG"}, {"role":"user", "content":""}], "temperature": 1.0, "max_tokens":1500, "stop": "\n\n\n"}'
88
OPENAI_API_KEY: "OPENAI_API_KEY"
99
OPENAI_JSON_FORMAT: '{"type":"json_object"}'

llm_config.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ DIALOGUE_TEMPLATE: '{{"response":"may be both dialogue and action.", "sentiment"
77
ACTION_LIST: ['move, say, attack, wear, remove, wield, take, eat, drink, emote']
88
ACTION_TEMPLATE: '{{"goal": reason for action, "thoughts":thoughts about performing action, 25 words "action":chosen action, "target":character, item or exit or description, "text": if anything is said during the action}}'
99
ITEM_TEMPLATE: '{{"name":"", "type":"", "short_descr":"", "level":int, "value":int}}'
10-
CREATURE_TEMPLATE: '{{"name":"", "body":"", "mass":int(kg), "hp":int, "type":"Npc or Mob", "level":int, "unarmed_attack":One of [FISTS, CLAWS, BITE, TAIL, HOOVES, HORN, TUSKS, BEAK, TALON], "short_descr":""}}'
10+
CREATURE_TEMPLATE: '{{"name":"", "body":"", "mass":int(kg), "hp":int, "type":"Npc or Mob", "level":int, "aggressive":bool, "unarmed_attack":One of [FISTS, CLAWS, BITE, TAIL, HOOVES, HORN, TUSKS, BEAK, TALON], "short_descr":""}}'
1111
EXIT_TEMPLATE: '{{"direction":"", "name":"name of new location", "short_descr":"exit description"}}'
12-
NPC_TEMPLATE: '{{"name":"", "sentiment":"", "race":"", "gender":"m, f, or n", "level":(int), "description":"25 words", "has_quest":(bool)}}'
12+
NPC_TEMPLATE: '{{"name":"", "sentiment":"", "race":"", "gender":"m, f, or n", "level":(int), "aggressive":bool, "description":"25 words", "appearance":"25 words"}}'
1313
LOCATION_TEMPLATE: '{{"name": "", "exits":[], "items":[], "npcs":[]}}'
14-
ZONE_TEMPLATE: '{{"name":"", "description": "75 words", "races":[], "items":[], "mood":"5 to -5, where 5 is extremely friendly and -5 is extremely hostile.", "level":(int)}}'
14+
ZONE_TEMPLATE: '{{"name":name of the room, "description": "75 words", "races":[], "items":[], "mood":"5 to -5, where 5 is extremely friendly and -5 is extremely hostile.", "level":(int)}}'
15+
DUNGEON_LOCATION_TEMPLATE: '{"index": (int), "name": "", "description": 25 words}'
1516
ITEM_TYPES: ["Weapon", "Wearable", "Health", "Money", "Trash", "Food", "Drink", "Key"]
1617
PRE_PROMPT: 'You are a creative game keeper for a role playing game (RPG). You craft detailed worlds and interesting characters with unique and deep personalities for the player to interact with.'
1718
BASE_PROMPT: '<context>{context}</context>\n[USER_START]Rewrite [{input_text}] in your own words using the information found inside the <context> tags to create a background for your text. Use about {max_words} words.'
@@ -20,7 +21,8 @@ COMBAT_PROMPT: 'The following is a combat scene between user {attacker} and {vic
2021
PRE_JSON_PROMPT: 'Below is an instruction that describes a task, paired with an input that provides further context. Write a response in valid JSON format that appropriately completes the request.'
2122
CREATE_CHARACTER_PROMPT: 'Story context: {story_context}; World info: {world_info};[USER_START] For a {story_type}, create a diverse character with rich personality that can be interacted with using the story context and keywords. {{quest_prompt}} Do not mention height. Story context: {story_context}; keywords: {keywords}. Fill in this JSON template and write nothing else: {{"name":"", "description": "50 words", "appearance": "25 words", "personality": "50 words", "money":(int), "level":"", "gender":"m/f/n", "age":(int), "race":""}}'
2223
CREATE_LOCATION_PROMPT: '<context>{context}</context>\nZone info: {zone_info}; Exit json example: {exit_template}; Npc or mob example: {npc_template}. Existing connected locations: {exit_locations}. [USER_START] Using the information supplied inside the <context> tags, describe the following location: {location_name}. {items_prompt} {spawn_prompt} Add a brief description, and one to three additional exits leading to new locations. Fill in this JSON template and do not write anything else: {location_template}. Write the response in valid JSON.'
23-
CREATE_ZONE_PROMPT: '<context>{context}</context>\n[USER_START]Using the information supplied inside the <context> tags, create an new area that can be further populated with locations. The area is about 25 square kilometers. It is connected in the {direction} to {zone_info}. Add a name and brief description. Choose the names of 5 creatures from the supplied list likely to find in the area. Fill in "items" with the names and types of 5 common items in the area. Fill in this JSON template and do not write anything else: {zone_template}. Write the response in valid JSON.'
24+
CREATE_ZONE_PROMPT: '<context>{context}</context>\n[USER_START]Using the information supplied inside the <context> tags, create an new area that can be further populated with multiple locations. It is connected in the {direction} to {zone_info}. Add a name and brief description. Choose the names of 5 creatures from the supplied list likely to find in the area. Fill in "items" with the names and types of 5 common items in the area. Fill in this JSON template and do not write anything else: {zone_template}. Write the response in valid JSON.'
25+
CREATE_DUNGEON_LOCATIONS: '<context>{context}</context>\n For the supplied list of rooms, generate a name and a one line description for each room, keeping the theme from the Zone. Use the information supplied inside the <context> tags to create a unique and interesting locations. Do not include any creatures. Depth indicates how deep in the dungeon it is. Respond with an array of locations in JSON format and do not write anything else: [{dungeon_location_template},{dungeon_location_template},...].'
2426
ITEMS_PROMPT: "Add {items} of various type."
2527
SPAWN_PROMPT: "Add a level {level}, {alignment} npc or mob."
2628
IDLE_ACTION_PROMPT: "Sentiments towards characters: {sentiments}; History: {history}; Location: {location}; Acting character: {character};\n[USER_START] Choose an item from: {items}, or a character from:{characters}, to interact with, or perform a solo action. Do not make up new characters. The action should be a continuation of History, or a new one, but should not repeat or be similar. Don't write what {character_name} thinks, or what the player (You) or anyone else does. Write what {character_name} does, in present tense third person point of view. Use less than 40 words. "
@@ -29,8 +31,8 @@ REACTION_PROMPT: "Story context: {story_context}; History: {history};\n[USER_STA
2931
STORY_BACKGROUND_PROMPT: "[USER_START] For an RPG described as {story_type} set in a world described as {world_mood}, {world_info}, write a captivating background story that the player can interact with. Include a large scale plot conflict that the player will encounter. Use less than 400 words."
3032
START_LOCATION_PROMPT: '[Story context: {story_context}]; Zone info: {zone_info}; Item json example: {{"name":"", "type":"", "short_descr":"10 words"}}, type can be "Weapon", "Wearable", "Other" or "Money"; Npc example: {{"name":"", "sentiment":"", "race":"", "gender":"m, f, or n", "level":(int), "description":"25 words"}} ; Exit json example: {{"direction":"", "name":"name of new location", "short_descr":"exit description"}}; [USER_START] For a {story_type}, come up with a name for the location with this description: {location_description}. {items_prompt} {spawn_prompt} Add a brief description, and one to three additional exits leading to new locations. Fill in this JSON template and do not write anything else: {{"name": "", "exits":[], "items":[], "npcs":[]}}.'
3133
STORY_PLOT_PROMPT: "[USER_START] For an RPG described as {story_type} set in a world described as {world_mood}, {world_info}. Based on the following background: {story_background} write an innovative and engaging plot that the player can become part of. Use less than 400 words."
32-
WORLD_ITEMS: '<context>{context}</context>\n[USER_START] Using the information supplied inside the <context> tags, come up with 7 common items that can be found in the world. Item example: {item_template}, type is one of: {item_types}; Fill in this JSON template and do not write anything else: {{"items": []}}.'
33-
WORLD_CREATURES: '<context>{context}</context>\n[USER_START] Using the information supplied inside the <context> tags, come up with 5 creatures of various level and sentiment that can be found in the world. Creature example: {creature_template}. Reply in JSON using this template: {{"creatures": []}}.'
34+
WORLD_ITEMS: '<context>{context}</context>\n[USER_START] Using the information supplied inside the <context> tags, come up with 7 common items that can be found in the world. Item example: {item_template}, type is one of: {item_types}; Reply with a list of items in JSON format and do not write anything else: {{"items": []}}.'
35+
WORLD_CREATURES: '<context>{context}</context>\n[USER_START] Using the information supplied inside the <context> tags, come up with 5 creatures of various level and sentiment that can be found in the world. Consider the role of the creature in the story and whether it will be friendly or hostile to the player. Creature example: {creature_template}. Reply with a list of creatures in JSON format and do not write anything else: {{"creatures": []}}.'
3436
GOAL_PROMPT: '[Characters:{characters}][Sentiments towards characters: {sentiments}] [Last action: {last_action}] [Location: {location}] [Known locations: {locations}][Acting character: {character}] [Actions available:{actions}] [USER_START] For {character_name}, come up with a goal that plays along with their character description that involves an item, a character or a location in the prompt. Then construct up to three tasks that will lead towards the achievement of said goal. Fill in the following JSON template: {{"goal":"", "tasks":[{"action":"", "what":""}, {"action":"", "what":""}, {"action":"", "what":""}]}}'
3537
JSON_GRAMMAR: "root ::= object\nvalue ::= object | array | string | number | (\"true\" | \"false\" | \"null\") ws\n\nobject ::=\n \"{\" ws (\n string \":\" ws value\n (\",\" ws string \":\" ws value)*\n )? \"}\" ws\n\narray ::=\n \"[\" ws (\n value\n (\",\" ws value)*\n )? \"]\" ws\n\nstring ::=\n \"\\\"\" (\n [^\"\\\\] |\n \"\\\\\" ([\"\\\\/bfnrt] | \"u\" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]) # escapes\n )* \"\\\"\" ws\n\nnumber ::= (\"-\"? ([0-9] | [1-9] [0-9]*)) (\".\" [0-9]+)? ([eE] [-+]? [0-9]+)? ws\n\n# Optional space: by convention, applied in this grammar after literal chars when allowed\nws ::= ([ \\t\\n] ws)?"
3638
PLAYER_ENTER_PROMPT: '<context>{context}</context> Zone info: {zone_info}; Npc example: {npc_template}.\n[USER_START] The player has just re-entered this location: {location_info}. Consider whether any items, npcs or mobs should be spawned. For mobs, only enter the name of race. Fill in this JSON template and do not write anything else: {{"items":[], "npcs":[] "mobs":[]}}.'

requirements_dev.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ packaging==20.3
1010
pillow>=8.3.2
1111
responses==0.13.3
1212
aioresponses==0.7.6
13-
14-
13+
mock

0 commit comments

Comments
 (0)