Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -137,31 +137,33 @@ with gr.Blocks(title="Groq Chat Interface", theme=gr.themes.Soft(), css="""
|
|
| 137 |
|
| 138 |
gr.Markdown("---")
|
| 139 |
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
|
|
|
|
|
|
| 165 |
|
| 166 |
# Event handlers
|
| 167 |
send_btn.click(
|
|
@@ -181,18 +183,6 @@ with gr.Blocks(title="Groq Chat Interface", theme=gr.themes.Soft(), css="""
|
|
| 181 |
lambda: ("", ""),
|
| 182 |
outputs=[response_output, msg_input]
|
| 183 |
)
|
| 184 |
-
|
| 185 |
-
# Enter key support (Shift+Enter for new line, Enter to send)
|
| 186 |
-
msg_input.submit(
|
| 187 |
-
process_message,
|
| 188 |
-
inputs=[msg_input, topic_input, summarize_cb],
|
| 189 |
-
outputs=[response_output, msg_input]
|
| 190 |
-
)
|
| 191 |
-
|
| 192 |
-
clear_btn.click(
|
| 193 |
-
lambda: ("", ""),
|
| 194 |
-
outputs=[response_output, msg_input]
|
| 195 |
-
)
|
| 196 |
|
| 197 |
with gr.Tab("π History"):
|
| 198 |
gr.Markdown("### Chat History Management")
|
|
|
|
| 137 |
|
| 138 |
gr.Markdown("---")
|
| 139 |
|
| 140 |
+
# Input area at bottom
|
| 141 |
+
# Ganti bagian input area dengan:
|
| 142 |
+
with gr.Row():
|
| 143 |
+
with gr.Column(scale=4):
|
| 144 |
+
msg_input = gr.Textbox(
|
| 145 |
+
label="βοΈ Your Message",
|
| 146 |
+
placeholder="Type your message here...",
|
| 147 |
+
lines=3,
|
| 148 |
+
max_lines=10
|
| 149 |
+
)
|
| 150 |
+
|
| 151 |
+
with gr.Column(scale=1):
|
| 152 |
+
topic_input = gr.Textbox(
|
| 153 |
+
label="π·οΈ Topic",
|
| 154 |
+
value="general",
|
| 155 |
+
placeholder="conversation topic"
|
| 156 |
+
)
|
| 157 |
+
summarize_cb = gr.Checkbox(
|
| 158 |
+
label="π Summarize conversation",
|
| 159 |
+
value=False
|
| 160 |
+
)
|
| 161 |
+
# Pindahin Send button ke sini
|
| 162 |
+
send_btn = gr.Button("π€ Send Message", variant="primary")
|
| 163 |
+
|
| 164 |
+
# Hapus/ubah row untuk buttons jadi cuma clear button
|
| 165 |
+
with gr.Row():
|
| 166 |
+
clear_btn = gr.Button("ποΈ Clear Response", variant="secondary")
|
| 167 |
|
| 168 |
# Event handlers
|
| 169 |
send_btn.click(
|
|
|
|
| 183 |
lambda: ("", ""),
|
| 184 |
outputs=[response_output, msg_input]
|
| 185 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 186 |
|
| 187 |
with gr.Tab("π History"):
|
| 188 |
gr.Markdown("### Chat History Management")
|