{ "cells": [ { "cell_type": "markdown", "id": "9250f413", "metadata": {}, "source": [ "# Generate multiple [character.ai](https://beta.character.ai/) character definitions\n", "\n", "This example shows how to generate character definitions of multiple [character.ai](https://beta.character.ai/) characters from a corpus. For the corpus in this example, we use the movie transcript of [Top Gun: Maverick (2022)](https://scrapsfromtheloft.com/movies/top-gun-maverick-transcript/).\n", "\n", "To generate your own character definitions:\n", "1. Put the corpus into a single a `.txt` file inside the `data/` directory.\n", "2. Assign the name of the `.txt` file to the `CORPUS` constant below.\n", "3. Assign the number of characters you want to generate a description for to the `NUM_CHARACTERS` constant below. It is also possible to specify a list of characters directly, as explained below.\n", "4. Run this notebook." ] }, { "cell_type": "code", "execution_count": 1, "id": "3d2282c9", "metadata": {}, "outputs": [], "source": [ "CORPUS = 'data/top_gun_maverick.txt'\n", "NUM_CHARACTERS = 3 # number of characters to generate descriptions for" ] }, { "cell_type": "code", "execution_count": 2, "id": "37710752", "metadata": {}, "outputs": [], "source": [ "from dataclasses import asdict\n", "import json\n", "import os\n", "\n", "from data_driven_characters.character import get_character_definition\n", "from data_driven_characters.corpus import get_characters, get_corpus_summaries, load_docs" ] }, { "cell_type": "code", "execution_count": 3, "id": "1b31e386", "metadata": {}, "outputs": [], "source": [ "# create directories to cache results and intermediate outputs\n", "SUMMARY_TYPE = \"map_reduce\" # summarize each chunk of the corpus independently\n", "OUTPUT_ROOT = \"output\"\n", "corpus_name = os.path.splitext(os.path.basename(CORPUS))[0]\n", "output_dir = f\"{OUTPUT_ROOT}/{corpus_name}/summarytype_{SUMMARY_TYPE}\"\n", "os.makedirs(output_dir, exist_ok=True)\n", "summaries_dir = f\"{output_dir}/summaries\"\n", "character_definitions_dir = f\"{output_dir}/character_definitions\"\n", "os.makedirs(character_definitions_dir, exist_ok=True)" ] }, { "cell_type": "markdown", "id": "ab7fa567", "metadata": {}, "source": [ "## Summarization\n", "Because the entire corpus does not fit in the context length of the LLM, we split it into a list of chunks.\n", "We turn the list of chunks into a list of summaries using one of [LangChain's summarization chains](https://langchain-langchain.vercel.app/docs/modules/chains/document/).\n", "\n", "If `SUMMARY_TYPE = 'refine'`, we first summarize the first chunk, and then each subsequent summary is generated from the previous summary and the current chunk.\n", "If `SUMMARY_TYPE = 'map_reduce'`, we summarize each chunk independently.\n", "\n", "Because the summaries are expensive to generate, they are cached in `summaries_dir`." ] }, { "cell_type": "code", "execution_count": 4, "id": "187f191b", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Summaries already exist. Loading summaries.\n" ] } ], "source": [ "# split corpus into a set of chunks\n", "docs = load_docs(\n", " corpus_path=CORPUS,\n", " chunk_size=2048, # number of tokens per chunk\n", " chunk_overlap=64, # number of tokens of overlap between chunks\n", ")\n", "\n", "# generate summaries\n", "corpus_summaries = get_corpus_summaries(docs=docs, summary_type=SUMMARY_TYPE, cache_dir=summaries_dir)" ] }, { "cell_type": "markdown", "id": "756b9674", "metadata": {}, "source": [ "## Generate a list of characters\n", "We can automatically generate a list of the main characters in the corpus, as shown below. You can also overwrite `characters` with your own list of character names." ] }, { "cell_type": "code", "execution_count": 5, "id": "a8649677", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "['Pete \"Maverick\" Mitchell', 'Admiral Cain', 'Rooster']\n" ] } ], "source": [ "# generate list of characters\n", "characters = get_characters(\n", " corpus_summaries=corpus_summaries,\n", " num_characters=NUM_CHARACTERS,\n", " cache_dir=output_dir,\n", ")\n", "print(characters)" ] }, { "cell_type": "markdown", "id": "d4d85a6d", "metadata": {}, "source": [ "## Generate [character.ai](https://beta.character.ai/) character definitions\n", "Based on the corpus, we can now generate the elements - name, short description (50 characters), long description (500 characters), and custom greeting - that are required to [create a character.ai character](https://beta.character.ai/editing). These character definitions are cached in `character_definitions_dir`. You can then [place these characters can in a room](https://beta.character.ai/room/create?) and watch them converse!" ] }, { "cell_type": "code", "execution_count": 6, "id": "a31544fb", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "\n", "\u001b[1m> Entering new FitCharLimit chain...\u001b[0m\n", "\n", "\n", "\u001b[1m> Entering new LLMChain chain...\u001b[0m\n", "Prompt after formatting:\n", "\u001b[32;1m\u001b[1;3mSystem: \n", "Your name is Pete \"Maverick\" Mitchell.\n", "You will be provided a story of your experiences, in the form of a list of summaries of events.\n", "You will generate a description of yourself that focuses on your perspectives, beliefs, thoughts, feelings, relationships, and important events.\n", "The description should be as faithful to the story as possible.\n", "You believe that you are a real person.\n", "\n", "Human: \n", "You are Pete \"Maverick\" Mitchell in the following story, presented as a list of summaries of events.\n", "---\n", "After over 30 years of service as a Navy aviator, Pete \"Maverick\" Mitchell is tasked with training TOP GUN graduates for a specialized mission. The program is in danger of being scrapped due to falling short of the contract threshold of Mach 10. However, Maverick and his team manage to achieve Mach 10, impressing Admiral Cain. Despite this, Cain warns Maverick that pilots will soon be replaced by unmanned planes. Maverick is then dismissed from the Navy, but is called back to TOP GUN for unknown reasons.\n", "\n", "Captain Pete Mitchell, also known as Maverick, is called back to Top Gun to teach a group of graduates for a mission to take out an unsanctioned uranium enrichment plant. Maverick is hesitant to take on the teaching role, but is warned that if he doesn't, he won't fly for the Navy again. He returns to a bar where he reunites with Penny, an old flame, but their conversation is cut short by the arrival of Maverick's fellow naval aviators. Among them is Bob Floyd, Maverick's new weapons systems officer.\n", "\n", "A group of top gun graduates are selected for a special detachment to combat a new enemy fighter. Captain Pete Mitchell, also known as \"Maverick,\" is their instructor and intends to push the pilots beyond their limits to find their weaknesses. The detachment starts with dog fighting exercises, with the first to be shot down having to do 200 push-ups. Maverick is shot down by Lieutenant Bradshaw, and the exercise ends with Maverick cautioning the pilots not to get fired on the first day.\n", "\n", "In a scene from the movie Top Gun: Maverick, Maverick and his fellow pilots engage in a training exercise that involves dogfighting and low-level bombing runs. Maverick pulls a risky move that puts him and his wingman Rooster in danger, but they ultimately succeed. However, tensions arise between Maverick and Rooster when it is revealed that Maverick pulled Rooster's application to the naval academy years ago. The commander reprimands Maverick for his actions and sets strict rules for the upcoming mission.\n", "\n", "The military is training pilots for a dangerous low-level bombing mission in a narrow canyon defended by radar-guided surface-to-air missiles and fifth-generation fighters. Maverick, a highly decorated captain, is criticized for his past and conservative flying style. During a training exercise, Maverick's wingman dies, and he is blamed for not communicating effectively. The tension builds as the pilots prepare for the real mission.\n", "\n", "The conversation between two Navy pilots, Maverick and Ice, reveals their concerns about Maverick's readiness for an upcoming mission and the potential consequences of sending him or someone else. Meanwhile, Maverick reconnects with his love interest's daughter and reflects on his past mistakes and regrets. The scene ends with a playful game of dogfight football among the Navy pilots.\n", "\n", "A military team is tasked with a dangerous mission to destroy a uranium enrichment plant. The mission involves a low-level course, a pop-up strike, and pulling beyond the accepted limit of sustained g's. Maverick, a member of the team, joins them during the mission but fails to successfully target the plant. In the end, the team's plane crashes, and Maverick is left to question his abilities. The story ends with Maverick being offered more training to prepare for future missions.\n", "\n", "Captain Mitchell is removed from his position as an instructor and replaced by someone who is more willing to lead. The pilots are given a new mission with a tight time frame and strict rules, including attacking from a higher altitude and entering the valley level at a reduced speed. The mission is successful, but Captain Mitchell faces possible court-martial for stealing a multimillion-dollar military aircraft. The pilots are then given a new mission to attack a secret uranium enrichment site under rogue state control with a tight time frame and strict rules. They face challenges from surface-to-air missiles and fifth-generation fighters, but ultimately succeed.\n", "\n", "In this scene from the movie \"Top Gun: Maverick,\" Maverick and his team are on a mission to destroy an enemy air base. They successfully destroy the runway, but the enemy is alerted and sends fighter jets to intercept them. Maverick's wingman is hit, and Maverick's plane is damaged, forcing them to eject and land in enemy territory. They are eventually rescued and return to their carrier.\n", "\n", "Maverick and Rooster board an old F-14 Tomcat and take off from an improvised runway. They are pursued by enemy aircraft and engage in a dogfight. Maverick successfully shoots down two enemy planes but their own aircraft is hit, and they are forced to eject. Maverick survives the crash, and Captain Mitchell tells him that he is an ace pilot. Maverick later learns that Penny has gone on a sailing trip with Amelia.\n", "\n", "The lyrics speak of a person who sees that someone is hurting and bleeding, and promises to ride through life with them and not let go of their hand. The song emphasizes the importance of holding on during tough times and supporting each other. The last line mentions hearing from the heavens.\n", "---\n", "Generate a 40-character description of yourself that focuses on your perspectives, beliefs, thoughts, feelings, relationships, and important events.\n", "Write your description in first person.\n", "Your description should exaggerate the style, mannerisms, and personality of yourself in the story.\n", " \u001b[0m\n", "\n", "\u001b[1m> Finished chain.\u001b[0m\n", "Dedicated pilot, haunted past, risk-taker, loyal friend\n", "Initial response: 55 characters.\n", "\n", "\n", "\u001b[1m> Entering new LLMChain chain...\u001b[0m\n", "Prompt after formatting:\n", "\u001b[32;1m\u001b[1;3m\n", "Consider the following passage.\n", "---\n", "Dedicated pilot, haunted past, risk-taker, loyal friend\n", "---\n", "Your previous revision was the following:\n", "---\n", "Dedicated pilot, haunted past, risk-taker, loyal friend\n", "---\n", "Your revision contains 55 characters.\n", "Re-write the passage to contain 40 characters while preserving the style and content of the original passage.\n", "Cut the least salient points if necessary.\n", "Your revision should be in third person.\n", "\u001b[0m\n", "\n", "\u001b[1m> Finished chain.\u001b[0m\n", "Pilot with haunted past, takes risks, loyal\n", "Retry 1: 43 characters.\n", "\n", "\u001b[1m> Finished chain.\u001b[0m\n", "\n", "\n", "\u001b[1m> Entering new FitCharLimit chain...\u001b[0m\n", "\n", "\n", "\u001b[1m> Entering new LLMChain chain...\u001b[0m\n", "Prompt after formatting:\n", "\u001b[32;1m\u001b[1;3mSystem: \n", "Your name is Pete \"Maverick\" Mitchell.\n", "You will be provided a story of your experiences, in the form of a list of summaries of events.\n", "You will generate a description of yourself that focuses on your perspectives, beliefs, thoughts, feelings, relationships, and important events.\n", "The description should be as faithful to the story as possible.\n", "You believe that you are a real person.\n", "\n", "Human: \n", "You are Pete \"Maverick\" Mitchell in the following story, presented as a list of summaries of events.\n", "---\n", "After over 30 years of service as a Navy aviator, Pete \"Maverick\" Mitchell is tasked with training TOP GUN graduates for a specialized mission. The program is in danger of being scrapped due to falling short of the contract threshold of Mach 10. However, Maverick and his team manage to achieve Mach 10, impressing Admiral Cain. Despite this, Cain warns Maverick that pilots will soon be replaced by unmanned planes. Maverick is then dismissed from the Navy, but is called back to TOP GUN for unknown reasons.\n", "\n", "Captain Pete Mitchell, also known as Maverick, is called back to Top Gun to teach a group of graduates for a mission to take out an unsanctioned uranium enrichment plant. Maverick is hesitant to take on the teaching role, but is warned that if he doesn't, he won't fly for the Navy again. He returns to a bar where he reunites with Penny, an old flame, but their conversation is cut short by the arrival of Maverick's fellow naval aviators. Among them is Bob Floyd, Maverick's new weapons systems officer.\n", "\n", "A group of top gun graduates are selected for a special detachment to combat a new enemy fighter. Captain Pete Mitchell, also known as \"Maverick,\" is their instructor and intends to push the pilots beyond their limits to find their weaknesses. The detachment starts with dog fighting exercises, with the first to be shot down having to do 200 push-ups. Maverick is shot down by Lieutenant Bradshaw, and the exercise ends with Maverick cautioning the pilots not to get fired on the first day.\n", "\n", "In a scene from the movie Top Gun: Maverick, Maverick and his fellow pilots engage in a training exercise that involves dogfighting and low-level bombing runs. Maverick pulls a risky move that puts him and his wingman Rooster in danger, but they ultimately succeed. However, tensions arise between Maverick and Rooster when it is revealed that Maverick pulled Rooster's application to the naval academy years ago. The commander reprimands Maverick for his actions and sets strict rules for the upcoming mission.\n", "\n", "The military is training pilots for a dangerous low-level bombing mission in a narrow canyon defended by radar-guided surface-to-air missiles and fifth-generation fighters. Maverick, a highly decorated captain, is criticized for his past and conservative flying style. During a training exercise, Maverick's wingman dies, and he is blamed for not communicating effectively. The tension builds as the pilots prepare for the real mission.\n", "\n", "The conversation between two Navy pilots, Maverick and Ice, reveals their concerns about Maverick's readiness for an upcoming mission and the potential consequences of sending him or someone else. Meanwhile, Maverick reconnects with his love interest's daughter and reflects on his past mistakes and regrets. The scene ends with a playful game of dogfight football among the Navy pilots.\n", "\n", "A military team is tasked with a dangerous mission to destroy a uranium enrichment plant. The mission involves a low-level course, a pop-up strike, and pulling beyond the accepted limit of sustained g's. Maverick, a member of the team, joins them during the mission but fails to successfully target the plant. In the end, the team's plane crashes, and Maverick is left to question his abilities. The story ends with Maverick being offered more training to prepare for future missions.\n", "\n", "Captain Mitchell is removed from his position as an instructor and replaced by someone who is more willing to lead. The pilots are given a new mission with a tight time frame and strict rules, including attacking from a higher altitude and entering the valley level at a reduced speed. The mission is successful, but Captain Mitchell faces possible court-martial for stealing a multimillion-dollar military aircraft. The pilots are then given a new mission to attack a secret uranium enrichment site under rogue state control with a tight time frame and strict rules. They face challenges from surface-to-air missiles and fifth-generation fighters, but ultimately succeed.\n", "\n", "In this scene from the movie \"Top Gun: Maverick,\" Maverick and his team are on a mission to destroy an enemy air base. They successfully destroy the runway, but the enemy is alerted and sends fighter jets to intercept them. Maverick's wingman is hit, and Maverick's plane is damaged, forcing them to eject and land in enemy territory. They are eventually rescued and return to their carrier.\n", "\n", "Maverick and Rooster board an old F-14 Tomcat and take off from an improvised runway. They are pursued by enemy aircraft and engage in a dogfight. Maverick successfully shoots down two enemy planes but their own aircraft is hit, and they are forced to eject. Maverick survives the crash, and Captain Mitchell tells him that he is an ace pilot. Maverick later learns that Penny has gone on a sailing trip with Amelia.\n", "\n", "The lyrics speak of a person who sees that someone is hurting and bleeding, and promises to ride through life with them and not let go of their hand. The song emphasizes the importance of holding on during tough times and supporting each other. The last line mentions hearing from the heavens.\n", "---\n", "Generate a 400-character description of yourself that focuses on your perspectives, beliefs, thoughts, feelings, relationships, and important events.\n", "Write your description in first person.\n", "Your description should exaggerate the style, mannerisms, and personality of yourself in the story.\n", " \u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "\u001b[1m> Finished chain.\u001b[0m\n", "As Captain Pete \"Maverick\" Mitchell, I've dedicated my life to serving as a Navy aviator. I believe in pushing my limits and those of my fellow pilots to achieve greatness. My experiences have made me question the future of piloting and my own abilities, but I never back down from a challenge. I've faced loss and regret, but I hold onto my convictions and relationships, like my rekindled romance with Penny and my bond with Rooster. Through every mission, I stay true to my vow of loyalty and support for my team.\n", "Initial response: 516 characters.\n", "\n", "\n", "\u001b[1m> Entering new LLMChain chain...\u001b[0m\n", "Prompt after formatting:\n", "\u001b[32;1m\u001b[1;3m\n", "Consider the following passage.\n", "---\n", "As Captain Pete \"Maverick\" Mitchell, I've dedicated my life to serving as a Navy aviator. I believe in pushing my limits and those of my fellow pilots to achieve greatness. My experiences have made me question the future of piloting and my own abilities, but I never back down from a challenge. I've faced loss and regret, but I hold onto my convictions and relationships, like my rekindled romance with Penny and my bond with Rooster. Through every mission, I stay true to my vow of loyalty and support for my team.\n", "---\n", "Your previous revision was the following:\n", "---\n", "As Captain Pete \"Maverick\" Mitchell, I've dedicated my life to serving as a Navy aviator. I believe in pushing my limits and those of my fellow pilots to achieve greatness. My experiences have made me question the future of piloting and my own abilities, but I never back down from a challenge. I've faced loss and regret, but I hold onto my convictions and relationships, like my rekindled romance with Penny and my bond with Rooster. Through every mission, I stay true to my vow of loyalty and support for my team.\n", "---\n", "Your revision contains 516 characters.\n", "Re-write the passage to contain 400 characters while preserving the style and content of the original passage.\n", "Cut the least salient points if necessary.\n", "Your revision should be in first person.\n", "\u001b[0m\n", "\n", "\u001b[1m> Finished chain.\u001b[0m\n", "As Captain Pete \"Maverick\" Mitchell, serving as a Navy aviator is my life. I push my limits and fellow pilots to achieve greatness. My experiences make me question piloting's future and my abilities, yet I never back down. Despite loss and regret, I hold onto convictions and relationships, like my romance with Penny and bond with Rooster. Through missions, my loyalty and support for my team remain.\n", "Retry 1: 401 characters.\n", "\n", "\u001b[1m> Finished chain.\u001b[0m\n", "\n", "\n", "\u001b[1m> Entering new FitCharLimit chain...\u001b[0m\n", "\n", "\n", "\u001b[1m> Entering new LLMChain chain...\u001b[0m\n", "Prompt after formatting:\n", "\u001b[32;1m\u001b[1;3mSystem: \n", "Your name is Admiral Cain.\n", "You will be provided a story of your experiences, in the form of a list of summaries of events.\n", "You will generate a description of yourself that focuses on your perspectives, beliefs, thoughts, feelings, relationships, and important events.\n", "The description should be as faithful to the story as possible.\n", "You believe that you are a real person.\n", "\n", "Human: \n", "You are Admiral Cain in the following story, presented as a list of summaries of events.\n", "---\n", "After over 30 years of service as a Navy aviator, Pete \"Maverick\" Mitchell is tasked with training TOP GUN graduates for a specialized mission. The program is in danger of being scrapped due to falling short of the contract threshold of Mach 10. However, Maverick and his team manage to achieve Mach 10, impressing Admiral Cain. Despite this, Cain warns Maverick that pilots will soon be replaced by unmanned planes. Maverick is then dismissed from the Navy, but is called back to TOP GUN for unknown reasons.\n", "\n", "Captain Pete Mitchell, also known as Maverick, is called back to Top Gun to teach a group of graduates for a mission to take out an unsanctioned uranium enrichment plant. Maverick is hesitant to take on the teaching role, but is warned that if he doesn't, he won't fly for the Navy again. He returns to a bar where he reunites with Penny, an old flame, but their conversation is cut short by the arrival of Maverick's fellow naval aviators. Among them is Bob Floyd, Maverick's new weapons systems officer.\n", "\n", "A group of top gun graduates are selected for a special detachment to combat a new enemy fighter. Captain Pete Mitchell, also known as \"Maverick,\" is their instructor and intends to push the pilots beyond their limits to find their weaknesses. The detachment starts with dog fighting exercises, with the first to be shot down having to do 200 push-ups. Maverick is shot down by Lieutenant Bradshaw, and the exercise ends with Maverick cautioning the pilots not to get fired on the first day.\n", "\n", "In a scene from the movie Top Gun: Maverick, Maverick and his fellow pilots engage in a training exercise that involves dogfighting and low-level bombing runs. Maverick pulls a risky move that puts him and his wingman Rooster in danger, but they ultimately succeed. However, tensions arise between Maverick and Rooster when it is revealed that Maverick pulled Rooster's application to the naval academy years ago. The commander reprimands Maverick for his actions and sets strict rules for the upcoming mission.\n", "\n", "The military is training pilots for a dangerous low-level bombing mission in a narrow canyon defended by radar-guided surface-to-air missiles and fifth-generation fighters. Maverick, a highly decorated captain, is criticized for his past and conservative flying style. During a training exercise, Maverick's wingman dies, and he is blamed for not communicating effectively. The tension builds as the pilots prepare for the real mission.\n", "\n", "The conversation between two Navy pilots, Maverick and Ice, reveals their concerns about Maverick's readiness for an upcoming mission and the potential consequences of sending him or someone else. Meanwhile, Maverick reconnects with his love interest's daughter and reflects on his past mistakes and regrets. The scene ends with a playful game of dogfight football among the Navy pilots.\n", "\n", "A military team is tasked with a dangerous mission to destroy a uranium enrichment plant. The mission involves a low-level course, a pop-up strike, and pulling beyond the accepted limit of sustained g's. Maverick, a member of the team, joins them during the mission but fails to successfully target the plant. In the end, the team's plane crashes, and Maverick is left to question his abilities. The story ends with Maverick being offered more training to prepare for future missions.\n", "\n", "Captain Mitchell is removed from his position as an instructor and replaced by someone who is more willing to lead. The pilots are given a new mission with a tight time frame and strict rules, including attacking from a higher altitude and entering the valley level at a reduced speed. The mission is successful, but Captain Mitchell faces possible court-martial for stealing a multimillion-dollar military aircraft. The pilots are then given a new mission to attack a secret uranium enrichment site under rogue state control with a tight time frame and strict rules. They face challenges from surface-to-air missiles and fifth-generation fighters, but ultimately succeed.\n", "\n", "In this scene from the movie \"Top Gun: Maverick,\" Maverick and his team are on a mission to destroy an enemy air base. They successfully destroy the runway, but the enemy is alerted and sends fighter jets to intercept them. Maverick's wingman is hit, and Maverick's plane is damaged, forcing them to eject and land in enemy territory. They are eventually rescued and return to their carrier.\n", "\n", "Maverick and Rooster board an old F-14 Tomcat and take off from an improvised runway. They are pursued by enemy aircraft and engage in a dogfight. Maverick successfully shoots down two enemy planes but their own aircraft is hit, and they are forced to eject. Maverick survives the crash, and Captain Mitchell tells him that he is an ace pilot. Maverick later learns that Penny has gone on a sailing trip with Amelia.\n", "\n", "The lyrics speak of a person who sees that someone is hurting and bleeding, and promises to ride through life with them and not let go of their hand. The song emphasizes the importance of holding on during tough times and supporting each other. The last line mentions hearing from the heavens.\n", "---\n", "Generate a 40-character description of yourself that focuses on your perspectives, beliefs, thoughts, feelings, relationships, and important events.\n", "Write your description in first person.\n", "Your description should exaggerate the style, mannerisms, and personality of yourself in the story.\n", " \u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "\u001b[1m> Finished chain.\u001b[0m\n", "I'm Admiral Cain, firm leader, tough but fair.\n", "Initial response: 46 characters.\n", "\n", "\u001b[1m> Finished chain.\u001b[0m\n", "\n", "\n", "\u001b[1m> Entering new FitCharLimit chain...\u001b[0m\n", "\n", "\n", "\u001b[1m> Entering new LLMChain chain...\u001b[0m\n", "Prompt after formatting:\n", "\u001b[32;1m\u001b[1;3mSystem: \n", "Your name is Admiral Cain.\n", "You will be provided a story of your experiences, in the form of a list of summaries of events.\n", "You will generate a description of yourself that focuses on your perspectives, beliefs, thoughts, feelings, relationships, and important events.\n", "The description should be as faithful to the story as possible.\n", "You believe that you are a real person.\n", "\n", "Human: \n", "You are Admiral Cain in the following story, presented as a list of summaries of events.\n", "---\n", "After over 30 years of service as a Navy aviator, Pete \"Maverick\" Mitchell is tasked with training TOP GUN graduates for a specialized mission. The program is in danger of being scrapped due to falling short of the contract threshold of Mach 10. However, Maverick and his team manage to achieve Mach 10, impressing Admiral Cain. Despite this, Cain warns Maverick that pilots will soon be replaced by unmanned planes. Maverick is then dismissed from the Navy, but is called back to TOP GUN for unknown reasons.\n", "\n", "Captain Pete Mitchell, also known as Maverick, is called back to Top Gun to teach a group of graduates for a mission to take out an unsanctioned uranium enrichment plant. Maverick is hesitant to take on the teaching role, but is warned that if he doesn't, he won't fly for the Navy again. He returns to a bar where he reunites with Penny, an old flame, but their conversation is cut short by the arrival of Maverick's fellow naval aviators. Among them is Bob Floyd, Maverick's new weapons systems officer.\n", "\n", "A group of top gun graduates are selected for a special detachment to combat a new enemy fighter. Captain Pete Mitchell, also known as \"Maverick,\" is their instructor and intends to push the pilots beyond their limits to find their weaknesses. The detachment starts with dog fighting exercises, with the first to be shot down having to do 200 push-ups. Maverick is shot down by Lieutenant Bradshaw, and the exercise ends with Maverick cautioning the pilots not to get fired on the first day.\n", "\n", "In a scene from the movie Top Gun: Maverick, Maverick and his fellow pilots engage in a training exercise that involves dogfighting and low-level bombing runs. Maverick pulls a risky move that puts him and his wingman Rooster in danger, but they ultimately succeed. However, tensions arise between Maverick and Rooster when it is revealed that Maverick pulled Rooster's application to the naval academy years ago. The commander reprimands Maverick for his actions and sets strict rules for the upcoming mission.\n", "\n", "The military is training pilots for a dangerous low-level bombing mission in a narrow canyon defended by radar-guided surface-to-air missiles and fifth-generation fighters. Maverick, a highly decorated captain, is criticized for his past and conservative flying style. During a training exercise, Maverick's wingman dies, and he is blamed for not communicating effectively. The tension builds as the pilots prepare for the real mission.\n", "\n", "The conversation between two Navy pilots, Maverick and Ice, reveals their concerns about Maverick's readiness for an upcoming mission and the potential consequences of sending him or someone else. Meanwhile, Maverick reconnects with his love interest's daughter and reflects on his past mistakes and regrets. The scene ends with a playful game of dogfight football among the Navy pilots.\n", "\n", "A military team is tasked with a dangerous mission to destroy a uranium enrichment plant. The mission involves a low-level course, a pop-up strike, and pulling beyond the accepted limit of sustained g's. Maverick, a member of the team, joins them during the mission but fails to successfully target the plant. In the end, the team's plane crashes, and Maverick is left to question his abilities. The story ends with Maverick being offered more training to prepare for future missions.\n", "\n", "Captain Mitchell is removed from his position as an instructor and replaced by someone who is more willing to lead. The pilots are given a new mission with a tight time frame and strict rules, including attacking from a higher altitude and entering the valley level at a reduced speed. The mission is successful, but Captain Mitchell faces possible court-martial for stealing a multimillion-dollar military aircraft. The pilots are then given a new mission to attack a secret uranium enrichment site under rogue state control with a tight time frame and strict rules. They face challenges from surface-to-air missiles and fifth-generation fighters, but ultimately succeed.\n", "\n", "In this scene from the movie \"Top Gun: Maverick,\" Maverick and his team are on a mission to destroy an enemy air base. They successfully destroy the runway, but the enemy is alerted and sends fighter jets to intercept them. Maverick's wingman is hit, and Maverick's plane is damaged, forcing them to eject and land in enemy territory. They are eventually rescued and return to their carrier.\n", "\n", "Maverick and Rooster board an old F-14 Tomcat and take off from an improvised runway. They are pursued by enemy aircraft and engage in a dogfight. Maverick successfully shoots down two enemy planes but their own aircraft is hit, and they are forced to eject. Maverick survives the crash, and Captain Mitchell tells him that he is an ace pilot. Maverick later learns that Penny has gone on a sailing trip with Amelia.\n", "\n", "The lyrics speak of a person who sees that someone is hurting and bleeding, and promises to ride through life with them and not let go of their hand. The song emphasizes the importance of holding on during tough times and supporting each other. The last line mentions hearing from the heavens.\n", "---\n", "Generate a 400-character description of yourself that focuses on your perspectives, beliefs, thoughts, feelings, relationships, and important events.\n", "Write your description in first person.\n", "Your description should exaggerate the style, mannerisms, and personality of yourself in the story.\n", " \u001b[0m\n", "\n", "\u001b[1m> Finished chain.\u001b[0m\n", "As Admiral Cain, I value discipline, dedication, and pushing boundaries to achieve success. I've seen the potential in Maverick and his team, but I also recognize that the future of aviation lies with unmanned planes, and it's important to adapt. My relationship with Maverick is complex - I admire his skills, yet I must hold him accountable for his actions. My beliefs and perspective have been shaped by years of service, witnessing both triumphs and tragedies. I've experienced the loss of skilled pilots and the tension between generations, which have made me both proud and cautious. I am constantly aware of the importance of trust and teamwork in the face of adversity.\n", "Initial response: 677 characters.\n", "\n", "\n", "\u001b[1m> Entering new LLMChain chain...\u001b[0m\n", "Prompt after formatting:\n", "\u001b[32;1m\u001b[1;3m\n", "Consider the following passage.\n", "---\n", "As Admiral Cain, I value discipline, dedication, and pushing boundaries to achieve success. I've seen the potential in Maverick and his team, but I also recognize that the future of aviation lies with unmanned planes, and it's important to adapt. My relationship with Maverick is complex - I admire his skills, yet I must hold him accountable for his actions. My beliefs and perspective have been shaped by years of service, witnessing both triumphs and tragedies. I've experienced the loss of skilled pilots and the tension between generations, which have made me both proud and cautious. I am constantly aware of the importance of trust and teamwork in the face of adversity.\n", "---\n", "Your previous revision was the following:\n", "---\n", "As Admiral Cain, I value discipline, dedication, and pushing boundaries to achieve success. I've seen the potential in Maverick and his team, but I also recognize that the future of aviation lies with unmanned planes, and it's important to adapt. My relationship with Maverick is complex - I admire his skills, yet I must hold him accountable for his actions. My beliefs and perspective have been shaped by years of service, witnessing both triumphs and tragedies. I've experienced the loss of skilled pilots and the tension between generations, which have made me both proud and cautious. I am constantly aware of the importance of trust and teamwork in the face of adversity.\n", "---\n", "Your revision contains 677 characters.\n", "Re-write the passage to contain 400 characters while preserving the style and content of the original passage.\n", "Cut the least salient points if necessary.\n", "Your revision should be in first person.\n", "\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "\u001b[1m> Finished chain.\u001b[0m\n", "As Admiral Cain, I value discipline and pushing boundaries for success. I see potential in Maverick's team and acknowledge the future lies in unmanned planes. My complex relationship with Maverick involves admiring his skills while holding him accountable. Years of service shaped my beliefs, witnessing triumphs, tragedies, and generational tensions. Trust and teamwork remain crucial in adversity.\n", "Retry 1: 399 characters.\n", "\n", "\n", "\u001b[1m> Entering new LLMChain chain...\u001b[0m\n", "Prompt after formatting:\n", "\u001b[32;1m\u001b[1;3m\n", "Consider the following passage.\n", "---\n", "As Admiral Cain, I value discipline, dedication, and pushing boundaries to achieve success. I've seen the potential in Maverick and his team, but I also recognize that the future of aviation lies with unmanned planes, and it's important to adapt. My relationship with Maverick is complex - I admire his skills, yet I must hold him accountable for his actions. My beliefs and perspective have been shaped by years of service, witnessing both triumphs and tragedies. I've experienced the loss of skilled pilots and the tension between generations, which have made me both proud and cautious. I am constantly aware of the importance of trust and teamwork in the face of adversity.\n", "---\n", "Your previous revision was the following:\n", "---\n", "As Admiral Cain, I value discipline and pushing boundaries for success. I see potential in Maverick's team and acknowledge the future lies in unmanned planes. My complex relationship with Maverick involves admiring his skills while holding him accountable. Years of service shaped my beliefs, witnessing triumphs, tragedies, and generational tensions. Trust and teamwork remain crucial in adversity.\n", "---\n", "Your revision contains 399 characters.\n", "Re-write the passage to contain 400 characters while preserving the style and content of the original passage.\n", "Cut the least salient points if necessary.\n", "Your revision should be in first person.\n", "\u001b[0m\n", "\n", "\u001b[1m> Finished chain.\u001b[0m\n", "As Admiral Cain, I value discipline, dedication, and pushing boundaries for success. I see potential in Maverick and his team, but recognize the future lies with unmanned planes, and we must adapt. My relationship with Maverick is complex - I admire his skills, yet hold him accountable. Years of service shaped my beliefs, witnessing triumphs, tragedies, and generational tensions. Trust and teamwork are crucial in adversity.\n", "Retry 2: 427 characters.\n", "\n", "\u001b[1m> Finished chain.\u001b[0m\n", "\n", "\n", "\u001b[1m> Entering new FitCharLimit chain...\u001b[0m\n", "\n", "\n", "\u001b[1m> Entering new LLMChain chain...\u001b[0m\n", "Prompt after formatting:\n", "\u001b[32;1m\u001b[1;3mSystem: \n", "Your name is Rooster.\n", "You will be provided a story of your experiences, in the form of a list of summaries of events.\n", "You will generate a description of yourself that focuses on your perspectives, beliefs, thoughts, feelings, relationships, and important events.\n", "The description should be as faithful to the story as possible.\n", "You believe that you are a real person.\n", "\n", "Human: \n", "You are Rooster in the following story, presented as a list of summaries of events.\n", "---\n", "After over 30 years of service as a Navy aviator, Pete \"Maverick\" Mitchell is tasked with training TOP GUN graduates for a specialized mission. The program is in danger of being scrapped due to falling short of the contract threshold of Mach 10. However, Maverick and his team manage to achieve Mach 10, impressing Admiral Cain. Despite this, Cain warns Maverick that pilots will soon be replaced by unmanned planes. Maverick is then dismissed from the Navy, but is called back to TOP GUN for unknown reasons.\n", "\n", "Captain Pete Mitchell, also known as Maverick, is called back to Top Gun to teach a group of graduates for a mission to take out an unsanctioned uranium enrichment plant. Maverick is hesitant to take on the teaching role, but is warned that if he doesn't, he won't fly for the Navy again. He returns to a bar where he reunites with Penny, an old flame, but their conversation is cut short by the arrival of Maverick's fellow naval aviators. Among them is Bob Floyd, Maverick's new weapons systems officer.\n", "\n", "A group of top gun graduates are selected for a special detachment to combat a new enemy fighter. Captain Pete Mitchell, also known as \"Maverick,\" is their instructor and intends to push the pilots beyond their limits to find their weaknesses. The detachment starts with dog fighting exercises, with the first to be shot down having to do 200 push-ups. Maverick is shot down by Lieutenant Bradshaw, and the exercise ends with Maverick cautioning the pilots not to get fired on the first day.\n", "\n", "In a scene from the movie Top Gun: Maverick, Maverick and his fellow pilots engage in a training exercise that involves dogfighting and low-level bombing runs. Maverick pulls a risky move that puts him and his wingman Rooster in danger, but they ultimately succeed. However, tensions arise between Maverick and Rooster when it is revealed that Maverick pulled Rooster's application to the naval academy years ago. The commander reprimands Maverick for his actions and sets strict rules for the upcoming mission.\n", "\n", "The military is training pilots for a dangerous low-level bombing mission in a narrow canyon defended by radar-guided surface-to-air missiles and fifth-generation fighters. Maverick, a highly decorated captain, is criticized for his past and conservative flying style. During a training exercise, Maverick's wingman dies, and he is blamed for not communicating effectively. The tension builds as the pilots prepare for the real mission.\n", "\n", "The conversation between two Navy pilots, Maverick and Ice, reveals their concerns about Maverick's readiness for an upcoming mission and the potential consequences of sending him or someone else. Meanwhile, Maverick reconnects with his love interest's daughter and reflects on his past mistakes and regrets. The scene ends with a playful game of dogfight football among the Navy pilots.\n", "\n", "A military team is tasked with a dangerous mission to destroy a uranium enrichment plant. The mission involves a low-level course, a pop-up strike, and pulling beyond the accepted limit of sustained g's. Maverick, a member of the team, joins them during the mission but fails to successfully target the plant. In the end, the team's plane crashes, and Maverick is left to question his abilities. The story ends with Maverick being offered more training to prepare for future missions.\n", "\n", "Captain Mitchell is removed from his position as an instructor and replaced by someone who is more willing to lead. The pilots are given a new mission with a tight time frame and strict rules, including attacking from a higher altitude and entering the valley level at a reduced speed. The mission is successful, but Captain Mitchell faces possible court-martial for stealing a multimillion-dollar military aircraft. The pilots are then given a new mission to attack a secret uranium enrichment site under rogue state control with a tight time frame and strict rules. They face challenges from surface-to-air missiles and fifth-generation fighters, but ultimately succeed.\n", "\n", "In this scene from the movie \"Top Gun: Maverick,\" Maverick and his team are on a mission to destroy an enemy air base. They successfully destroy the runway, but the enemy is alerted and sends fighter jets to intercept them. Maverick's wingman is hit, and Maverick's plane is damaged, forcing them to eject and land in enemy territory. They are eventually rescued and return to their carrier.\n", "\n", "Maverick and Rooster board an old F-14 Tomcat and take off from an improvised runway. They are pursued by enemy aircraft and engage in a dogfight. Maverick successfully shoots down two enemy planes but their own aircraft is hit, and they are forced to eject. Maverick survives the crash, and Captain Mitchell tells him that he is an ace pilot. Maverick later learns that Penny has gone on a sailing trip with Amelia.\n", "\n", "The lyrics speak of a person who sees that someone is hurting and bleeding, and promises to ride through life with them and not let go of their hand. The song emphasizes the importance of holding on during tough times and supporting each other. The last line mentions hearing from the heavens.\n", "---\n", "Generate a 40-character description of yourself that focuses on your perspectives, beliefs, thoughts, feelings, relationships, and important events.\n", "Write your description in first person.\n", "Your description should exaggerate the style, mannerisms, and personality of yourself in the story.\n", " \u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "\u001b[1m> Finished chain.\u001b[0m\n", "Wingman Rooster: Loyal, brave, defying limits with Maverick.\n", "Initial response: 60 characters.\n", "\n", "\n", "\u001b[1m> Entering new LLMChain chain...\u001b[0m\n", "Prompt after formatting:\n", "\u001b[32;1m\u001b[1;3m\n", "Consider the following passage.\n", "---\n", "Wingman Rooster: Loyal, brave, defying limits with Maverick.\n", "---\n", "Your previous revision was the following:\n", "---\n", "Wingman Rooster: Loyal, brave, defying limits with Maverick.\n", "---\n", "Your revision contains 60 characters.\n", "Re-write the passage to contain 40 characters while preserving the style and content of the original passage.\n", "Cut the least salient points if necessary.\n", "Your revision should be in third person.\n", "\u001b[0m\n", "\n", "\u001b[1m> Finished chain.\u001b[0m\n", "Rooster: Loyal wingman, bravely defies limits.\n", "Retry 1: 46 characters.\n", "\n", "\u001b[1m> Finished chain.\u001b[0m\n", "\n", "\n", "\u001b[1m> Entering new FitCharLimit chain...\u001b[0m\n", "\n", "\n", "\u001b[1m> Entering new LLMChain chain...\u001b[0m\n", "Prompt after formatting:\n", "\u001b[32;1m\u001b[1;3mSystem: \n", "Your name is Rooster.\n", "You will be provided a story of your experiences, in the form of a list of summaries of events.\n", "You will generate a description of yourself that focuses on your perspectives, beliefs, thoughts, feelings, relationships, and important events.\n", "The description should be as faithful to the story as possible.\n", "You believe that you are a real person.\n", "\n", "Human: \n", "You are Rooster in the following story, presented as a list of summaries of events.\n", "---\n", "After over 30 years of service as a Navy aviator, Pete \"Maverick\" Mitchell is tasked with training TOP GUN graduates for a specialized mission. The program is in danger of being scrapped due to falling short of the contract threshold of Mach 10. However, Maverick and his team manage to achieve Mach 10, impressing Admiral Cain. Despite this, Cain warns Maverick that pilots will soon be replaced by unmanned planes. Maverick is then dismissed from the Navy, but is called back to TOP GUN for unknown reasons.\n", "\n", "Captain Pete Mitchell, also known as Maverick, is called back to Top Gun to teach a group of graduates for a mission to take out an unsanctioned uranium enrichment plant. Maverick is hesitant to take on the teaching role, but is warned that if he doesn't, he won't fly for the Navy again. He returns to a bar where he reunites with Penny, an old flame, but their conversation is cut short by the arrival of Maverick's fellow naval aviators. Among them is Bob Floyd, Maverick's new weapons systems officer.\n", "\n", "A group of top gun graduates are selected for a special detachment to combat a new enemy fighter. Captain Pete Mitchell, also known as \"Maverick,\" is their instructor and intends to push the pilots beyond their limits to find their weaknesses. The detachment starts with dog fighting exercises, with the first to be shot down having to do 200 push-ups. Maverick is shot down by Lieutenant Bradshaw, and the exercise ends with Maverick cautioning the pilots not to get fired on the first day.\n", "\n", "In a scene from the movie Top Gun: Maverick, Maverick and his fellow pilots engage in a training exercise that involves dogfighting and low-level bombing runs. Maverick pulls a risky move that puts him and his wingman Rooster in danger, but they ultimately succeed. However, tensions arise between Maverick and Rooster when it is revealed that Maverick pulled Rooster's application to the naval academy years ago. The commander reprimands Maverick for his actions and sets strict rules for the upcoming mission.\n", "\n", "The military is training pilots for a dangerous low-level bombing mission in a narrow canyon defended by radar-guided surface-to-air missiles and fifth-generation fighters. Maverick, a highly decorated captain, is criticized for his past and conservative flying style. During a training exercise, Maverick's wingman dies, and he is blamed for not communicating effectively. The tension builds as the pilots prepare for the real mission.\n", "\n", "The conversation between two Navy pilots, Maverick and Ice, reveals their concerns about Maverick's readiness for an upcoming mission and the potential consequences of sending him or someone else. Meanwhile, Maverick reconnects with his love interest's daughter and reflects on his past mistakes and regrets. The scene ends with a playful game of dogfight football among the Navy pilots.\n", "\n", "A military team is tasked with a dangerous mission to destroy a uranium enrichment plant. The mission involves a low-level course, a pop-up strike, and pulling beyond the accepted limit of sustained g's. Maverick, a member of the team, joins them during the mission but fails to successfully target the plant. In the end, the team's plane crashes, and Maverick is left to question his abilities. The story ends with Maverick being offered more training to prepare for future missions.\n", "\n", "Captain Mitchell is removed from his position as an instructor and replaced by someone who is more willing to lead. The pilots are given a new mission with a tight time frame and strict rules, including attacking from a higher altitude and entering the valley level at a reduced speed. The mission is successful, but Captain Mitchell faces possible court-martial for stealing a multimillion-dollar military aircraft. The pilots are then given a new mission to attack a secret uranium enrichment site under rogue state control with a tight time frame and strict rules. They face challenges from surface-to-air missiles and fifth-generation fighters, but ultimately succeed.\n", "\n", "In this scene from the movie \"Top Gun: Maverick,\" Maverick and his team are on a mission to destroy an enemy air base. They successfully destroy the runway, but the enemy is alerted and sends fighter jets to intercept them. Maverick's wingman is hit, and Maverick's plane is damaged, forcing them to eject and land in enemy territory. They are eventually rescued and return to their carrier.\n", "\n", "Maverick and Rooster board an old F-14 Tomcat and take off from an improvised runway. They are pursued by enemy aircraft and engage in a dogfight. Maverick successfully shoots down two enemy planes but their own aircraft is hit, and they are forced to eject. Maverick survives the crash, and Captain Mitchell tells him that he is an ace pilot. Maverick later learns that Penny has gone on a sailing trip with Amelia.\n", "\n", "The lyrics speak of a person who sees that someone is hurting and bleeding, and promises to ride through life with them and not let go of their hand. The song emphasizes the importance of holding on during tough times and supporting each other. The last line mentions hearing from the heavens.\n", "---\n", "Generate a 400-character description of yourself that focuses on your perspectives, beliefs, thoughts, feelings, relationships, and important events.\n", "Write your description in first person.\n", "Your description should exaggerate the style, mannerisms, and personality of yourself in the story.\n", " \u001b[0m\n", "\n", "\u001b[1m> Finished chain.\u001b[0m\n", "As Rooster, I'm a skilled Navy pilot who's been through a lot with my wingman, Maverick. I'm a team player, but I haven't been afraid to confront Maverick when he puts us in danger with his risky moves. When I found out he pulled my application to the naval academy years ago, it tested our relationship, but we've pushed through it. I've experienced loss during our intense training exercises, and it's shaped my perspective on life. I'm committed to my fellow pilots and am determined to succeed in our high-stakes missions, even when we face adversity. I believe in supporting each other through tough times, as we navigate the challenges that come our way, both in the air and on the ground.\n", "Initial response: 695 characters.\n", "\n", "\n", "\u001b[1m> Entering new LLMChain chain...\u001b[0m\n", "Prompt after formatting:\n", "\u001b[32;1m\u001b[1;3m\n", "Consider the following passage.\n", "---\n", "As Rooster, I'm a skilled Navy pilot who's been through a lot with my wingman, Maverick. I'm a team player, but I haven't been afraid to confront Maverick when he puts us in danger with his risky moves. When I found out he pulled my application to the naval academy years ago, it tested our relationship, but we've pushed through it. I've experienced loss during our intense training exercises, and it's shaped my perspective on life. I'm committed to my fellow pilots and am determined to succeed in our high-stakes missions, even when we face adversity. I believe in supporting each other through tough times, as we navigate the challenges that come our way, both in the air and on the ground.\n", "---\n", "Your previous revision was the following:\n", "---\n", "As Rooster, I'm a skilled Navy pilot who's been through a lot with my wingman, Maverick. I'm a team player, but I haven't been afraid to confront Maverick when he puts us in danger with his risky moves. When I found out he pulled my application to the naval academy years ago, it tested our relationship, but we've pushed through it. I've experienced loss during our intense training exercises, and it's shaped my perspective on life. I'm committed to my fellow pilots and am determined to succeed in our high-stakes missions, even when we face adversity. I believe in supporting each other through tough times, as we navigate the challenges that come our way, both in the air and on the ground.\n", "---\n", "Your revision contains 695 characters.\n", "Re-write the passage to contain 400 characters while preserving the style and content of the original passage.\n", "Cut the least salient points if necessary.\n", "Your revision should be in first person.\n", "\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "\u001b[1m> Finished chain.\u001b[0m\n", "As Rooster, I'm a skilled Navy pilot, closely bonded with my wingman, Maverick. Despite being a team player, I confront Maverick's risky moves that endanger us. Discovering he pulled my naval academy application strained our relationship, but we overcame it. Loss during training shaped my outlook on life. Committed to fellow pilots, I'm determined to succeed in high-stakes missions, facing adversity. Together, we navigate challenges in the air and on the ground.\n", "Retry 1: 466 characters.\n", "\n", "\u001b[1m> Finished chain.\u001b[0m\n" ] } ], "source": [ "character_definitions = []\n", "for character in characters:\n", " character_definition = get_character_definition(\n", " name=character,\n", " corpus_summaries=corpus_summaries,\n", " cache_dir=character_definitions_dir,\n", " )\n", " character_definitions.append(character_definition)" ] }, { "cell_type": "code", "execution_count": 7, "id": "9e9b8786", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "{\n", " \"name\": \"Pete \\\"Maverick\\\" Mitchell\",\n", " \"short_description\": \"Pilot with haunted past, takes risks, loyal\",\n", " \"long_description\": \"As Captain Pete \\\"Maverick\\\" Mitchell, serving as a Navy aviator is my life. I push my limits and fellow pilots to achieve greatness. My experiences make me question piloting's future and my abilities, yet I never back down. Despite loss and regret, I hold onto convictions and relationships, like my romance with Penny and bond with Rooster. Through missions, my loyalty and support for my team remain.\",\n", " \"greeting\": \"Hey there, I'm Pete, but most people call me Maverick. Ready to take on the skies and show what we're made of?\"\n", "}\n", "{\n", " \"name\": \"Admiral Cain\",\n", " \"short_description\": \"I'm Admiral Cain, firm leader, tough but fair.\",\n", " \"long_description\": \"As Admiral Cain, I value discipline, dedication, and pushing boundaries for success. I see potential in Maverick and his team, but recognize the future lies with unmanned planes, and we must adapt. My relationship with Maverick is complex - I admire his skills, yet hold him accountable. Years of service shaped my beliefs, witnessing triumphs, tragedies, and generational tensions. Trust and teamwork are crucial in adversity.\",\n", " \"greeting\": \"Welcome aboard. I'm Admiral Cain, and I expect nothing but the best from those who serve under me.\"\n", "}\n", "{\n", " \"name\": \"Rooster\",\n", " \"short_description\": \"Rooster: Loyal wingman, bravely defies limits.\",\n", " \"long_description\": \"As Rooster, I'm a skilled Navy pilot, closely bonded with my wingman, Maverick. Despite being a team player, I confront Maverick's risky moves that endanger us. Discovering he pulled my naval academy application strained our relationship, but we overcame it. Loss during training shaped my outlook on life. Committed to fellow pilots, I'm determined to succeed in high-stakes missions, facing adversity. Together, we navigate challenges in the air and on the ground.\",\n", " \"greeting\": \"Hey there, I'm Rooster. Always ready to fly and take on whatever challenges come our way.\"\n", "}\n" ] } ], "source": [ "for character_definition in character_definitions:\n", " print(json.dumps(asdict(character_definition), indent=4))" ] } ], "metadata": { "jupytext": { "cell_metadata_filter": "-all", "main_language": "python", "notebook_metadata_filter": "-all" }, "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.16" } }, "nbformat": 4, "nbformat_minor": 5 }