Spaces:
Sleeping
Sleeping
Akshayram1
commited on
Commit
•
92d908c
1
Parent(s):
0a16327
Update app.py
Browse files
app.py
CHANGED
@@ -91,16 +91,23 @@ st.markdown("""
|
|
91 |
background-color: #fff;
|
92 |
padding: 10px 0;
|
93 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
</style>
|
95 |
""", unsafe_allow_html=True)
|
96 |
|
97 |
-
#
|
98 |
-
|
99 |
|
100 |
-
# Function to display the chat history in
|
101 |
def display_chat():
|
102 |
-
with
|
103 |
-
st.markdown('<div class="
|
104 |
# Loop through session messages and display them
|
105 |
for message in st.session_state['messages']:
|
106 |
if message['role'] == 'user':
|
@@ -137,5 +144,5 @@ with input_container:
|
|
137 |
|
138 |
st.markdown('</div>', unsafe_allow_html=True)
|
139 |
|
140 |
-
# Display the chat history
|
141 |
display_chat()
|
|
|
91 |
background-color: #fff;
|
92 |
padding: 10px 0;
|
93 |
}
|
94 |
+
.white-box {
|
95 |
+
background-color: white;
|
96 |
+
height: 400px; /* Set a fixed height */
|
97 |
+
overflow-y: scroll; /* Allow scrolling */
|
98 |
+
padding: 15px;
|
99 |
+
border: 1px solid #ddd;
|
100 |
+
}
|
101 |
</style>
|
102 |
""", unsafe_allow_html=True)
|
103 |
|
104 |
+
# White box (output container) where the chat output should go
|
105 |
+
output_container = st.empty() # This will hold the dynamic content
|
106 |
|
107 |
+
# Function to display the chat history in the white box
|
108 |
def display_chat():
|
109 |
+
with output_container.container(): # Use the white box for output
|
110 |
+
st.markdown('<div class="white-box">', unsafe_allow_html=True)
|
111 |
# Loop through session messages and display them
|
112 |
for message in st.session_state['messages']:
|
113 |
if message['role'] == 'user':
|
|
|
144 |
|
145 |
st.markdown('</div>', unsafe_allow_html=True)
|
146 |
|
147 |
+
# Display the chat history in the white box
|
148 |
display_chat()
|