Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -17,7 +17,7 @@ make the budget in Indian ruppes."""
|
|
17 |
conversation_history = []
|
18 |
|
19 |
# Define a function to handle user messages
|
20 |
-
def handle_message(user_message):
|
21 |
# Add the user's message to the conversation history
|
22 |
conversation_history.append({"role": "user", "content": user_message})
|
23 |
|
@@ -40,7 +40,7 @@ def handle_message(user_message):
|
|
40 |
return chat_completion.choices[0].message.content
|
41 |
|
42 |
# Create a Gradio interface with a chatbot component
|
43 |
-
iface = gr.
|
44 |
|
45 |
# Launch the interface
|
46 |
-
iface.launch(share=True)
|
|
|
17 |
conversation_history = []
|
18 |
|
19 |
# Define a function to handle user messages
|
20 |
+
def handle_message(user_message,iface):
|
21 |
# Add the user's message to the conversation history
|
22 |
conversation_history.append({"role": "user", "content": user_message})
|
23 |
|
|
|
40 |
return chat_completion.choices[0].message.content
|
41 |
|
42 |
# Create a Gradio interface with a chatbot component
|
43 |
+
iface = gr.ChatInterface(handle_message)
|
44 |
|
45 |
# Launch the interface
|
46 |
+
iface.launch(share=True)
|