adikwok commited on
Commit
0280080
Β·
verified Β·
1 Parent(s): 27ad2cd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -37
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
- with gr.Column():
141
- with gr.Row():
142
- msg_input = gr.Textbox(
143
- label="✍️ Your Message",
144
- placeholder="Type your message here...",
145
- lines=3,
146
- max_lines=10
147
- )
148
- with gr.Row():
149
- with gr.Column(scale=3):
150
- topic_input = gr.Textbox(
151
- label="🏷️ Topic",
152
- value="general",
153
- placeholder="conversation topic"
154
- )
155
- summarize_cb = gr.Checkbox(
156
- label="πŸ“‹ Summarize conversation",
157
- value=False
158
- )
159
- with gr.Column(scale=1, justify="end"):
160
- send_btn = gr.Button("πŸ“€ Send Message", variant="primary")
161
- clear_btn = gr.Button("πŸ—‘οΈ Clear Response", variant="secondary")
162
-
163
- with gr.Row(justify="end"):
164
- send_btn
 
 
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")