JuanMa360 commited on
Commit
bdf5c37
1 Parent(s): fb908e6

feat:images

Browse files
Files changed (1) hide show
  1. app.py +6 -4
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
- for i in range(len(api_response)):
32
- time.sleep(0.05)
33
- yield api_response[:i + 1]
34
 
35
- yield api_response
 
 
 
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)}"