fixed python code
This commit is contained in:
parent
6f42514fd5
commit
0d43a9b32b
1 changed files with 11 additions and 12 deletions
|
|
@ -49,10 +49,9 @@ export default function ApiModal({flowName}) {
|
||||||
API_URL = "${window.location.protocol}//${window.location.host}/predict"
|
API_URL = "${window.location.protocol}//${window.location.host}/predict"
|
||||||
|
|
||||||
def predict(message):
|
def predict(message):
|
||||||
with open("${flowName}.json:, "r") as f:
|
with open("${flowName}.json", "r") as f:
|
||||||
json_data = json.load(f)
|
json_data = json.load(f)
|
||||||
payload['exported_flow'] = json_data
|
payload = {'exported_flow': json_data, 'message': message}
|
||||||
payload['message'] = message
|
|
||||||
response = requests.post(API_URL, json=payload)
|
response = requests.post(API_URL, json=payload)
|
||||||
return response.json() # JSON {"result": "Response"}
|
return response.json() # JSON {"result": "Response"}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue