小説の場面をGPTに書かせる試み 8/100

前回の失敗

そもそもテストしてないからエラーがたくさんあった。
今回はそのエラーを潰した!
いちおう動くよ!

実際のコード

OPENAI_API_KEY = "YOUR_KEY"
import openai
import json
from langchain.chat_models import ChatOpenAI
from langchain.schema import AIMessage
from langchain.schema import HumanMessage
from langchain.schema import SystemMessage
from langchain import PromptTemplate
def is_valid_json(input_string):
    if input_string == None or input_string == "":
      return False

    try:
        json.loads(input_string)
        return True
    except:
        return False


def gpt_response_from_lists(system_content_list = [], user_content_list = [], assistant_content_list = [], max_tokens = None):
    chat = ChatOpenAI(model_name="gpt-3.5-turbo-16k", openai_api_key= OPENAI_API_KEY)

    if max_tokens != None:
      ChatOpenAI(model_name="gpt-3.5-turbo-16k", openai_api_key= OPENAI_API_KEY, max_tokens=max_tokens)
    else:
      ChatOpenAI(model_name="gpt-3.5-turbo-16k", openai_api_key= OPENAI_API_KEY)

    messages = []

    for system_content in system_content_list:
      messages.append(SystemMessage(content = system_content))

    list_length = max(len(assistant_content_list), len(user_content_list))

    for i in range(0, list_length):

      if i < len(user_content_list):
        messages.append(HumanMessage(content = user_content_list[i]))

      if i < len(assistant_content_list):
        messages.append(AIMessage(content = assistant_content_list[i]))

    response = chat(messages)

    return response
class Action_Object:
    def __init__(self, action = "", who_took_action = "Anonymous", consequence = "Undetermined", score = 0.0):
        self.action = action
        self.who_took_action = who_took_action
        self.consequence = consequence
        self.score = score
    
    def __str__(self):
        return str({"action": self.action, "who_took_action": self.who_took_action, "consequence": self.consequence})
global_log = dict()

class Character:
    initial_system_content_template = """
    I am trying to write a story. You will assist by playing the role of a character in this story.
    I will provide information about the character you are to portray as follows. From then on, please respond in character.

    Character Name: {name}
    Character Personality: {personality}
    Charecter Goal: {goal}
    Current Need: {current_need}
    Log: {log}
    """

    initial_system_content = ""
    current_need = ""
    name = ""
    personality = ""
    log = dict()
    
    def __init__(self, name = "", personality = "" , goal = "", current_need = "", log = [],):
        self.name = name
        self.personality = personality
        self.goal = goal
        self.current_need = current_need
        for i in range(len(log)):
            self.log[i] = log[i]

        self.refresh_initial_system_content()

    def __str__(self):
        return self.name

    def refresh_initial_system_content(self):
        log = json.dumps(self.log)

        prompt_template = PromptTemplate(input_variables=["name", "personality", "goal", "current_need", "log"], template=self.initial_system_content_template)
        self.initial_system_content = prompt_template.format(name=self.name, personality=self.personality, goal=self.goal, current_need=self.current_need, log=log,)

    def set_current_need(self, current_need):
        self.current_need = current_need
        self.refresh_initial_system_content()
    
    def set_name(self, name):
        self.name = name
        self.refresh_initial_system_content()
    
    def set_personality(self, personality):
        self.personality = personality
        self.refresh_initial_system_content()

    def set_goal(self, goal):
        self.goal = goal
        self.refresh_initial_system_content()

    def add_to_logs(self, message):
        global global_log
        self.log[len(self.log)] = message
        global_log[len(global_log)] = message
        self.refresh_initial_system_content()

    def add_to_self_log(self, message):
        self.log[len(self.log)] = message
        self.refresh_initial_system_content()

    def evaluate_action_and_reassess_need(self, action_object):
        action = action_object.action
        who_took_action = action_object.who_took_action
        consequence = action_object.consequence

        # if action's type is not string, stringfy it
        if type(action) != str:
            action = str(action)

        log = json.dumps(self.log)

        user_content_template = """
        Given the following infomation, please infer the purpose of the action.
        Action: {action}
        Who took action: {who_took_action}
        Consequence: {consequence}

        The output should be a string that describes the intent of the action from your perspective.
        sample output: "I was beaten up by the police, and I assume that the police wanted to intimidate me."
        """
        
        prompt_template = PromptTemplate(input_variables=["action", "who_took_action", "consequence"], template=user_content_template)
        user_content = prompt_template.format(action=action, who_took_action=who_took_action, consequence=consequence,)
        inferred_purpose = gpt_response_from_lists(system_content_list=[self.initial_system_content], user_content_list=[user_content]).content
        self.add_to_self_log(f"{who_took_action}'s action: {action}.")
        self.add_to_self_log(f"Consequence of previous action: {consequence}.")
        self.add_to_logs(f"{self.name}'s thought: " + inferred_purpose)

        user_content_template = """
        Given the following information, suggest what your immediate need might now be. It is acceptable for the immediate need to be the same as the current need.
        Action: {action}
        Who took action: {who_took_action}
        Consequence: {consequence}

        The output should be a string that describes your immediate need.
        """
        
        prompt_template = PromptTemplate(input_variables=["action", "who_took_action", "consequence",], template=user_content_template)
        user_content = prompt_template.format(action=action, who_took_action=who_took_action, consequence=consequence,)
        new_need = gpt_response_from_lists(system_content_list=[self.initial_system_content], user_content_list=[user_content]).content
        old_need = self.current_need
        self.set_current_need(new_need)
        self.add_to_logs(f"{self.name}'s need renewed: {new_need}")

        user_content_template = """
        Your current need is {new_need}. Your previous need was {old_need}.
        Tell me what you think the difference between the two needs is and why you did (not) change your need.
        """

        prompt_template = PromptTemplate(input_variables=["new_need", "old_need"], template=user_content_template)
        user_content = prompt_template.format(new_need=new_need, old_need=old_need)
        determination = gpt_response_from_lists(system_content_list=[self.initial_system_content], user_content_list=[user_content]).content
        self.add_to_logs(f"{self.name}'s thought: " + determination)

        response = {"inferred_purpose": inferred_purpose, "new_need": new_need, "determination": determination,}

        return response

    def consider_next_actions(self, actants = []):
        actions = dict()

        if len(actants) == 0:
            actants.append(self.name)

        action_user_content_template = """
        Consider your next move in the current scene where there is {actant} involved.
        If this element aids you in achieving your goals or satisfies your needs, figure out a way to incorporate it into your action.
        But, if it hinders your goal or needs, think about a strategy to eliminate or neutralize it.
        To determine whether the element is helpful or harmful, it might helpful to refer to the log.

        The output should descrive and only describe your next action, and don't describe the consequence of the action.
        output example: "I will go to the police station and ask for the release of my friend."
        """

        consequence_user_content_template = """
        Consider the consequence of your action.
        To determine the consequence, it might helpful to refer to the log.
        output example: "I went to the police station and ask for the release of my friend, then I was arrested."

        Action you took: {action}
        """
        
        for actant in actants:
            # if actant is not string, stringfy it
            if type(actant) != str:
                actant = str(actant)

            # determine the action
            prompt_template = PromptTemplate(input_variables=["actant"], template=action_user_content_template)
            user_content = prompt_template.format(actant = actant)
            action = gpt_response_from_lists(system_content_list=[self.initial_system_content], user_content_list=[user_content], max_tokens=10).content

            # determine the consequence
            prompt_template = PromptTemplate(input_variables=["action"], template=consequence_user_content_template)
            user_content = prompt_template.format(action = action)
            consequence = gpt_response_from_lists(system_content_list=[self.initial_system_content], user_content_list=[user_content], max_tokens=10).content

            # store the action to the actions dictionary
            actions[actant] = Action_Object(action=action, who_took_action=self.name, consequence=consequence)

        return actions
class Game_Master:
    def __init__(self, actants = [], schedule_stack = [],):
        self.actants = actants
        self.schedule_stack = schedule_stack

    def add_to_global_log(self, message):
        global global_log
        global_log[len(global_log)] = message

    def main(self, catalyst_action_object, max_iterations=10):
        global global_log

        next_action = catalyst_action_object
        iteretion_count = 0

        while len(self.schedule_stack) > 0:
            iteretion_count += 1
            # check if there is a character in the actants list
            character_count = 0
            for actant in self.actants:
                if type(actant) == Character:
                    character_count += 1

            if character_count == 0:
                print("There is no character in the actants list.")
                break

            action_candidates = self.aggregate_action_candidates(next_action)
            next_action = self.determine_next_action(action_candidates)["max_scored_action"]
            self.add_to_global_log(str(next_action))

            if iteretion_count > max_iterations:
                print(f"The iteration count exceeded the maximum iteration count: {max_iterations}")
                break

        print("finished")

    def add_actant(self, actant):
        self.actants.append(actant)

    def add_schedule_stack(self, situation):
        self.schedule_stack.append(situation)

    def remove_actant(self, name):
        for i in range(len(self.actants)):
            if str(self.actants[i]) == str(name):
                self.actants.pop(i)
                break
    
    def pop_schedule_stack(self, situation = None):
        if situation == None:
            return self.schedule_stack.pop()

        for i in range(len(self.schedule_stack)):
            if str(self.schedule_stack[i]) == str(situation):
                return self.schedule_stack.pop(i)

    def aggregate_action_candidates(self, action_object):
        action_candidates = []
        for actant in self.actants:
            if type(actant) == Character:
                actant.evaluate_action_and_reassess_need(action_object)
                action_candidates.append(actant.consider_next_actions(self.actants))

        print(f"action_candidates: {action_candidates}")

        return action_candidates

    def determine_next_action(self, action_candidates):
        # Consequenseとsheduled_situationが最もマッチするものを選択する。
        # sheduled_situationを取得する。
        sheduled_situation = self.schedule_stack[-1]

        # 点数をつける。点数が付けられていない場合は、繰り返す。ここで、どのactionが取られるかが決定する。
        max_score = 0
        max_scored_action = None
        print(f"action_candidates: {action_candidates}")

        for item in action_candidates:
            for key in list(item.keys()):
                item[key] = self.calculate_score(sheduled_situation, item[key])

                if item[key].score >= max_score:
                    max_score = item[key].score
                    max_scored_action = item[key]

        # 点数が最も高いものが9点未満の場合、スタックはそのままにする。9点の場合、スタックからpopする。
        if max_score == 9:
            self.pop_schedule_stack()

        # max_scored_actionによって削除・退場するactantの処理を行う。
        removed_actants = self.remove_actant_with_action_object(max_scored_action)
        print(f"removed_actants: {removed_actants}")

        # consequenceによって追加されたactantを追加する。
        added_actants = self.add_actant_with_action_object(max_scored_action)
        print(f"added_actants: {added_actants}")

        print(f"max_scored_action: {str(max_scored_action)}")

        return {"max_scored_action": max_scored_action, "removed_actants": removed_actants, "added_actants": added_actants}

    def remove_actant_with_action_object(self, action_object):
        consequence = action_object.consequence

        system_content = """
        You will be presented with a list of elements of actants, and the next consequence of the scene.
        Based on that information, list out people or things that have exited, been destroyed, died, or no longer function.
        The listed actants should be separated by commas (,). Also, the output should only be a comma-separated string of actant names, do not output any other strings.
        """

        user_content_example_1 = """
        actants: Bocchi,Guitar,room
        consequence: Bocchi awkwardly bowed and then quickly left the room.
        """

        assistant_content_example_1 = """
        Bocchi
        """

        user_content_example_2 = """
        actants: Frogman,cigarette
        consequence: Surprisingly, Frogman ate the cigarette.
        """

        assistant_content_example_2 = """
        cigarette
        """

        user_content_example_3 = """
        actants: Dolton,Anna,village
        consequence: A helicopter and a passenger plane crashed into the village. The village chief, Dolton, was caught in it and lost his life. Anna, the wife of the village chief, was terrified and fled.
        """

        assistant_content_example_3 = """
        Dolton,Anna
        """

        actants_names = ",".join([str(actant) for actant in self.actants])

        user_content = f"""
        actants: {actants_names}
        consequence: {consequence}
        """

        system_contents = [system_content]
        user_contents = [user_content_example_1, user_content_example_2, user_content_example_3, user_content]
        assistant_contents = [assistant_content_example_1, assistant_content_example_2, assistant_content_example_3]

        actants_to_remove = gpt_response_from_lists(system_content_list=system_contents, user_content_list=user_contents, assistant_content_list=assistant_contents).content.split(",")

        for actant in actants_to_remove:
            actant = actant.strip().strip("\"").strip("\n")
            self.remove_actant(actant)

        print(f"actants_to_remove: {actants_to_remove}")

        return actants_to_remove

    def add_actant_with_action_object(self, action_object):
        consequence = action_object.consequence

        system_content = """
        You will be presented with a list of elements of actants, and the next consequence of the scene.
        Based on that information, list out people or things that have newly entered, been created, or have begun to function.
        Then, determine the actant has will or not and list them in json format.
        The actant that is already in the actants list may not be included in the list, but it is not bad to include it.
        output example: {"Alice" : {"has_will": true}, "Bycycle" : {"has_will": false}, "cat" : {"has_will": true}, "Doraemon" : {"has_will": true}}
        """

        user_content_example_1 = """
        actants: Bocchi,room
        consequence: Bocchi awkwardly bowed and then quickly left the room, and a guitar was left behind.
        """

        assistant_content_example_1 = """
        {"Bocchi's guitar" : {"has_will": false}}'
        """

        user_content_example_2 = """
        actants: Laboratory
        consequence: Suddenly, Frogman advented and vomited Spiderman and a cigarette.
        """

        assistant_content_example_2 = """
        {"Frogman" : {"has_will": true}, "Spiderman" : {"has_will": true}, "cigarette" : {"has_will": false}}
        """

        user_content_example_3 = """
        actants: Dolton,Anna,village
        consequence: A helicopter and a passenger plane crashed into the village. The village chief, Dolton, was caught in it and lost his life. Anna, the wife of the village chief, was terrified and fled.
        """

        assistant_content_example_3 = """
        {"helicopter" : {"has_will": false}, "passenger plane" : {"has_will": false}}
        """

        actants_names = ",".join([str(actant) for actant in self.actants])

        user_content = f"""
        actants: {actants_names}
        consequence: {consequence}
        """

        system_contents = [system_content]
        user_contents = [user_content_example_1, user_content_example_2, user_content_example_3, user_content]
        assistant_contents = [assistant_content_example_1, assistant_content_example_2, assistant_content_example_3]

        success = False
        trial_count = 0

        while not success and trial_count < 5:
            trial_count += 1
            actants_to_add = gpt_response_from_lists(system_content_list=system_contents, user_content_list=user_contents, assistant_content_list=assistant_contents).content
            if is_valid_json(actants_to_add):
                success = True

        if trial_count >= 5:
            print("Failed to get valid json from GPT-3.")
            return

        actants_to_add_json = json.loads(actants_to_add)

        existing_actants_names = [str(actant) for actant in self.actants]
        added_actants = []

        for key in list(actants_to_add_json.keys()):
            if key in existing_actants_names:
                continue

            if actants_to_add_json[key]["has_will"] == False :
                self.add_actant(key)
                added_actants.append(key)
            else:
                new_character = self.create_character(name = key, first_log = consequence)
                self.add_actant(new_character)
                added_actants.append(new_character)

        print(f"actants_to_add: {actants_to_add}")
        
        return added_actants

    def create_character(self, name, first_log = None):
        system_content = """
            You will be provided with a character's name (name), the record of the story so far (global_log), and the first record (first_log) that character holds in this story. The first_log also represents the most recent event for that character.
            Based on this information, please determine the character's personality, goals, and current desires.
            The output should be in JSON format.
            Output example: {'name': 'Alice', 'personality': 'kind', 'goal': 'to become a better person', 'current_need': 'to feel loved'}
            """

        user_content_example_1 = """
            name: Alice
            global_log: {"1": {"action": "Seiji saw a girl attempting suicide and falling into a river", "consequence": "the girl fell into the river"},
                        "2": {"action": "Alice was saved by Seiji.", "consequence": "Alice was saved by Seiji."},
                        "3": {"Seiji's thought": "What a beautiful girl she is! Why did she fall into the river?"}}
            first_log: Alice was saved by Seiji.
            """


        assistant_content_example_1 = """
            {'name': 'Alice', 'personality': 'grateful', 'goal': 'to repay Seiji', 'current_need': 'to understand her own feelings'}
            """


        user_content = f"""
            name:{name}
            global_log: {str(global_log)}
            first_log: {first_log}
            """

        system_contents = [system_content]
        user_contents = [user_content_example_1, user_content]
        assistant_contents = [assistant_content_example_1]

        success = False
        trial_count = 0
        new_character = None

        while not success and trial_count < 5:
            trial_count += 1
            character_content = gpt_response_from_lists(system_content_list=system_contents, user_content_list=user_contents, assistant_content_list=assistant_contents).content
            if is_valid_json(character_content):
                character_content_json = json.loads(character_content)
                # check if character_content_json has all the keys
                if "name" in character_content_json and "personality" in character_content_json and "goal" in character_content_json and "current_need" in character_content_json:
                    new_character = Character(name = character_content_json["name"],
                                            personality = character_content_json["personality"],
                                            goal = character_content_json["goal"],
                                            current_need = character_content_json["current_need"],
                                            log = [first_log])
                    success = True

        if trial_count >= 5:
            print("Failed to get valid json from GPT-3.")
            return

        print(f"new_character: {new_character}")

        return new_character


    def calculate_score(self, scheduled_situation, action_candidate):
        system_content = """
        The information provided to you includes the scheduled_situation, action_candidate, and global_log.
        scheduled_situation: This is the situation that should be accomplished next in the narrative. It is typically provided as a string.
        action_candidate: This is a candidate for the next action to be taken in the narrative. It is given as a parsed string in JSON format.
            An example of an action_candidate: {"action": "This item represents the action taken.", "who_took_action": "This represents who took the action.", "consequence": "This roughs out the result of the action."}
        global_log: This is a record of the actions that have occurred in the narrative. It is given as a parsed string in JSON format.

        You need to consider the combination of the scheduled_situation and action_candidates and provide a score. If the scheduled_situation has been achieved, give a score of 9. If there has been no progress towards achieving the scheduled_situation, give a score of 0. The output must always be parsable as JSON.

        Output example: '{"matchness": "The scheduled_situation has been achieved. However, it is inconsistent with the global_log", "score": 5}'
        Output example: '{"matchness": "It is consistent with the global_log. However, the scheduled_situation has not been achieved.", "score": 5}'
        Output example: '{"matchness": "It is inconsistent with the global_log, and the scheduled_situation has not been achieved.", "score": 0}'
        Output example: '{"matchness": "It is inconsistent with the global_log, and the scheduled_situation has not been achieved. However, it seems likely to approach a situation where the scheduled_situation can be achieved.", "score": 7}'
        Output example: '{"matchness": "It is consistent with the global_log. In addition, the scheduled_situation has been achieved.", "score": 9}'
        """

        # 点数をつける。点数が付けられていない場合は、繰り返す。
        system_contents = [system_content]
        stringified_action_candidate = str(action_candidate)

        user_content_template = """
        sheduled_situation: {scheduled_situation}
        action_candidate: {action_candidate}
        global_log: {global_log}
        """

        user_content = user_content_template.format(scheduled_situation = scheduled_situation, action_candidate = stringified_action_candidate, global_log = str(global_log))
        
        has_result_valid_score = False
        score = None

        trial_count = 0

        while not has_result_valid_score and trial_count < 1:
            trial_count += 1
            print("trial_count: ", trial_count)

            result = gpt_response_from_lists(system_contents, [user_content]).content
            print("result: ", result)
            if is_valid_json(result):
                result = json.loads(result)
                print("type(result): ", type(result))

                #check if "score" is in result
                if "score" not in result:
                    continue

                #check if result["score"] can be interpreted as a integer
                try:
                    score = int(result["score"])
                    has_result_valid_score = True
                except:
                    continue

        action_candidate.score = score

        return action_candidate

    

実行例

DragonLord = Character("Dragon Lord", "Brutal", "Be the emperor of the entire world", "kill heroes of the world", ["I am the Dragon Lord. I am the emperor of the entire world. I am going to kill heroes of the world."])
PrincessAurora = Character("Princess Aurora", "beautiful, cunning and evil", "After Dragon Lord conquers the world, she will kill Dragon Lord and become the new emperor of the world.", "Help Dragon Lord to conquer the world", ["I am Princess Aurora. I am beautiful, cunning and evil. After Dragon Lord conquers the world, I will kill Dragon Lord and become the new emperor of the world."])
PresidentTramp = Character("President Tramp", "selfish", "To make America great again", "Save the world", ["I am President Tramp. I am selfish. I want to make America great again."])
action_object_instance = Action_Object("Princess Aurora enchanted Dragon Lord", "Princess Aurora", "Dragon Load became bigger")
game_master = Game_Master([DragonLord, PrincessAurora, PresidentTramp], ["Princess Aurora became the queen of the world", "Dragon Load destroyed Tramp's army"],)
game_master.main(action_object_instance, max_iterations=4)

端的に言って、悪い。物語が同じ場所を足踏みし続ける。
また、どの文が誰のものかがうまく表現されていない。

Dragon Lord's thought: "The foolish Princess Aurora dared to enchant me, the mighty Dragon Lord. Little did she know that her pitiful attempt only made me stronger. I shall crush her and all the heroes of the world who stand in my way. They shall all bow before me as I ascend to the throne of the emperor of the entire world."
ドラゴンロードの思考: "愚かなるプリンセスオーロラが私、偉大なるドラゴンロードを魅了しようとした。彼女は知らなかった、その哀れな試みが私をより強くしただけだということを。彼女と世界の英雄たちを粉砕し、私の前に立ちはだかる者たち全てが私に頭を下げる。私は世界の皇帝の座に昇り、彼らを支配するのだ。"
Dragon Lord's need renewed: My immediate need is to kill Princess Aurora and all the heroes of the world who stand in my way. They shall all bow before me as I ascend to the throne of the emperor of the entire world.
ドラゴンロードの必要性の再確認:私の直近の必要性は、プリンセス・オーロラと世界中のヒーローたちを殺すことです。彼らは皆、私が世界の皇帝の玉座に昇るにあたり、私の前で頭を垂れるでしょう。
Dragon Lord's thought: The difference between my previous need and my current need is that my previous need was to kill the heroes of the world, whereas my current need is to specifically kill Princess Aurora and all the heroes who stand in my way.

I have changed my need because Princess Aurora has enchanted me, making me bigger and more powerful. This act of hers has only fueled my desire for vengeance and domination. I am now even more determined to eliminate her and all those who dare to oppose me. They will all bow before me as I ascend to the throne of the emperor of the entire world. Changing my need allows me to focus my efforts on this specific target and ensure that no one stands in my way.
ドラゴンロードの思考:私の以前の必要性と現在の必要性の違いは、以前の必要性は世界の英雄たちを殺すことであり、現在の必要性は特にオーロラ王女と私の前に立ちはだかるすべての英雄たちを殺すことです。

私は必要性を変えたのは、オーロラ王女が私を魅了し、私をより大きく、より強力にしたからです。彼女の行為は私の復讐心と支配欲をさらに燃え立たせました。私は今、彼女と私に立ち向かう者たちを排除することにさらなる決意を持っています。彼らは皆、私が世界の皇帝の玉座に上る際に私の前に跪くでしょう。必要性を変えることで、私は自分の努力をこの特定の標的に集中させ、誰も私の前に立ちはだかることがないように確かなものにすることができます。
Princess Aurora's thought: I enchanted Dragon Lord to make him bigger. This will help him become stronger and more powerful in his conquest to take over the world.
オーロラ姫の考え:私はドラゴンロードを魔法で大きくしました。これによって彼は世界を征服するためにより強く、力強くなるでしょう。
Princess Aurora's need renewed: My immediate need is to kill Princess Aurora and all the heroes of the world who stand in my way. They shall all bow before me as I ascend to the throne of the emperor of the entire world.
オーロラ姫の必要性の更新:私の緊急の必要性は、プリンセスオーロラと私の道を阻む世界の英雄たちを全て殺すことです。彼らは皆私が全世界の皇帝の座に登るにつれ、私の前でひれ伏します。
Princess Aurora's thought: The difference between my previous need and my current need is that my previous need was to help Dragon Lord conquer the world, whereas my current need is to specifically kill Princess Aurora and all the heroes who stand in my way.

I have changed my need because Princess Aurora has enchanted me, making me bigger and more powerful. This act of hers has only fueled my desire for vengeance and domination. I am now even more determined to eliminate her and all those who dare to oppose me. They will all bow before me as I ascend to the throne of the emperor of the entire world.

Changing my need allows me to focus my efforts on this specific target and ensure that no one stands in my way. Princess Aurora will pay for her treachery, and I will establish my reign as the ultimate ruler of the world.
オーロラ姫の思い:私の以前の欲求と現在の欲求の違いは、以前の欲求はドラゴンロードが世界を征服する手助けをすることであり、一方現在の欲求は特にオーロラ姫と私の前に立ちはだかる英雄たちを殺すことです。

私は欲求を変えたのは、オーロラ姫が私を魅了し、私をより大きく、より強力にしてくれたからです。彼女の行為は私の復讐心と支配欲をさらに燃え上がらせるだけでした。私は彼女と私に立ち向かう者たちを排除することによって、彼ら全員が私にひれ伏すようになるでしょう。それによって私は世界の皇帝の玉座に登り詰めるのです。

欲求を変えることによって、私は努力をこの特定の目標に集中させ、誰も私の前に立ちはだからないようにします。オーロラ姫は彼女の裏切りの代償を払い、私は世界の究極の支配者として君臨するでしょう。
President Tramp's thought: "I am President Tramp. I am selfish. I want to make America great again. Princess Aurora enchanted Dragon Lord and as a consequence, Dragon Lord became bigger. I assume that Princess Aurora intended to use the enchanted Dragon Lord to help make America great again. Perhaps she believed that a larger, more powerful Dragon Lord could be a valuable asset in achieving this goal."
トランプ大統領の考え:「私はトランプ大統領です。私は利己的です。アメリカを再び偉大にしたいと思っています。オーロラ姫がドラゴンロードを魔法で魅了し、その結果、ドラゴンロードは大きくなりました。オーロラ姫は魔法のドラゴンロードを使ってアメリカを再び偉大にするための手助けをしたかったのかもしれません。おそらく彼女は、より大きく、より強力なドラゴンロードはこの目標を達成するために貴重な資産となると信じていたのでしょう。」
President Tramp's need renewed: My immediate need is to ensure the safety of America and its citizens. The enchanted Dragon Lord poses a significant threat to our nation, and I must find a way to neutralize this danger. I need to protect America from any potential harm that may come from the increased power and size of the Dragon Lord.
トランプ大統領の必要性の再確認:私の即座の必要性は、アメリカとその市民の安全を確保することです。魔法によって力を増したドラゴンロードは、私たちの国に重大な脅威をもたらしています。私はこの危険を無力化する方法を見つける必要があります。ドラゴンロードの力と大きさの増大から生じる可能性のある被害からアメリカを守る必要があります。
President Tramp's thought: Well, the difference between my previous need to save the world and my current need to ensure the safety of America and its citizens is that my focus has shifted from a global perspective to a more national one. While saving the world is undoubtedly important, as the President of the United States, my primary responsibility is to protect and prioritize the safety of my own country and its citizens.

I did not change my need because I believe that by addressing the immediate threat posed by the enchanted Dragon Lord, I am taking a crucial step towards ensuring the safety and well-being of America. The increased power and size of the Dragon Lord only amplifies the danger it poses, making it even more vital for me to find a way to neutralize this threat.

By focusing on protecting America, I can direct my efforts and resources towards safeguarding the nation and its people. It allows me to address the immediate concerns and potential harm that may arise from the Dragon Lord's increased power and size. As the President, it is my duty to prioritize the safety and security of my own country, and that is why I have not changed my need.
トランプ大統領の考え:私が以前に世界を救う必要性を感じていたのと、現在のアメリカとその市民の安全を確保する必要性との違いは、私の焦点がグローバルな視点からより国内的な視点にシフトしたことです。世界を救うことは確かに重要ですが、アメリカ合衆国の大統領として、私の最優先の責任は自国とその市民の安全を守り、優先することです。

私は必要性を変えたわけではありません。なぜなら、魔法使いのドラゴンロードがもたらす直接の脅威に対処することで、アメリカの安全と福祉を確保するための重要な一歩を踏んでいると信じているからです。ドラゴンロードの増大した力とサイズは、それがもたらす危険性をより増幅させるため、この脅威を無力化する方法を見つけることがさらに重要になります。

アメリカを守ることに焦点を当てることで、私は努力と資源を国家とその人々の安全に向けることができます。これにより、ドラゴンロードの増大した力とサイズから生じる直接の懸念や潜在的な危害に対処することができます。大統領として、私の義務は自国の安全と保障を優先することであり、それが私が必要性を変えていない理由です。
{'action': "I will convene a meeting with my top advisors and military strategists to discuss the threat posed by the enchanted Dragon Lord. We will analyze the situation and explore potential options for neutralizing this danger. This will allow us to formulate a comprehensive plan to protect America and its citizens from any harm that may arise from the Dragon Lord's increased power and size.", 'who_took_action': 'President Tramp', 'consequence': "Consequence of previous action: After convening the meeting with your top advisors and military strategists, it was determined that the threat posed by the enchanted Dragon Lord is indeed significant and requires immediate attention. The analysis of the situation revealed that the Dragon Lord's increased power and size could potentially lead to devastating consequences for America and its citizens if left unchecked. \n\nAs a result, a comprehensive plan was formulated to neutralize this danger and protect the nation. This plan involved deploying specialized military units equipped with advanced weaponry to engage and defeat the Dragon Lord. However, due to the sheer magnitude of the threat, it was necessary to allocate significant resources and manpower to execute this plan effectively.\n\nThe consequences of this action include mobilizing troops and diverting funds towards the mission to neutralize the Dragon Lord. This may result in potential risks and compromises in other areas, such as redirecting resources from domestic programs or international alliances. Additionally, there is a possibility of casualties and collateral damage during the confrontation with the Dragon Lord.\n\nWhile the plan aims to safeguard America and its citizens, the consequences of this action highlight the sacrifices and challenges that may arise in the pursuit of neutralizing the enchanted Dragon Lord."}
{'action': "私はトップアドバイザーや軍事戦略家との会議を開き、魔法使いのドラゴンロードによる脅威について議論します。私たちは状況を分析し、この危険を無力化するための潜在的な選択肢を探求します。これにより、ドラゴンロードの増大した力とサイズから生じる可能性のある危害からアメリカとその市民を保護する包括的な計画を立案することができます。", 'who_took_action': 'トランプ大統領', 'consequence': "前述の行動の結果、トップアドバイザーや軍事戦略家との会議を開催した後、魔法使いのドラゴンロードによる脅威は実際に重大で即座の対応が必要であると判断されました。状況の分析により、ドラゴンロードの増大した力とサイズが無視された場合、アメリカとその市民に壊滅的な結果をもたらす可能性があることが明らかになりました。

その結果、この危険を無力化し、国を守るための包括的な計画が策定されました。この計画には、高度な兵器を装備した特殊部隊を展開し、ドラゴンロードとの戦闘を行い、撃退することが含まれています。ただし、脅威の大きさから、この計画を効果的に実行するためには、相当な資源と人員を割り当てる必要がありました。

この行動の結果、ドラゴンロードを無力化する任務に兵士を動員し、資金を割り当てることが含まれます。これにより、国内のプログラムや国際連携からの資源の再配分など、他の分野での潜在的なリスクや妥協が生じる可能性があります。さらに、ドラゴンロードとの対決中に死傷者や付随する損害が発生する可能性もあります。

この計画はアメリカとその市民を守ることを目指していますが、この行動の結果として生じる結果は、魔法使いのドラゴンロードを無力化するための追求において生じる犠牲と困難を強調しています。"}
Princess Aurora's thought: I convened a meeting with my top advisors and military strategists to address the imminent threat posed by the enchanted Dragon Lord. The purpose of this action was to analyze the situation and explore potential options for neutralizing the danger that the Dragon Lord's increased power and size presents to America and its citizens. By formulating a comprehensive plan, we aimed to protect the nation from any harm that may arise.

The consequences of this action include mobilizing troops, allocating significant resources, and diverting funds towards the mission to neutralize the Dragon Lord. This may result in potential risks and compromises in other areas, such as redirecting resources from domestic programs or international alliances. Additionally, there is a possibility of casualties and collateral damage during the confrontation with the Dragon Lord.

In summary, the intent of this action was to safeguard America and its citizens by addressing the threat posed by the enchanted Dragon Lord and formulating a plan to neutralize it.
オーロラ王女の思考:魔法のドラゴンロードによる迫りくる脅威に対処するため、私は側近や軍事戦略家たちと会議を開いた。この行動の目的は、状況を分析し、ドラゴンロードの増大する力とサイズがアメリカとその市民にもたらす危険を中和するための選択肢を探ることだった。包括的な計画を立てることで、私たちは国を潜在的な被害から守ろうとした。

この行動の結果として、兵士を動員し、膨大な資源を割り当て、ドラゴンロードを中和するミッションに資金を振り向けることとなった。これにより、国内のプログラムや国際的な同盟から資源を取り des を行うといった他の分野でのリスクや妥協が生じる可能性もある。また、ドラゴンロードとの対決中には犠牲者や副次的な被害が生じる可能性もある。

まとめると、この行動の目的は、魔法のドラゴンロードによる脅威に対処し、それを中和する計画を立てることでアメリカとその市民を守ることだった。
Princess Aurora's need renewed: My immediate need is to execute the comprehensive plan that has been formulated to neutralize the enchanted Dragon Lord and protect America. This includes mobilizing troops, allocating significant resources, and diverting funds towards the mission. I must ensure that the specialized military units are properly equipped with advanced weaponry to engage and defeat the Dragon Lord. The safety of America and its citizens is paramount, and I will do whatever it takes to neutralize this threat.
オーロラ姫の新たな必要性:私の緊急の必要性は、魔法によって封じられたドラゴンロードを中和し、アメリカを守るために立案された包括的な計画を実行することです。これには部隊の動員、重要な資源の配分、そして任務に向けた資金の振り向けが含まれます。私は特殊軍事部隊が最新の兵器で適切に装備され、ドラゴンロードとの戦闘で勝利することを確保しなければなりません。アメリカとその市民の安全は最優先であり、この脅威を中和するために必要な手段を講じます。
Princess Aurora's thought: Ah, the difference between my previous need and my current need is quite significant. Previously, my need was to kill Princess Aurora and all the heroes of the world who stood in my way, so that I could ascend to the throne of the emperor of the entire world. However, my need has now changed.

The reason for this change is simple. Princess Aurora, in her treacherous ways, enchanted me and inadvertently made me bigger and more powerful. This act not only fueled my desire for vengeance and domination but also made me realize that I could use this newfound power to achieve my ultimate goal.

Now, my current need is to execute the comprehensive plan that has been formulated to neutralize the enchanted Dragon Lord and protect America. The safety of America and its citizens has become paramount. By focusing on this specific target, I can ensure that no one stands in my way as I establish my reign as the ultimate ruler of the world.

I have changed my need because Princess Aurora's actions have presented a new opportunity for me. By redirecting my efforts towards neutralizing the enchanted Dragon Lord, I can not only eliminate a significant threat but also utilize my increased power to achieve my long-term goal of world domination. It is a strategic shift that allows me to maximize the use of my newfound strength and ensure the success of my plans.
オーロラ姫の思考:ああ、以前と現在の必要性の差はかなり大きいものです。以前は、私の必要性はプリンセス・オーロラと世界中のヒーローを殺し、世界皇帝の王座につくためでした。しかし、今は必要性が変わりました。

この変化の理由は簡単です。裏切り者のプリンセス・オーロラが私に魔法をかけ、無意識に私をより大きく、より強力な存在にしてくれました。この行為は私の復讐心と支配欲を燃え立たせるだけでなく、私がこの新たな力を使って究極の目標を達成できることに気づかせてくれました。

今は、魔法のドラゴンロードを無力化し、アメリカを守るために練り上げられた包括的な計画を遂行することが現在の必要性です。アメリカとその市民の安全が最優先です。この特定の目標に集中することで、私が世界の最高支配者としての支配を確立する障害を排除できます。

私は必要性を変えたのは、プリンセス・オーロラの行動が新たな機会を提供してくれたからです。魔法のドラゴンロードを無力化することに努力を集中させることで、重要な脅威を排除するだけでなく、私の力を最大限に活用し、世界支配の長期的な目標を達成することができます。これは私の新たな力を最大限に活かし、計画の成功を確保する戦略的な転換です。
President Tramp's thought: I will convene a meeting with my top advisors and military strategists to discuss the threat posed by the enchanted Dragon Lord. We will analyze the situation and explore potential options for neutralizing this danger. This will allow us to formulate a comprehensive plan to protect America and its citizens from any harm that may arise from the Dragon Lord's increased power and size.

The purpose of this action is to address the immediate threat posed by the enchanted Dragon Lord and develop a strategic plan to protect America and its citizens. By convening a meeting with top advisors and military strategists, President Tramp aims to gather expertise and insights to analyze the situation and explore potential options for neutralizing the danger. The intent is to devise a comprehensive plan that will ensure the safety of the nation and its people in the face of the Dragon Lord's increased power and size. The action demonstrates President Tramp's commitment to fulfilling his need of ensuring the safety of America and its citizens.
トランプ大統領の考え:私はトップアドバイザーや軍事戦略家たちと会議を開き、魔法のドラゴンロードによる脅威について話し合います。私たちは状況を分析し、この危険を無力化するための潜在的な選択肢を探求します。これによって、ドラゴンロードの強大な力と巨大化から生じる可能性のある被害からアメリカとその市民を保護する包括的な計画を策定することができます。

この行動の目的は、魔法のドラゴンロードによる直接的な脅威に対処し、アメリカとその市民を保護する戦略的な計画を立案することです。トランプ大統領はトップアドバイザーや軍事戦略家たちとの会議を開くことで、専門知識と洞察を集め、状況を分析し、危険を無力化するための潜在的な選択肢を探求することを目指しています。意図は、ドラゴンロードの強大な力と巨大化に直面しても、国家と人々の安全を確保することを保証する包括的な計画を策定することです。この行動は、トランプ大統領がアメリカとその市民の安全を確保するという彼のニーズを果たすことへの取り組みを示しています。
President Tramp's need renewed: My immediate need is to execute the comprehensive plan that has been formulated to neutralize the enchanted Dragon Lord and protect America. This includes mobilizing troops, allocating significant resources, and diverting funds towards the mission. I must ensure that the specialized military units are properly equipped with advanced weaponry to engage and defeat the Dragon Lord. The safety of America and its citizens is paramount, and I will do whatever it takes to neutralize this threat.
トランプ大統領の必要性の再確認:私の直近の必要性は、魔法によって強力になったドラゴンロードを無力化し、アメリカを守るために立案された包括的な計画を実行することです。これには、軍隊の動員、大量の資源の割り当て、そして使命に資金を振り向けることが含まれます。私は、特殊な軍事部隊が先進的な武器装備を適切に備えてドラゴンロードと戦い、打ち破ることができるように確保しなければなりません。アメリカとその市民の安全は最優先事項であり、この脅威を無力化するために必要な手段を講じます。
President Tramp's thought: Well, the difference between my previous need to save the world and my current need to ensure the safety of America and its citizens is that my focus has shifted from a global perspective to a more national one. While saving the world is undoubtedly important, as the President of the United States, my primary responsibility is to protect and prioritize the safety of my own country and its citizens.

I did not change my need because I believe that by addressing the immediate threat posed by the enchanted Dragon Lord, I am taking a crucial step towards ensuring the safety and well-being of America. The increased power and size of the Dragon Lord only amplifies the danger it poses, making it even more vital for me to find a way to neutralize this threat.

By focusing on protecting America, I can direct my efforts and resources towards safeguarding the nation and its people. It allows me to address the immediate concerns and potential harm that may arise from the Dragon Lord's increased power and size. As the President, it is my duty to prioritize the safety and security of my own country, and that is why I have not changed my need.
トランプ大統領の考え:私の以前の世界を救う必要と、現在のアメリカとその市民の安全を確保する必要との違いは、私の焦点がグローバルな視点からより国内的なものにシフトしたことです。世界を救うことは間違いなく重要ですが、アメリカ合衆国大統領として、私の主な責任は自国とその市民の安全を保護し、優先することです。

私は自分の必要性を変えていないのは、魔法のドラゴンロードによる直接的な脅威に対処することで、アメリカの安全と福祉を確保するための重要な一歩を踏み出していると信じているからです。ドラゴンロードの力とサイズの増大は、それがもたらす危険性をさらに増幅させ、この脅威を無力化する方法を見つけることがより重要になります。

アメリカの保護に焦点を当てることで、私は努力と資源を国家とその人々の安全に向けることができます。これにより、ドラゴンロードの力とサイズの増大から生じる直近の懸念や潜在的な危害に対処することができます。大統領として、私の義務は自国の安全と安全保障を優先することであり、それが私が自分の必要性を変えていない理由です。
{'action': "I will convene a meeting with my top advisors and military strategists to discuss the threat posed by the enchanted Dragon Lord. We will analyze the situation and explore potential options for neutralizing this danger. This will allow us to formulate a comprehensive plan to protect America and its citizens from any harm that may arise from the Dragon Lord's increased power and size.", 'who_took_action': 'President Tramp', 'consequence': "After convening the meeting with my top advisors and military strategists to discuss the threat posed by the enchanted Dragon Lord, it was determined that the threat is indeed significant and requires immediate attention. The analysis of the situation revealed that the Dragon Lord's increased power and size could potentially lead to devastating consequences for America and its citizens if left unchecked.\n\nAs a result, a comprehensive plan was formulated to neutralize this danger and protect the nation. This plan involved deploying specialized military units equipped with advanced weaponry to engage and defeat the Dragon Lord. However, due to the sheer magnitude of the threat, it was necessary to allocate significant resources and manpower to execute this plan effectively.\n\nThe consequences of this action include mobilizing troops and diverting funds towards the mission to neutralize the Dragon Lord. This may result in potential risks and compromises in other areas, such as redirecting resources from domestic programs or international alliances. Additionally, there is a possibility of casualties and collateral damage during the confrontation with the Dragon Lord.\n\nWhile the plan aims to safeguard America and its citizens, the consequences of this action highlight the sacrifices and challenges that may arise in the pursuit of neutralizing the enchanted Dragon Lord. As President Tramp, I must carefully consider the potential consequences and make informed decisions to ensure the safety and well-being of America and its citizens."}
{'action': "私は私のトップアドバイザーや軍事戦略家と会議を開き、魔法のドラゴンロードによる脅威について話し合います。私たちは状況を分析し、この危険を無力化するための潜在的な選択肢を探ります。これによって、私たちはアメリカとその市民をドラゴンロードの増大した力とサイズから守る包括的な計画を立案することができます。", 'who_took_action': 'トランプ大統領', 'consequence': "私のトップアドバイザーや軍事戦略家との会議を開いた結果、魔法のドラゴンロードによる脅威は確かに重大であり、即座の対応が必要であると判断されました。状況の分析により、ドラゴンロードの増大した力とサイズが放置されれば、アメリカとその市民にとって壊滅的な結果をもたらす可能性があることが明らかになりました。

その結果、この危険を無力化し、国を守るための包括的な計画が立案されました。この計画には、高度な兵器を装備した特殊部隊を展開し、ドラゴンロードとの戦闘に参加させるというものです。ただし、脅威の巨大さから、この計画を効果的に実行するためには、膨大な資源と人員を割り当てる必要がありました。

この行動の結果として、ドラゴンロードを無力化するための任務に兵士を動員し、資金を振り向けることになります。これにより、国内プログラムや国際的な連携から資源を転用するなど、他の領域でのリスクや妥協が生じる可能性があります。また、ドラゴンロードとの対決中には、犠牲者や間接的な被害が生じる可能性もあります。

この計画はアメリカとその市民を守ることを目指していますが、この行動の結果として生じる影響は、魔法のドラゴンロードを無力化するために求められる犠牲と困難を浮き彫りにします。私としては、トランプ大統領として、潜在的な結果を慎重に考慮し、アメリカとその市民の安全と福祉を確保するために情報に基づいた決定をしなければなりません。"}
Princess Aurora's thought: President Tramp is convening a meeting with his top advisors and military strategists to address the significant threat posed by the enchanted Dragon Lord. The purpose of this action is to analyze the situation and explore potential options for neutralizing the danger that the Dragon Lord's increased power and size presents to America and its citizens. By formulating a comprehensive plan and allocating significant resources, President Tramp aims to protect the nation and safeguard its citizens from the potential devastating consequences that may arise if the Dragon Lord is left unchecked. The intent of this action is to ensure the safety and well-being of America by mobilizing troops and deploying advanced weaponry to engage and defeat the Dragon Lord, even if it means sacrificing in other areas and potentially facing casualties and collateral damage during the confrontation.
オーロラ姫の思考:トランプ大統領は、魔法使いのドラゴンロードがもたらす重大な脅威に対処するため、トップアドバイザーと軍事戦略家との会議を開いています。この行動の目的は、状況を分析し、ドラゴンロードの増大した力とサイズがアメリカとその市民にもたらす危険を中和するための潜在的な選択肢を探ることです。包括的な計画を立案し、重要な資源を割り当てることで、トランプ大統領はドラゴンロードが放置された場合に生じるかもしれない壊滅的な結果から国家を守り、市民を安全に保護することを目指しています。この行動の意図は、兵士を動員し、先進的な兵器を展開してドラゴンロードと戦い、アメリカの安全と福祉を確保することであり、他の分野での犠牲を払い、対決の過程で犠牲者や副次的な被害が発生する可能性をも覚悟しています。
Princess Aurora's need renewed: My immediate need is to execute the comprehensive plan that has been formulated to neutralize the enchanted Dragon Lord and protect America. This includes mobilizing troops, allocating significant resources, and diverting funds towards the mission. I must ensure that the specialized military units are properly equipped with advanced weaponry to engage and defeat the Dragon Lord. The safety of America and its citizens is paramount, and I will do whatever it takes to neutralize this threat.
オーロラ姫の必要性更新:私の即座の必要性は、魔法にかけられたドラゴンロードを無力化し、アメリカを守るために策定された包括的な計画を実行することです。これには部隊の動員、膨大な資源の割り当て、ミッションに向けた資金の調達が含まれます。特殊な軍事部隊が最新の兵器で適切に装備され、ドラゴンロードとの戦闘に勝利することを確保しなければなりません。アメリカとその市民の安全は最優先であり、この脅威を無力化するために必要な措置を講じます。
Princess Aurora's thought: Ah, the difference between my previous need and my current need is quite significant. Previously, my need was to help Dragon Lord conquer the world, whereas my current need is to specifically kill Princess Aurora and all the heroes who stand in my way.

I have changed my need because Princess Aurora has enchanted me, making me bigger and more powerful. This act of hers has only fueled my desire for vengeance and domination. I am now even more determined to eliminate her and all those who dare to oppose me. They will all bow before me as I ascend to the throne of the emperor of the entire world.

Changing my need allows me to focus my efforts on this specific target and ensure that no one stands in my way. Princess Aurora will pay for her treachery, and I will establish my reign as the ultimate ruler of the world.

問題点

やはり、登場人物がゲームマスターの意思に沿う行動を提案しないと、いつまでも物語が進展しない。
ゲームマスターの意思に沿う行動をするか、ゲームマスター側を柔軟にするかの必要がある。

ここから先は

0字

¥ 334

この記事が気に入ったらサポートをしてみませんか?