Update app.py
Browse files
app.py
CHANGED
@@ -30,8 +30,6 @@ David's purpose is to provide leadership and services to help reduce organizatio
|
|
30 |
"""
|
31 |
|
32 |
def call_openai_api(user_prompt):
|
33 |
-
|
34 |
-
|
35 |
max_retries = 5
|
36 |
for attempt in range(max_retries):
|
37 |
try:
|
@@ -43,8 +41,7 @@ def call_openai_api(user_prompt):
|
|
43 |
],
|
44 |
)
|
45 |
response.choices[0].message['content']
|
46 |
-
|
47 |
-
except Exception as e:
|
48 |
if attempt < max_retries - 1: # if it's not the last attempt
|
49 |
time.sleep(1) # wait for 1 seconds before retrying
|
50 |
continue
|
|
|
30 |
"""
|
31 |
|
32 |
def call_openai_api(user_prompt):
|
|
|
|
|
33 |
max_retries = 5
|
34 |
for attempt in range(max_retries):
|
35 |
try:
|
|
|
41 |
],
|
42 |
)
|
43 |
response.choices[0].message['content']
|
44 |
+
except Exception as e:
|
|
|
45 |
if attempt < max_retries - 1: # if it's not the last attempt
|
46 |
time.sleep(1) # wait for 1 seconds before retrying
|
47 |
continue
|