Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -30,14 +30,12 @@ async def chat(request: Request):
|
|
| 30 |
if not user_message:
|
| 31 |
raise HTTPException(status_code=400, detail="Message is required")
|
| 32 |
|
| 33 |
-
# Call your hosted Space, passing the
|
| 34 |
-
#
|
| 35 |
-
# so we pass the user_id as an additional input.
|
| 36 |
-
# The message is passed as the primary query.
|
| 37 |
result = client.predict(
|
| 38 |
-
|
| 39 |
-
api_key
|
| 40 |
-
user_id
|
| 41 |
api_name="/chat" # Ensure this matches the endpoint in the Gradio app
|
| 42 |
)
|
| 43 |
|
|
|
|
| 30 |
if not user_message:
|
| 31 |
raise HTTPException(status_code=400, detail="Message is required")
|
| 32 |
|
| 33 |
+
# Call your hosted Space, passing the message and additional inputs (api_key, user_id)
|
| 34 |
+
# The ChatInterface handles chat_history internally when type="messages"
|
|
|
|
|
|
|
| 35 |
result = client.predict(
|
| 36 |
+
user_message, # Primary query
|
| 37 |
+
api_key, # First additional input (API Key)
|
| 38 |
+
user_id, # Second additional input (User ID - assuming this will be added to Gradio)
|
| 39 |
api_name="/chat" # Ensure this matches the endpoint in the Gradio app
|
| 40 |
)
|
| 41 |
|