Update app.py
Browse files
app.py
CHANGED
|
@@ -42,9 +42,8 @@ def call_openai_api(user_prompt):
|
|
| 42 |
{"role": "user", "content": f"{text}\n\n{user_prompt}"},
|
| 43 |
],
|
| 44 |
)
|
| 45 |
-
|
| 46 |
|
| 47 |
-
|
| 48 |
except Exception as e:
|
| 49 |
if attempt < max_retries - 1: # if it's not the last attempt
|
| 50 |
time.sleep(1) # wait for 1 seconds before retrying
|
|
|
|
| 42 |
{"role": "user", "content": f"{text}\n\n{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
|