Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -59,13 +59,14 @@ def make_call(api):
|
|
59 |
|
60 |
|
61 |
api1 = os.getenv("GROQ_API_KEY1")
|
62 |
-
|
63 |
|
64 |
|
65 |
|
66 |
apis = [
|
67 |
|
68 |
api1,
|
|
|
69 |
|
70 |
]
|
71 |
|
@@ -80,7 +81,7 @@ data = None
|
|
80 |
|
81 |
for api in apis:
|
82 |
|
83 |
-
data = make_call(
|
84 |
|
85 |
if data: # Check for a successful response
|
86 |
|
@@ -90,7 +91,13 @@ for api in apis:
|
|
90 |
|
91 |
else:
|
92 |
|
93 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
|
95 |
# if data: # If a successful response was found, break the outer while loop
|
96 |
|
|
|
59 |
|
60 |
|
61 |
api1 = os.getenv("GROQ_API_KEY1")
|
62 |
+
api2 = os.getenv("GROQ_API_KEY2")
|
63 |
|
64 |
|
65 |
|
66 |
apis = [
|
67 |
|
68 |
api1,
|
69 |
+
api2
|
70 |
|
71 |
]
|
72 |
|
|
|
81 |
|
82 |
for api in apis:
|
83 |
|
84 |
+
data = make_call(api1)
|
85 |
|
86 |
if data: # Check for a successful response
|
87 |
|
|
|
91 |
|
92 |
else:
|
93 |
|
94 |
+
|
95 |
+
data = make_call(api2)
|
96 |
+
|
97 |
+
if data: # Check for a successful response
|
98 |
+
|
99 |
+
st.write(data)
|
100 |
+
#st.write(f"Failed to retrieve data from.")
|
101 |
|
102 |
# if data: # If a successful response was found, break the outer while loop
|
103 |
|