bugfix: params
Browse files
app.py
CHANGED
@@ -8,23 +8,20 @@ def respond(message, property_id: str = "a0de88a24c4e844d86f285d6abbd59d0"):
|
|
8 |
url = "https://data-monopolio.dev.dd360.mx/ai-assistant/v1"
|
9 |
|
10 |
payload = json.dumps({
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
})
|
17 |
-
|
18 |
headers = {
|
19 |
-
|
20 |
}
|
21 |
|
22 |
-
response = requests.
|
23 |
|
24 |
-
response.raise_for_status()
|
25 |
|
26 |
return response.text
|
27 |
-
|
28 |
except requests.RequestException as e:
|
29 |
return f"Error: {str(e)}"
|
30 |
|
|
|
8 |
url = "https://data-monopolio.dev.dd360.mx/ai-assistant/v1"
|
9 |
|
10 |
payload = json.dumps({
|
11 |
+
"query": "cuantos cuartos tiene la propiedad?",
|
12 |
+
"sessionId": "12345",
|
13 |
+
"numMessages": 4,
|
14 |
+
"userId": "user-01",
|
15 |
+
"property_id": "a0de88a24c4e844d86f285d6abbd59d0"
|
16 |
})
|
|
|
17 |
headers = {
|
18 |
+
'Content-Type': 'application/json'
|
19 |
}
|
20 |
|
21 |
+
response = requests.request("POST", url, headers=headers, data=payload)
|
22 |
|
|
|
23 |
|
24 |
return response.text
|
|
|
25 |
except requests.RequestException as e:
|
26 |
return f"Error: {str(e)}"
|
27 |
|