Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,8 +16,9 @@ import tempfile
|
|
| 16 |
load_dotenv()
|
| 17 |
openai.api_key = os.getenv("OPENAI_API_KEY")
|
| 18 |
google_api_key = os.getenv("GOOGLE_API_KEY")
|
| 19 |
-
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "botidinamix-g.json"
|
| 20 |
|
|
|
|
|
|
|
| 21 |
|
| 22 |
|
| 23 |
# Configuraci贸n de Streamlit
|
|
@@ -27,69 +28,97 @@ st.set_page_config(page_title="Asistente Teol贸gico", page_icon="馃摉")
|
|
| 27 |
st.markdown(
|
| 28 |
"""
|
| 29 |
<style>
|
| 30 |
-
@import url('https://fonts.googleapis.com/css2?family=
|
|
|
|
| 31 |
body {
|
| 32 |
-
background-color: #
|
| 33 |
color: #ECF0F1;
|
| 34 |
background-image: url('https://s1.1zoom.me/big0/395/Fields_Sunrises_and_499477.jpg');
|
| 35 |
background-size: cover;
|
| 36 |
-
font-family: '
|
| 37 |
}
|
|
|
|
| 38 |
.stButton>button {
|
| 39 |
-
background-color: #
|
| 40 |
-
color:
|
| 41 |
-
border
|
|
|
|
| 42 |
font-size: 16px;
|
| 43 |
-
padding:
|
|
|
|
|
|
|
| 44 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
.stTextInput>div>div>input {
|
| 46 |
-
border:
|
| 47 |
-
border-radius:
|
| 48 |
font-size: 16px;
|
| 49 |
padding: 10px;
|
|
|
|
|
|
|
| 50 |
}
|
|
|
|
| 51 |
.stMarkdown>div>p {
|
| 52 |
-
color:
|
| 53 |
-
max-height: 300px;
|
| 54 |
-
overflow-y: auto;
|
| 55 |
font-size: 16px;
|
|
|
|
| 56 |
}
|
|
|
|
| 57 |
.stMarkdown>h1, .stMarkdown>h2, .stMarkdown>h3, .stMarkdown>h4, .stMarkdown>h5, .stMarkdown>h6 {
|
| 58 |
-
color:
|
|
|
|
| 59 |
font-weight: bold;
|
| 60 |
-
|
| 61 |
}
|
|
|
|
| 62 |
.stAudio {
|
| 63 |
margin-top: 20px;
|
| 64 |
-
border: 2px solid #
|
| 65 |
border-radius: 10px;
|
| 66 |
}
|
|
|
|
| 67 |
.stFileUploader>div>div>input {
|
| 68 |
-
border:
|
| 69 |
-
border-radius:
|
| 70 |
font-size: 16px;
|
|
|
|
|
|
|
|
|
|
| 71 |
}
|
|
|
|
| 72 |
.spinner {
|
| 73 |
border: 8px solid #f3f3f3;
|
| 74 |
-
border-top: 8px solid #
|
| 75 |
border-radius: 50%;
|
| 76 |
width: 60px;
|
| 77 |
height: 60px;
|
| 78 |
animation: spin 1s linear infinite;
|
| 79 |
}
|
|
|
|
| 80 |
@keyframes spin {
|
| 81 |
0% { transform: rotate(0deg); }
|
| 82 |
100% { transform: rotate(360deg); }
|
| 83 |
}
|
|
|
|
| 84 |
.video-container {
|
| 85 |
-
border: 3px solid
|
| 86 |
-
background-color:
|
| 87 |
padding: 10px;
|
| 88 |
border-radius: 10px;
|
| 89 |
margin-bottom: 20px;
|
| 90 |
}
|
|
|
|
| 91 |
.assistant-response {
|
| 92 |
font-size: 16px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
}
|
| 94 |
</style>
|
| 95 |
""",
|
|
|
|
| 16 |
load_dotenv()
|
| 17 |
openai.api_key = os.getenv("OPENAI_API_KEY")
|
| 18 |
google_api_key = os.getenv("GOOGLE_API_KEY")
|
|
|
|
| 19 |
|
| 20 |
+
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "botidinamix-g.json"
|
| 21 |
+
project_id = os.getenv("GOOGLE_PROJECT_ID")
|
| 22 |
|
| 23 |
|
| 24 |
# Configuraci贸n de Streamlit
|
|
|
|
| 28 |
st.markdown(
|
| 29 |
"""
|
| 30 |
<style>
|
| 31 |
+
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&display=swap');
|
| 32 |
+
|
| 33 |
body {
|
| 34 |
+
background-color: #1C1C1C;
|
| 35 |
color: #ECF0F1;
|
| 36 |
background-image: url('https://s1.1zoom.me/big0/395/Fields_Sunrises_and_499477.jpg');
|
| 37 |
background-size: cover;
|
| 38 |
+
font-family: 'Poppins', sans-serif;
|
| 39 |
}
|
| 40 |
+
|
| 41 |
.stButton>button {
|
| 42 |
+
background-color: #007BFF;
|
| 43 |
+
color: #FFD700;
|
| 44 |
+
border: none;
|
| 45 |
+
border-radius: 8px;
|
| 46 |
font-size: 16px;
|
| 47 |
+
padding: 12px 24px;
|
| 48 |
+
cursor: pointer;
|
| 49 |
+
transition: background-color 0.3s, transform 0.3s;
|
| 50 |
}
|
| 51 |
+
.stButton>button:hover {
|
| 52 |
+
background-color: #0056b3;
|
| 53 |
+
transform: scale(1.05);
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
.stTextInput>div>div>input {
|
| 57 |
+
border: 2px solid #FFD700;
|
| 58 |
+
border-radius: 8px;
|
| 59 |
font-size: 16px;
|
| 60 |
padding: 10px;
|
| 61 |
+
background-color: #000000;
|
| 62 |
+
color: #ECF0F1;
|
| 63 |
}
|
| 64 |
+
|
| 65 |
.stMarkdown>div>p {
|
| 66 |
+
color: #D0D3D4;
|
|
|
|
|
|
|
| 67 |
font-size: 16px;
|
| 68 |
+
line-height: 1.6;
|
| 69 |
}
|
| 70 |
+
|
| 71 |
.stMarkdown>h1, .stMarkdown>h2, .stMarkdown>h3, .stMarkdown>h4, .stMarkdown>h5, .stMarkdown>h6 {
|
| 72 |
+
color: #FF6F61;
|
| 73 |
+
font-family: 'Poppins', sans-serif;
|
| 74 |
font-weight: bold;
|
| 75 |
+
text-transform: uppercase;
|
| 76 |
}
|
| 77 |
+
|
| 78 |
.stAudio {
|
| 79 |
margin-top: 20px;
|
| 80 |
+
border: 2px solid #FF6F61;
|
| 81 |
border-radius: 10px;
|
| 82 |
}
|
| 83 |
+
|
| 84 |
.stFileUploader>div>div>input {
|
| 85 |
+
border: 2px solid #FFD700;
|
| 86 |
+
border-radius: 8px;
|
| 87 |
font-size: 16px;
|
| 88 |
+
padding: 10px;
|
| 89 |
+
background-color: #000000;
|
| 90 |
+
color: #ECF0F1;
|
| 91 |
}
|
| 92 |
+
|
| 93 |
.spinner {
|
| 94 |
border: 8px solid #f3f3f3;
|
| 95 |
+
border-top: 8px solid #FF6F61;
|
| 96 |
border-radius: 50%;
|
| 97 |
width: 60px;
|
| 98 |
height: 60px;
|
| 99 |
animation: spin 1s linear infinite;
|
| 100 |
}
|
| 101 |
+
|
| 102 |
@keyframes spin {
|
| 103 |
0% { transform: rotate(0deg); }
|
| 104 |
100% { transform: rotate(360deg); }
|
| 105 |
}
|
| 106 |
+
|
| 107 |
.video-container {
|
| 108 |
+
border: 3px solid #FF6F61;
|
| 109 |
+
background-color: #1C1C1C;
|
| 110 |
padding: 10px;
|
| 111 |
border-radius: 10px;
|
| 112 |
margin-bottom: 20px;
|
| 113 |
}
|
| 114 |
+
|
| 115 |
.assistant-response {
|
| 116 |
font-size: 16px;
|
| 117 |
+
color: #D0D3D4;
|
| 118 |
+
background-color: #2E2E2E;
|
| 119 |
+
padding: 10px;
|
| 120 |
+
border-radius: 8px;
|
| 121 |
+
border: 1px solid #FF6F61;
|
| 122 |
}
|
| 123 |
</style>
|
| 124 |
""",
|