Skip to content

Commit 48c4a9a

Browse files
committed
removing erroneous json preprompt from dialogue
making all inherit from LivingNpc, for now
1 parent e1f8960 commit 48c4a9a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

llm_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ MEMORY_SIZE: 512
1212
PRE_PROMPT: 'Below is an instruction that describes a task, paired with an input that provides further context. As an game keeper for an RPG, write a response that appropriately completes the request.\n\n'
1313
BASE_PROMPT: "[Story context: {story_context}]; [History: {history}]; ### Instruction: Rewrite the following Text in your own words using the supplied Context and History to create a background for your text. Use about {max_words} words. [Text:{input_text}] \n\nEnd of text.\n\n ### Instruction: Rewrite [Text] in your own words. ### Response:\n"
1414
ACTION_PROMPT: "[Story context: {story_context}]; [History: {history}]; ### Instruction: Rewrite the Action, and nothing else, in your own words using the supplied Context and Location. History is what happened before. Use less than {max_words} words. [Text: {input_text}] \n\nEnd of text.\n\n### Response:\n"
15-
DIALOGUE_PROMPT: '[Story context: {story_context}]; [Location: {location}]; The following is a conversation between {character1} and {character2}; {character1}:{character1_description}; character2:{character2_description}; [Chat history: {previous_conversation}]\n\n [{character2}s sentiment towards {character1}: {sentiment}]. ### Instruction: Write a single response for {character2} in third person pov, using {character2} description. Respond in plain text. \n\n### Response:\n'
15+
DIALOGUE_PROMPT: '[Story context: {story_context}]; [Location: {location}]; The following is a conversation between {character1} and {character2}; {character1}:{character1_description}; character2:{character2_description}; [Chat history: {previous_conversation}]\n\n [{character2}s sentiment towards {character1}: {sentiment}]. ### Instruction: Write a single response for {character2} in third person pov, using {character2} description. \n\n### Response:\n'
1616
ITEM_PROMPT: 'Items:[{items}];Characters:[{character1},{character2}] \n\n ### Instruction: Decide if an item was explicitly given, taken, dropped or put somewhere in the following text:[Text:{text}]. Insert your thoughts about whether an item was explicitly given, taken, put somewhere or dropped in "my thoughts", and the results in "item", "from" and "to", or make them empty if . Insert {character1}s sentiment towards {character2} in a single word in "sentiment assessment". Fill in the following JSON template: {{ "thoughts":"my thoughts", "result": {{ "item":"", "from":"", "to":""}}, {{"sentiment":"sentiment assessment"}} }} End of example. \n\n Write your response in valid JSON\n\n### Response:\n'
1717
COMBAT_PROMPT: 'Rewrite the following combat between user {attacker} using {attacker_weapon}, and {victim} using {victim_weapon} in {location}, {location_description} into a vivid description in less than 300 words. ### Instruction: Rewrite the following combat result in about 150 words, using the characters weapons . Combat Result: {attacker_msg} ### Response:\n\n'
1818
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.\n\n'

tale/llm/character.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
class Character():
1717

1818
def __init__(self, backend: str, io_util: IoUtil, default_body: dict):
19-
self.pre_prompt = llm_config.params['PRE_JSON_PROMPT']
19+
self.pre_prompt = llm_config.params['PRE_PROMPT']
2020
self.dialogue_prompt = llm_config.params['DIALOGUE_PROMPT']
2121
self.character_prompt = llm_config.params['CREATE_CHARACTER_PROMPT']
2222
self.item_prompt = llm_config.params['ITEM_PROMPT']

tale/npc_defs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ def do_idle_action(self, ctx: Context) -> None:
2222
if player_in_location:
2323
self.idle_action()
2424

25-
class StationaryMob(Living):
25+
class StationaryMob(LivingNpc):
2626

2727
def __init__(self, name: str, gender: str, *,
2828
title: str="", descr: str="", short_descr: str="", race: str=""):
2929
super(StationaryMob, self).__init__(name=name, gender=gender,
30-
title=title, descr=descr, short_descr=short_descr, race=race)
30+
title=title, descr=descr, short_descr=short_descr, race=race, age=0, personality='', occupation='')
3131

3232
@call_periodically(15, 60)
3333
def do_idle_action(self, ctx: Context) -> None:

0 commit comments

Comments
 (0)