1- import streamlit as st
1+ import streamlit as st
22from utils import generate_script
33
44# Applying Styling
1717
1818# Creating Session State Variable
1919if 'API_Key' not in st .session_state :
20- st .session_state ['API_Key' ] = ''
20+ st .session_state ['API_Key' ] = ''
2121
2222
23- st .title ('❤️ YouTube Script Writing Tool' )
23+ st .title ('❤️ YouTube Script Writing Tool' )
2424
2525# Sidebar to capture the OpenAi API key
2626st .sidebar .title ("😎🗝️" )
27- st .session_state ['API_Key' ]= st .sidebar .text_input ("What's your API key?" ,type = "password" )
28- st .sidebar .image ('./Youtube.jpg' ,width = 300 , use_column_width = True )
27+ st .session_state ['API_Key' ] = st .sidebar .text_input (
28+ "What's your API key?" , type = "password" )
29+ st .sidebar .image ('./Youtube.jpg' , width = 300 , use_column_width = True )
2930
3031
3132# Captures User Inputs
32- prompt = st .text_input ('Please provide the topic of the video' ,key = "prompt" ) # The box for the text prompt
33- video_length = st .text_input ('Expected Video Length 🕒 (in minutes)' ,key = "video_length" ) # The box for the text prompt
34- creativity = st .slider ('Words limit ✨ - (0 LOW || 1 HIGH)' , 0.0 , 1.0 , 0.2 ,step = 0.1 )
33+ # The box for the text prompt
34+ prompt = st .text_input ('Please provide the topic of the video' , key = "prompt" )
35+ # The box for the text prompt
36+ video_length = st .text_input (
37+ 'Expected Video Length 🕒 (in minutes)' , key = "video_length" )
38+ creativity = st .slider (
39+ 'Words limit ✨ - (0 LOW || 1 HIGH)' , 0.0 , 1.0 , 0.2 , step = 0.1 )
3540
3641submit = st .button ("Generate Script for me" )
3742
3843
3944if submit :
40-
45+
4146 if st .session_state ['API_Key' ]:
42- search_result ,title ,script = generate_script (prompt ,video_length ,creativity ,st .session_state ['API_Key' ])
43- #Let's generate the script
47+ search_result , title , script = generate_script (
48+ prompt , video_length , creativity , st .session_state ['API_Key' ])
49+ # Let's generate the script
4450 st .success ('Hope you like this script ❤️' )
4551
46- #Display Title
52+ # Display Title
4753 st .subheader ("Title:🔥" )
4854 st .write (title )
4955
50- #Display Video Script
56+ # Display Video Script
5157 st .subheader ("Your Video Script:📝" )
5258 st .write (script )
5359
54- #Display Search Engine Result
60+ # Display Search Engine Result
5561 st .subheader ("Check Out - DuckDuckGo Search:🔍" )
56- with st .expander ('Show me 👀' ):
62+ with st .expander ('Show me 👀' ):
5763 st .info (search_result )
5864 else :
59- st .error ("Ooopssss!!! Please provide API key....." )
65+ st .error ("Ooopssss!!! Please provide API key....." )
0 commit comments