Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,16 +37,16 @@ apis = [
|
|
| 37 |
|
| 38 |
# Loop indefinitely
|
| 39 |
data = None
|
| 40 |
-
while True: # Loop indefinitely
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
if data: # If a successful response was found, break the outer while loop
|
| 49 |
-
|
| 50 |
|
| 51 |
|
| 52 |
|
|
|
|
| 37 |
|
| 38 |
# Loop indefinitely
|
| 39 |
data = None
|
| 40 |
+
# while True: # Loop indefinitely
|
| 41 |
+
for api in apis:
|
| 42 |
+
data = make_call(api)
|
| 43 |
+
if data: # Check for a successful response
|
| 44 |
+
st.write(chat_completion.choices[0].message.content)
|
| 45 |
+
break # Exit both the for loop and while loop
|
| 46 |
+
else:
|
| 47 |
+
st.write(f"Failed to retrieve data from key {api_key}.")
|
| 48 |
+
# if data: # If a successful response was found, break the outer while loop
|
| 49 |
+
# break
|
| 50 |
|
| 51 |
|
| 52 |
|