1
- import streamlit as st
1
+ import streamlit as st
2
2
from utils import generate_script
3
3
4
4
# Applying Styling
17
17
18
18
# Creating Session State Variable
19
19
if 'API_Key' not in st .session_state :
20
- st .session_state ['API_Key' ] = ''
20
+ st .session_state ['API_Key' ] = ''
21
21
22
22
23
- st .title ('❤️ YouTube Script Writing Tool' )
23
+ st .title ('❤️ YouTube Script Writing Tool' )
24
24
25
25
# Sidebar to capture the OpenAi API key
26
26
st .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 )
29
30
30
31
31
32
# 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 )
35
40
36
41
submit = st .button ("Generate Script for me" )
37
42
38
43
39
44
if submit :
40
-
45
+
41
46
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
44
50
st .success ('Hope you like this script ❤️' )
45
51
46
- #Display Title
52
+ # Display Title
47
53
st .subheader ("Title:🔥" )
48
54
st .write (title )
49
55
50
- #Display Video Script
56
+ # Display Video Script
51
57
st .subheader ("Your Video Script:📝" )
52
58
st .write (script )
53
59
54
- #Display Search Engine Result
60
+ # Display Search Engine Result
55
61
st .subheader ("Check Out - DuckDuckGo Search:🔍" )
56
- with st .expander ('Show me 👀' ):
62
+ with st .expander ('Show me 👀' ):
57
63
st .info (search_result )
58
64
else :
59
- st .error ("Ooopssss!!! Please provide API key....." )
65
+ st .error ("Ooopssss!!! Please provide API key....." )
0 commit comments