updated1
Browse files
app.py
CHANGED
|
@@ -562,17 +562,18 @@ with gr.Blocks(css=custom_css, title="🤖 ChatGPT-like AI Assistant", theme=gr.
|
|
| 562 |
3. **Select an assistant personality** or create your own
|
| 563 |
4. **Start chatting** - the AI will remember your conversation!
|
| 564 |
|
| 565 |
-
*Built
|
| 566 |
""")
|
| 567 |
|
| 568 |
# Event handlers
|
| 569 |
-
def submit_message(message, history, api_key, model, temperature, max_tokens, system_prompt_choice, custom_system_prompt):
|
| 570 |
"""Handle message submission"""
|
| 571 |
if not message.strip():
|
| 572 |
-
|
| 573 |
|
| 574 |
# Use async generator for streaming
|
| 575 |
-
|
|
|
|
| 576 |
|
| 577 |
# In on_system_prompt_change function:
|
| 578 |
def on_system_prompt_change(choice):
|
|
|
|
| 562 |
3. **Select an assistant personality** or create your own
|
| 563 |
4. **Start chatting** - the AI will remember your conversation!
|
| 564 |
|
| 565 |
+
*Built By ❤️ Mahfujul Karim*
|
| 566 |
""")
|
| 567 |
|
| 568 |
# Event handlers
|
| 569 |
+
async def submit_message(message, history, api_key, model, temperature, max_tokens, system_prompt_choice, custom_system_prompt):
|
| 570 |
"""Handle message submission"""
|
| 571 |
if not message.strip():
|
| 572 |
+
yield history, ""
|
| 573 |
|
| 574 |
# Use async generator for streaming
|
| 575 |
+
async for x in chat_response_stream(message, history, api_key, model, temperature, max_tokens, system_prompt_choice, custom_system_prompt):
|
| 576 |
+
yield x
|
| 577 |
|
| 578 |
# In on_system_prompt_change function:
|
| 579 |
def on_system_prompt_change(choice):
|