Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -80,7 +80,7 @@ def chatbot_response(api_key, user_message, user_image, history):
|
|
80 |
"""
|
81 |
# Append the user's message to the history
|
82 |
if user_message or user_image:
|
83 |
-
history.append((user_message, user_image))
|
84 |
|
85 |
# Get the API response
|
86 |
api_result = get_api_response(api_key, user_message, user_image)
|
@@ -91,7 +91,7 @@ def chatbot_response(api_key, user_message, user_image, history):
|
|
91 |
ai_message = api_result["response"]
|
92 |
|
93 |
# Append the AI's response to the history
|
94 |
-
history.append((ai_message, None))
|
95 |
|
96 |
return history, history
|
97 |
|
@@ -126,7 +126,7 @@ with gr.Blocks() as demo:
|
|
126 |
user_image = gr.Image(
|
127 |
label="Upload Image",
|
128 |
type="file",
|
129 |
-
tool
|
130 |
interactive=True
|
131 |
)
|
132 |
|
|
|
80 |
"""
|
81 |
# Append the user's message to the history
|
82 |
if user_message or user_image:
|
83 |
+
history.append(("User", user_message, user_image))
|
84 |
|
85 |
# Get the API response
|
86 |
api_result = get_api_response(api_key, user_message, user_image)
|
|
|
91 |
ai_message = api_result["response"]
|
92 |
|
93 |
# Append the AI's response to the history
|
94 |
+
history.append(("AI", ai_message, None))
|
95 |
|
96 |
return history, history
|
97 |
|
|
|
126 |
user_image = gr.Image(
|
127 |
label="Upload Image",
|
128 |
type="file",
|
129 |
+
# Removed the 'tool' parameter
|
130 |
interactive=True
|
131 |
)
|
132 |
|