Update app.py
Browse files
app.py
CHANGED
|
@@ -33,12 +33,12 @@ def call_private_api(user_input):
|
|
| 33 |
|
| 34 |
if response.status_code == 200:
|
| 35 |
#return response.json()
|
| 36 |
-
return response.text #
|
| 37 |
else:
|
| 38 |
return {"error": f"Status {response.status_code}", "detail": response.text}
|
| 39 |
except Exception as e:
|
| 40 |
return {"error": f"Connection failed: {str(e)}"}
|
| 41 |
|
| 42 |
# Simple UI to test it
|
| 43 |
-
demo = gr.Interface(fn=call_private_api, inputs="text", outputs="json")
|
| 44 |
-
demo.queue().launch()
|
|
|
|
| 33 |
|
| 34 |
if response.status_code == 200:
|
| 35 |
#return response.json()
|
| 36 |
+
return response.text # workaround
|
| 37 |
else:
|
| 38 |
return {"error": f"Status {response.status_code}", "detail": response.text}
|
| 39 |
except Exception as e:
|
| 40 |
return {"error": f"Connection failed: {str(e)}"}
|
| 41 |
|
| 42 |
# Simple UI to test it
|
| 43 |
+
demo = gr.Interface(fn=call_private_api, inputs="text", outputs="json").launch()
|
| 44 |
+
#demo.queue().launch()
|