Update app.py
Browse files
app.py
CHANGED
@@ -150,7 +150,6 @@ def create_interface():
|
|
150 |
|
151 |
with gr.Row():
|
152 |
clear_btn = gr.Button("ποΈ Clear Chat", variant="secondary")
|
153 |
-
export_btn = gr.Button("π₯ Export Chat", variant="secondary")
|
154 |
regenerate_btn = gr.Button("π Regenerate", variant="secondary")
|
155 |
|
156 |
with gr.Column(scale=1):
|
@@ -252,7 +251,6 @@ def create_interface():
|
|
252 |
### 4. **Chat Features**
|
253 |
- Type messages and get intelligent responses
|
254 |
- Clear conversation history anytime
|
255 |
-
- Export chat history as JSON (downloads automatically)
|
256 |
- Regenerate the last response
|
257 |
- Copy responses using the copy button
|
258 |
|
@@ -261,7 +259,6 @@ def create_interface():
|
|
261 |
- **Multi-model support**: GPT-3.5, GPT-4, and variants
|
262 |
- **Conversation memory**: Maintains context throughout the session
|
263 |
- **Custom data integration**: Enhance responses with your own data
|
264 |
-
- **Export functionality**: Save conversations as JSON downloads
|
265 |
- **Real-time validation**: API key and settings verification
|
266 |
- **Visual indicators**: User and AI avatars
|
267 |
|
@@ -313,10 +310,6 @@ def create_interface():
|
|
313 |
def handle_clear():
|
314 |
return chatbot.clear_conversation()
|
315 |
|
316 |
-
def handle_export(history):
|
317 |
-
status, filepath = chatbot.export_conversation(history or [])
|
318 |
-
return status, gr.File(filepath, visible=False, label=None) if filepath else None
|
319 |
-
|
320 |
def handle_regenerate(history):
|
321 |
if not history:
|
322 |
return history or []
|
@@ -378,12 +371,6 @@ def create_interface():
|
|
378 |
outputs=[user_input, chatbot_interface]
|
379 |
)
|
380 |
|
381 |
-
export_btn.click(
|
382 |
-
handle_export,
|
383 |
-
inputs=[chatbot_interface],
|
384 |
-
outputs=[settings_status, gr.File(visible=False)]
|
385 |
-
)
|
386 |
-
|
387 |
regenerate_btn.click(
|
388 |
handle_regenerate,
|
389 |
inputs=[chatbot_interface],
|
|
|
150 |
|
151 |
with gr.Row():
|
152 |
clear_btn = gr.Button("ποΈ Clear Chat", variant="secondary")
|
|
|
153 |
regenerate_btn = gr.Button("π Regenerate", variant="secondary")
|
154 |
|
155 |
with gr.Column(scale=1):
|
|
|
251 |
### 4. **Chat Features**
|
252 |
- Type messages and get intelligent responses
|
253 |
- Clear conversation history anytime
|
|
|
254 |
- Regenerate the last response
|
255 |
- Copy responses using the copy button
|
256 |
|
|
|
259 |
- **Multi-model support**: GPT-3.5, GPT-4, and variants
|
260 |
- **Conversation memory**: Maintains context throughout the session
|
261 |
- **Custom data integration**: Enhance responses with your own data
|
|
|
262 |
- **Real-time validation**: API key and settings verification
|
263 |
- **Visual indicators**: User and AI avatars
|
264 |
|
|
|
310 |
def handle_clear():
|
311 |
return chatbot.clear_conversation()
|
312 |
|
|
|
|
|
|
|
|
|
313 |
def handle_regenerate(history):
|
314 |
if not history:
|
315 |
return history or []
|
|
|
371 |
outputs=[user_input, chatbot_interface]
|
372 |
)
|
373 |
|
|
|
|
|
|
|
|
|
|
|
|
|
374 |
regenerate_btn.click(
|
375 |
handle_regenerate,
|
376 |
inputs=[chatbot_interface],
|