muryshev commited on
Commit
7226b04
·
verified ·
1 Parent(s): 60a6591

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -42,7 +42,7 @@ def call_api(prompt_text):
42
  try:
43
  response = requests.post(url, json=payload)
44
  response.raise_for_status() # Raise an exception for 4xx or 5xx status codes
45
- result = response.text # Extract the text result from the JSON response
46
  print(result)
47
  return result
48
  except requests.exceptions.RequestException as e:
 
42
  try:
43
  response = requests.post(url, json=payload)
44
  response.raise_for_status() # Raise an exception for 4xx or 5xx status codes
45
+ result = response.json().get('content', '') # Extract the text result from the JSON response
46
  print(result)
47
  return result
48
  except requests.exceptions.RequestException as e: