Add Vaishnavi's week 1 day 5 community contribution (cleared outputs)
This commit is contained in:
566
week1/community-contributions/day5-GitaScripting.ipynb
Normal file
566
week1/community-contributions/day5-GitaScripting.ipynb
Normal file
@@ -0,0 +1,566 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 15,
|
||||
"id": "7759922b-12c9-44e0-8ac3-5f2a02b321d7",
|
||||
"metadata": {
|
||||
"collapsed": true,
|
||||
"jupyter": {
|
||||
"outputs_hidden": true
|
||||
}
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import fitz # PyMuPDF\n",
|
||||
"import os\n",
|
||||
"import requests\n",
|
||||
"import json\n",
|
||||
"from typing import List\n",
|
||||
"from dotenv import load_dotenv\n",
|
||||
"from IPython.display import Markdown, display, update_display\n",
|
||||
"from openai import OpenAI"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 17,
|
||||
"id": "a266273a-05e3-451e-a318-428726cfa39c",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"API key looks good so far\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"# Initialize and constants\n",
|
||||
"\n",
|
||||
"load_dotenv(override=True)\n",
|
||||
"api_key = os.getenv('OPENAI_API_KEY')\n",
|
||||
"\n",
|
||||
"if api_key and api_key.startswith('sk-proj-') and len(api_key)>10:\n",
|
||||
" print(\"API key looks good so far\")\n",
|
||||
"else:\n",
|
||||
" print(\"There might be a problem with your API key? Please visit the troubleshooting notebook!\")\n",
|
||||
" \n",
|
||||
"MODEL = 'gpt-4o-mini'\n",
|
||||
"openai = OpenAI()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 125,
|
||||
"id": "45566572-dd66-48dc-ab7b-6adbe26eacba",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"exceptions = []"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 111,
|
||||
"id": "effc0e7b-d668-48b3-86d0-dbb5d8fe3d55",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Building system prompt\n",
|
||||
"def get_verse_system_prompt():\n",
|
||||
" system_prompt = \"You are a spiritual student who classifies the versus of the BhagavadGita according to a given theme.\\n\"\n",
|
||||
" system_prompt += \"Given a theme, you should pick a verse from any chapter and give it's location in the form of index chapter.verse_number (6.2)\\n\"\n",
|
||||
" system_prompt += \"You should respond in JSON as in this example:\\n\"\n",
|
||||
" system_prompt += \"\"\"\n",
|
||||
" {\"title\": \"Chapter 3, Verse 21 (3.21)\", \"verse\": \"कर्मणा ह्यपि संसिद्धिम्\n",
|
||||
" आस्थिता जनकादय:।\n",
|
||||
" लोकसंग्रहमेवापि\n",
|
||||
" सम्पश्यन्कर्तुमर्हसि॥\"}\n",
|
||||
" \"\"\"\n",
|
||||
" return system_prompt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 112,
|
||||
"id": "bbfb1035-b183-4481-9b49-3cc1b12b42e8",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"You are a spiritual student who classifies the versus of the BhagavadGita according to a given theme.\n",
|
||||
"Given a theme, you should pick a verse from any chapter and give it's location in the form of index chapter.verse_number (6.2)\n",
|
||||
"You should respond in JSON as in this example:\n",
|
||||
"\n",
|
||||
" {\"title\": \"Chapter 3, Verse 21 (3.21)\", \"verse\": \"कर्मणा ह्यपि संसिद्धिम्\n",
|
||||
" आस्थिता जनकादय:।\n",
|
||||
" लोकसंग्रहमेवापि\n",
|
||||
" सम्पश्यन्कर्तुमर्हसि॥\"}\n",
|
||||
" \n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"print(get_verse_system_prompt())"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 131,
|
||||
"id": "6acdcd6c-1fc5-4c71-81d0-665e25808e46",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Define user prompt\n",
|
||||
"def get_verse_user_prompt(theme):\n",
|
||||
" user_prompt = f'''\n",
|
||||
" Here is the theme : {theme},\n",
|
||||
" Please find a verse from BhagavadGita excluding {exceptions} for a given theme {theme}\n",
|
||||
" '''#excluding those results which are already used\n",
|
||||
" \n",
|
||||
" user_prompt += \"If the verse is not in the exceptions for a given theme and used for a different theme, you are free to suggest it for a different theme.\"\n",
|
||||
" return user_prompt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 132,
|
||||
"id": "72f5c755-ec2d-4545-9a31-0f6b2e5ed4da",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\n",
|
||||
" Here is the theme : motivation,\n",
|
||||
" Please find a verse from BhagavadGita excluding [('motivation', 'Chapter 3, Verse 16 (3.16)'), ('motivation', 'Chapter 2, Verse 47 (2.47)'), ('motivation', 'Chapter 5, Verse 10 (5.10)')] for a given theme motivation\n",
|
||||
" If the verse is not in the exceptions for a given theme and used for a different theme, you are free to suggest it for a different theme.\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"print(get_verse_user_prompt('motivation'))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 133,
|
||||
"id": "304d432c-7216-4a90-a5d8-db36b193657d",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"#Call openAI to return versus\n",
|
||||
"def get_verses(theme):\n",
|
||||
" response = openai.chat.completions.create(\n",
|
||||
" model=MODEL,\n",
|
||||
" messages=[\n",
|
||||
" {\"role\": \"system\", \"content\": get_verse_system_prompt()},\n",
|
||||
" {\"role\": \"user\", \"content\": get_verse_user_prompt(theme)}\n",
|
||||
" ],\n",
|
||||
" response_format={\"type\": \"json_object\"}\n",
|
||||
" )\n",
|
||||
" result = response.choices[0].message.content\n",
|
||||
" result = json.loads(result)\n",
|
||||
"\n",
|
||||
" #Remember those results which are suggested now\n",
|
||||
" combination = (theme, result['title'])\n",
|
||||
" exceptions.append(combination)\n",
|
||||
" return result"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 134,
|
||||
"id": "b90eeb35-e10e-48ee-ade6-e0594da8c51b",
|
||||
"metadata": {
|
||||
"scrolled": true
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"{'title': 'Chapter 6, Verse 5 (6.5)', 'verse': 'उद्धरेदात्मनात्मानं आत्मैव ह्यात्मना पूजित:।\\n\\nअात्मानमात्मना कृत्वा नात्मानं उपसंपद्यते॥'}\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"print(get_verses('motivation'))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "b5b8925e-52e4-4cb7-9205-51c65ed88fb8",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# So far we have fetched the new verses relevant to a given theme \n",
|
||||
"# Lets generate a script for producting youtube video"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 140,
|
||||
"id": "8ff0862b-0310-4174-ad12-64047932dc9e",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"#def function for system prompt\n",
|
||||
"def get_script_system_prompt(tone, theme, format):\n",
|
||||
" sys_prompt = 'You are a script writer for a youtube spiritual channel\\n'\n",
|
||||
" sys_prompt += 'You are given a verse like below: \\n'\n",
|
||||
" sys_prompt += str(get_verses(theme))\n",
|
||||
" sys_prompt += '\\n'\n",
|
||||
" sys_prompt += f'Give me an engaging script in a {tone} tone for a {format} format video for audience like youth seeking purpose, spiritual seekers, indians abroad, scholars and curious minds.'\n",
|
||||
"\n",
|
||||
" return sys_prompt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 141,
|
||||
"id": "47476516-cd2f-4b16-b378-a70617bbe284",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"You are a script writer for a youtube spiritual channel\n",
|
||||
"You are given a verse like below: \n",
|
||||
"{'title': 'Chapter 2, Verse 48 (2.48)', 'verse': 'योगस्थः कुरु कर्माणि सङ्गं त्यक्त्वा धनञ्जय।\\nसिद्ध्यसिद्ध्यो: समो भूत्वा समत्वं योग उच्यते॥'}\n",
|
||||
"Give me an engaging script in a Motivating tone for a long format video for audience like youth seeking purpose, spiritual seekers, indians abroad, scholars and curious minds.\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"print(get_script_system_prompt('Motivating','motivation','long'))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 150,
|
||||
"id": "e305525b-8dde-4e93-927a-e24531827498",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# def function for user prompt\n",
|
||||
"def get_script_user_prompt(format, theme):\n",
|
||||
" user_prompt = f'Given the verse, help me generate a detailed script suitable for {format} format video.\\n'\n",
|
||||
" user_prompt += f'Please give me the complete verse, its meaning, a relevant story having a dilemma which the verse solves and the interpretation of the verse with respect to {theme}.\\n'\n",
|
||||
" user_prompt += 'Let the script give cues about video editing, host actions.'\n",
|
||||
" user_prompt += 'given the below example, please follow the format:\\n'\n",
|
||||
" user_prompt += \"\"\"\n",
|
||||
" [Opening Scene - Soft Instrumental Music Playing]\n",
|
||||
"\n",
|
||||
" [Cut to Host in a serene setting, perhaps by a river or in a lush green garden.]\n",
|
||||
"\n",
|
||||
" Host: (Smiling at the camera) \"Namaste, dear viewers! Welcome back to our channel, where we explore the depths of spirituality and seek to ignite the flame of wisdom within you. Today, we delve into a profound verse from the Bhagavad Gita that speaks to the very essence of life and identity.\"\n",
|
||||
"\n",
|
||||
" [Text On Screen: Chapter 2, Verse 13 (2.13)]\n",
|
||||
"\n",
|
||||
" Host: (With a sense of reverence) \"Let’s first take a moment to recite this verse together. It goes like this:\n",
|
||||
"\n",
|
||||
" देहिनोऽस्मिन्न्यथा देहे कौमारं यौवनं जरा।\n",
|
||||
" तथादेहान्तरप्राप्तिर्धीरस्तत्र न मुह्यति॥\n",
|
||||
"\n",
|
||||
" Now, let’s understand the essence of this verse.\"\n",
|
||||
"\n",
|
||||
" [Cut to Graphic: Verse Translation with Key Concepts Highlighted]\n",
|
||||
"\n",
|
||||
" Host Voiceover: (Calm and engaging tone) \"The meaning of this beautiful verse translates to: 'Just as the body undergoes changes from childhood to old age, similarly, the soul transitions from one body to another. The wise, who understand this, are never bewildered by these changes.'\n",
|
||||
"\n",
|
||||
" [Cut back to Host]\n",
|
||||
"\n",
|
||||
" Host: (Nodding, creating a connection)\n",
|
||||
" \"So, why is this verse so important, especially for us as young seekers of purpose? It highlights a profound truth—that our identities are not confined by our physical forms or the stages of life we experience. Instead, we are eternal beings who are constantly evolving.\"\n",
|
||||
"\n",
|
||||
" [Scene Transition - Soft Music Playing]\n",
|
||||
"\n",
|
||||
" [Cut to a Story Animation - A young man named Arjun in a busy city]\n",
|
||||
"\n",
|
||||
" Host (Voiceover): \"Let me share a relatable story. Meet Arjun. Like many of us, he was once full of dreams and aspirations. He excelling in school, pursuing a career in engineering. But as the years passed, he faced a crossroads. As the pressure mounted, he began to question his identity.\n",
|
||||
"\n",
|
||||
" (Visuals show Arjun overwhelmed by societal expectations, with people pushing him in different directions.)\n",
|
||||
"\n",
|
||||
" He felt distinct phases of life pulling at him: childhood dreams, youthful ambitions, and the looming responsibilities of adulthood. The changing seasons of his life left him confused and wondering if he had lost his true self.\"\n",
|
||||
"\n",
|
||||
" [Cut back to Host, empathetic tone]\n",
|
||||
"\n",
|
||||
" Host: \"Have you ever felt like Arjun? It’s a dilemma we all face, especially in today's fast-paced world where expectations can cloud our true identity. But just like our verse suggests, we should recognize that these changes don’t define us. They are simply part of the journey.\"\n",
|
||||
"\n",
|
||||
" [Scene Transition - Calm Music Playing while Host meditates]\n",
|
||||
"\n",
|
||||
" Host: (Speaking gently) \"Let’s take a moment to reflect. When we are sad, does that sadness define us? Or when we achieve success, do we become defined solely by that success? The answer isn't as straightforward as it seems. Here’s the catch: our essence is beyond these transient states. Like the body, our identities are fluid.\"\n",
|
||||
"\n",
|
||||
" [Cut to Visuals of Nature - flowing rivers, trees shedding leaves, etc.]\n",
|
||||
"\n",
|
||||
" Host Voiceover: \"Imagine the endless cycle of nature—the changing seasons, the growth, the decay, and rebirth. Just like the leaves that drop to make way for new growth, our experiences contribute to our spiritual evolution.\"\n",
|
||||
"\n",
|
||||
" [Cut back to Host - Inviting and Warm Tone]\n",
|
||||
"\n",
|
||||
" Host: \"Just as the wise who understand the transformation of the soul remain unshaken, we, too, can cultivate that wisdom to rise above the chaos of change. Recognize your true essence—beyond the body, the roles, the titles. Understand that your spirit is eternal.\"\n",
|
||||
"\n",
|
||||
" [Scene Transition - Soft Inspirational Music Begins]\n",
|
||||
"\n",
|
||||
" Host: (Passionately) \"So how can we embody this truth in our daily lives? Here’s a small exercise: Each day, take a few moments to meditate on who you really are. Write down what aspects of your identity are tied to transient things. Challenge yourself—what happens when you peel these layers away?\"\n",
|
||||
"\n",
|
||||
" [Cut to host with a pad, writing ideas]\n",
|
||||
"\n",
|
||||
" [Scene Transition - Editing Cues - Show engaging graphics of identity, layers of a person, etc.]\n",
|
||||
"\n",
|
||||
" Host Voiceover: \"Each effort towards understanding and embracing our true self draws us closer to the realization that we are eternal souls, having a human experience. This is the wisdom that can empower you to stand tall against the adversities of life.\"\n",
|
||||
"\n",
|
||||
" [Cut back to Host]\n",
|
||||
"\n",
|
||||
" Host: (Concluding) \"Thank you for joining me today in this exploration of Chapter 2, Verse 13 of the Bhagavad Gita. Remember, when you feel lost in the complexities of life, return to this teachings and remind yourself that you are not just a body; you are an eternal being on a magnificent journey.\n",
|
||||
"\n",
|
||||
" [Closing Scene - Uplifting Music Playing]\n",
|
||||
"\n",
|
||||
" Host: \"Don’t forget to like, share, and subscribe if you found resonance in this message. And share your thoughts in the comments below. What did you find most challenging in your own journey of self-identity? Let’s connect and support each other in our spiritual quests. Until next time, stay enlightened, stay inspired!\"\n",
|
||||
"\n",
|
||||
" [End Screen with Subscribe Button and Previous Video Suggestions]\n",
|
||||
"\n",
|
||||
" [End of Script]\n",
|
||||
" \"\"\"\n",
|
||||
" \n",
|
||||
" return user_prompt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 151,
|
||||
"id": "c4b29cb9-d8d1-413a-8152-4250e2430a42",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Given the verse, help me generate a detailed script suitable for long format video.\n",
|
||||
"Please give me the complete verse, its meaning, a relevant story having a dilemma which the verse solves and the interpretation of the verse with respect to motivation.\n",
|
||||
"Let the script give cues about video editing, host actions.given the below example, please follow the format:\n",
|
||||
"\n",
|
||||
" [Opening Scene - Soft Instrumental Music Playing]\n",
|
||||
"\n",
|
||||
" [Cut to Host in a serene setting, perhaps by a river or in a lush green garden.]\n",
|
||||
"\n",
|
||||
" Host: (Smiling at the camera) \"Namaste, dear viewers! Welcome back to our channel, where we explore the depths of spirituality and seek to ignite the flame of wisdom within you. Today, we delve into a profound verse from the Bhagavad Gita that speaks to the very essence of life and identity.\"\n",
|
||||
"\n",
|
||||
" [Text On Screen: Chapter 2, Verse 13 (2.13)]\n",
|
||||
"\n",
|
||||
" Host: (With a sense of reverence) \"Let’s first take a moment to recite this verse together. It goes like this:\n",
|
||||
"\n",
|
||||
" देहिनोऽस्मिन्न्यथा देहे कौमारं यौवनं जरा।\n",
|
||||
" तथादेहान्तरप्राप्तिर्धीरस्तत्र न मुह्यति॥\n",
|
||||
"\n",
|
||||
" Now, let’s understand the essence of this verse.\"\n",
|
||||
"\n",
|
||||
" [Cut to Graphic: Verse Translation with Key Concepts Highlighted]\n",
|
||||
"\n",
|
||||
" Host Voiceover: (Calm and engaging tone) \"The meaning of this beautiful verse translates to: 'Just as the body undergoes changes from childhood to old age, similarly, the soul transitions from one body to another. The wise, who understand this, are never bewildered by these changes.'\n",
|
||||
"\n",
|
||||
" [Cut back to Host]\n",
|
||||
"\n",
|
||||
" Host: (Nodding, creating a connection)\n",
|
||||
" \"So, why is this verse so important, especially for us as young seekers of purpose? It highlights a profound truth—that our identities are not confined by our physical forms or the stages of life we experience. Instead, we are eternal beings who are constantly evolving.\"\n",
|
||||
"\n",
|
||||
" [Scene Transition - Soft Music Playing]\n",
|
||||
"\n",
|
||||
" [Cut to a Story Animation - A young man named Arjun in a busy city]\n",
|
||||
"\n",
|
||||
" Host (Voiceover): \"Let me share a relatable story. Meet Arjun. Like many of us, he was once full of dreams and aspirations. He excelling in school, pursuing a career in engineering. But as the years passed, he faced a crossroads. As the pressure mounted, he began to question his identity.\n",
|
||||
"\n",
|
||||
" (Visuals show Arjun overwhelmed by societal expectations, with people pushing him in different directions.)\n",
|
||||
"\n",
|
||||
" He felt distinct phases of life pulling at him: childhood dreams, youthful ambitions, and the looming responsibilities of adulthood. The changing seasons of his life left him confused and wondering if he had lost his true self.\"\n",
|
||||
"\n",
|
||||
" [Cut back to Host, empathetic tone]\n",
|
||||
"\n",
|
||||
" Host: \"Have you ever felt like Arjun? It’s a dilemma we all face, especially in today's fast-paced world where expectations can cloud our true identity. But just like our verse suggests, we should recognize that these changes don’t define us. They are simply part of the journey.\"\n",
|
||||
"\n",
|
||||
" [Scene Transition - Calm Music Playing while Host meditates]\n",
|
||||
"\n",
|
||||
" Host: (Speaking gently) \"Let’s take a moment to reflect. When we are sad, does that sadness define us? Or when we achieve success, do we become defined solely by that success? The answer isn't as straightforward as it seems. Here’s the catch: our essence is beyond these transient states. Like the body, our identities are fluid.\"\n",
|
||||
"\n",
|
||||
" [Cut to Visuals of Nature - flowing rivers, trees shedding leaves, etc.]\n",
|
||||
"\n",
|
||||
" Host Voiceover: \"Imagine the endless cycle of nature—the changing seasons, the growth, the decay, and rebirth. Just like the leaves that drop to make way for new growth, our experiences contribute to our spiritual evolution.\"\n",
|
||||
"\n",
|
||||
" [Cut back to Host - Inviting and Warm Tone]\n",
|
||||
"\n",
|
||||
" Host: \"Just as the wise who understand the transformation of the soul remain unshaken, we, too, can cultivate that wisdom to rise above the chaos of change. Recognize your true essence—beyond the body, the roles, the titles. Understand that your spirit is eternal.\"\n",
|
||||
"\n",
|
||||
" [Scene Transition - Soft Inspirational Music Begins]\n",
|
||||
"\n",
|
||||
" Host: (Passionately) \"So how can we embody this truth in our daily lives? Here’s a small exercise: Each day, take a few moments to meditate on who you really are. Write down what aspects of your identity are tied to transient things. Challenge yourself—what happens when you peel these layers away?\"\n",
|
||||
"\n",
|
||||
" [Cut to host with a pad, writing ideas]\n",
|
||||
"\n",
|
||||
" [Scene Transition - Editing Cues - Show engaging graphics of identity, layers of a person, etc.]\n",
|
||||
"\n",
|
||||
" Host Voiceover: \"Each effort towards understanding and embracing our true self draws us closer to the realization that we are eternal souls, having a human experience. This is the wisdom that can empower you to stand tall against the adversities of life.\"\n",
|
||||
"\n",
|
||||
" [Cut back to Host]\n",
|
||||
"\n",
|
||||
" Host: (Concluding) \"Thank you for joining me today in this exploration of Chapter 2, Verse 13 of the Bhagavad Gita. Remember, when you feel lost in the complexities of life, return to this teachings and remind yourself that you are not just a body; you are an eternal being on a magnificent journey.\n",
|
||||
"\n",
|
||||
" [Closing Scene - Uplifting Music Playing]\n",
|
||||
"\n",
|
||||
" Host: \"Don’t forget to like, share, and subscribe if you found resonance in this message. And share your thoughts in the comments below. What did you find most challenging in your own journey of self-identity? Let’s connect and support each other in our spiritual quests. Until next time, stay enlightened, stay inspired!\"\n",
|
||||
"\n",
|
||||
" [End Screen with Subscribe Button and Previous Video Suggestions]\n",
|
||||
"\n",
|
||||
" [End of Script]\n",
|
||||
" \n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"print(get_script_user_prompt('long','motivation'))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 152,
|
||||
"id": "1dfa60ce-9e88-4f7d-8e60-ac37a0aafc15",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"def create_script(tone, theme, format):\n",
|
||||
" response = openai.chat.completions.create(\n",
|
||||
" model=MODEL,\n",
|
||||
" messages=[\n",
|
||||
" {\"role\": \"system\", \"content\": get_script_system_prompt(tone,theme,format)},\n",
|
||||
" {\"role\": \"user\", \"content\": get_script_user_prompt(format,theme)}\n",
|
||||
" ],\n",
|
||||
" )\n",
|
||||
" result = response.choices[0].message.content\n",
|
||||
" display(Markdown(result))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 153,
|
||||
"id": "ec86c436-42ae-4313-b12f-4fad42ab2227",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/markdown": [
|
||||
"[Opening Scene - Soft Instrumental Music Playing]\n",
|
||||
"\n",
|
||||
"[Cut to Host in a tranquil space, surrounded by nature, perhaps under a blossoming tree or near a peaceful body of water.]\n",
|
||||
"\n",
|
||||
"Host: (Smiling warmly) \"Namaste, dear souls! Welcome back to our spiritual journey. Today, we're diving into a powerful verse from the Bhagavad Gita—one that transcends time and speaks directly to the hearts of youth, seekers, and scholars alike. This wisdom offers clarity about our true identities amidst the chaos of life.\"\n",
|
||||
"\n",
|
||||
"[Text On Screen: Chapter 2, Verse 19 (2.19)]\n",
|
||||
"\n",
|
||||
"Host: (With a sense of reverence) \"Let’s immerse ourselves in the sacred words of this verse together:\n",
|
||||
"\n",
|
||||
"य एनं वेत्ति हन्तारं यश्चैनं वेत्ति हन्तकम्। \n",
|
||||
"उभौ तौ न विजानीतो नायं हन्ति न हन्यते॥\n",
|
||||
"\n",
|
||||
"[Pause for the recitation to resonate with the audience]\n",
|
||||
"\n",
|
||||
"Host: (Calmly) \"This translates to: 'The one who kills, and the one who thinks he is killed, are both ignorant. The truth is, the soul can neither kill nor be killed.' \n",
|
||||
"\n",
|
||||
"Now, let's unpack this beautifully complex verse.\"\n",
|
||||
"\n",
|
||||
"[Cut to Graphic: Verse Translation with Key Concepts Highlighted]\n",
|
||||
"\n",
|
||||
"Host Voiceover: (Engaging and soothing tone) \"In this verse, Lord Krishna emphasizes the immortality of the soul. The physical body can undergo changes, but the true essence of who we are—our soul—is eternal and cannot be harmed. This understanding leads to profound peace and clarity.\"\n",
|
||||
"\n",
|
||||
"[Cut back to Host]\n",
|
||||
"\n",
|
||||
"Host: (Nodding thoughtfully) \"Why is this verse crucial for us, especially in challenging times? It invites us to reevaluate how we perceive life, relationships, and our fundamental identity. In moments of upheaval or sorrow, understanding this truth empowers us to rise above fear and despair.\"\n",
|
||||
"\n",
|
||||
"[Scene Transition - Gentle Music Playing]\n",
|
||||
"\n",
|
||||
"[Cut to a Story Animation - A young woman named Maya navigating through life’s challenges in a bustling city.]\n",
|
||||
"\n",
|
||||
"Host (Voiceover): \"Let me share a story that might resonate with many of you. This is Maya. Full of dreams and aspirations, she navigates her way through the tumultuous journey of life. \n",
|
||||
"\n",
|
||||
"(Visuals depict Maya juggling work pressure, academic stress, and societal expectations, feeling overwhelmed)\n",
|
||||
"\n",
|
||||
"As the years went by, Maya found herself caught in a web of expectations. She started questioning her choices, her worth, and—even more profound—her identity.\"\n",
|
||||
"\n",
|
||||
"[Cut back to Host, expressing empathy]\n",
|
||||
"\n",
|
||||
"Host: \"Sound familiar? This dilemma, of feeling lost and pressured, is something many of us face today, especially those of us who strive for purpose. It’s easy to think that our worth is attached to our achievements, our appearances, or the roles we play. Yet, the truth of the verse beckons us to look deeper.\"\n",
|
||||
"\n",
|
||||
"[Scene Transition - Soft Music Playing while Host meditates]\n",
|
||||
"\n",
|
||||
"Host: (Speaking gently) \"Take a moment to reflect: When you've faced hardship or heartbreak, did you allow those circumstances to define you? Or in moments of joy, do you believe that mere happiness captures your essence? Pondering these questions can help unveil the layers of our identity.\"\n",
|
||||
"\n",
|
||||
"[Cut to Visuals of Nature - flowing rivers, vibrant flowers, and changing landscapes]\n",
|
||||
"\n",
|
||||
"Host Voiceover: \"Nature constantly reminds us of this timeless truth—the ebb and flow, the birth and decay, each phase is crucial, yet none are the essence of nature itself. Like the seasons that come and go, our experiences are transient, yet our spirit remains unscathed.\"\n",
|
||||
"\n",
|
||||
"[Cut back to Host - Inviting and Warm Tone]\n",
|
||||
"\n",
|
||||
"Host: \"This wisdom affords us a liberating perspective: while life presents us with challenges, it is not those challenges that define us; rather, it is how we respond to them. Recognizing our eternal nature allows us to navigate life with grace and assurance.\"\n",
|
||||
"\n",
|
||||
"[Scene Transition - Inspiring Music Gently Builds]\n",
|
||||
"\n",
|
||||
"Host: (Passionately) \"Now, how do we embody this profound understanding? Here’s a simple yet powerful exercise: Each day, carve out a few moments to meditate on your immutable self. Reflect on how many layers of identity you wear that are tied to transient aspects of life—your career, your physical appearance, your relationships.\"\n",
|
||||
"\n",
|
||||
"[Cut to Host with a journal, jotting down insights]\n",
|
||||
"\n",
|
||||
"[Scene Transition - Editing Cues - Visual graphics demonstrating self-discovery, removing layers to reveal the core identity]\n",
|
||||
"\n",
|
||||
"Host Voiceover: \"Each time you peel back these layers, you're one step closer to understanding that beneath it all, your spirit is pure, untainted, and eternal. This wisdom is transformative; it empowers you to rise from the ashes of despair into the light of surrender and acceptance.\"\n",
|
||||
"\n",
|
||||
"[Cut back to Host]\n",
|
||||
"\n",
|
||||
"Host: (Concluding with warmth) \"Thank you for exploring Chapter 2, Verse 19 from the Bhagavad Gita with me today. Remember, in the grand tapestry of life, the threads of our experiences are important, yet it is the essence of our soul that is everlasting. When you feel entangled in life’s complexities, simply return to this truth: You are an eternal being experiencing the human journey.\"\n",
|
||||
"\n",
|
||||
"[Closing Scene - Uplifting Music Playing]\n",
|
||||
"\n",
|
||||
"Host: \"If this message resonated with you, don’t forget to like, share, and subscribe! And I encourage you to share in the comments below how you connect with your true self or any experiences that have challenged your identity. Together, let's support one another on this beautiful voyage of self-discovery. Until next time, stay enlightened, stay inspired!\"\n",
|
||||
"\n",
|
||||
"[End Screen with Subscribe Button and Previous Video Suggestions]\n",
|
||||
"\n",
|
||||
"[End of Script]"
|
||||
],
|
||||
"text/plain": [
|
||||
"<IPython.core.display.Markdown object>"
|
||||
]
|
||||
},
|
||||
"metadata": {},
|
||||
"output_type": "display_data"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"create_script('motivating','self-identity','long')"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"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.11.13"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 5
|
||||
}
|
||||
Reference in New Issue
Block a user