Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -176,7 +176,20 @@ def main():
|
|
| 176 |
st.success("Chat ended. Reload to start again.")
|
| 177 |
else:
|
| 178 |
with st.spinner("Gemini is thinking..."):
|
| 179 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 180 |
|
| 181 |
if st.session_state.conversation:
|
| 182 |
history_text = "\n\n".join(
|
|
|
|
| 176 |
st.success("Chat ended. Reload to start again.")
|
| 177 |
else:
|
| 178 |
with st.spinner("Gemini is thinking..."):
|
| 179 |
+
# -------- System context for Gemini --------
|
| 180 |
+
system_context = {
|
| 181 |
+
"role": "user",
|
| 182 |
+
"text": (
|
| 183 |
+
"You are part of an intelligent driver distraction detection system. "
|
| 184 |
+
"Your role is to analyze documents, images, and videos to help identify and classify driver states, "
|
| 185 |
+
"including: drowsy, alert, yawning, microsleep, eyes/lips open or closed, and other distractions. "
|
| 186 |
+
"The user may ask for timestamps of events in video, technical explanations from code/docs, "
|
| 187 |
+
"or structured summaries. Prioritize your answers for this use case and act as a helpful assistant "
|
| 188 |
+
"within this domain."
|
| 189 |
+
)
|
| 190 |
+
}
|
| 191 |
+
|
| 192 |
+
content_blocks = [system_context]
|
| 193 |
|
| 194 |
if st.session_state.conversation:
|
| 195 |
history_text = "\n\n".join(
|