feat:images
Browse files
app.py
CHANGED
@@ -28,11 +28,13 @@ def slow_api_response(message, history, property_id="c0ced2220b87fc23762facf6171
|
|
28 |
api_response = response.text
|
29 |
api_response = api_response.encode().decode('unicode_escape')
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
yield api_response[:i + 1]
|
34 |
|
35 |
-
|
|
|
|
|
|
|
36 |
|
37 |
except requests.RequestException as e:
|
38 |
yield f"Error: {str(e)}"
|
|
|
28 |
api_response = response.text
|
29 |
api_response = api_response.encode().decode('unicode_escape')
|
30 |
|
31 |
+
if len(api_response) > 3000:
|
32 |
+
yield api_response
|
|
|
33 |
|
34 |
+
else:
|
35 |
+
for i in range(len(api_response)):
|
36 |
+
time.sleep(0.05)
|
37 |
+
yield api_response[:i + 1]
|
38 |
|
39 |
except requests.RequestException as e:
|
40 |
yield f"Error: {str(e)}"
|