Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -76,8 +76,7 @@ def initialize_groq_client(api_key: str) -> Optional[Groq]:
|
|
| 76 |
elif "403" in error_msg:
|
| 77 |
st.error("❌ API key doesn't have permission to access Groq API")
|
| 78 |
else:
|
| 79 |
-
st.error(f"❌ Failed to initialize Groq client: {error_msg
|
| 80 |
-
}")
|
| 81 |
return None
|
| 82 |
|
| 83 |
# Define custom exception for Groq API errors
|
|
@@ -158,7 +157,8 @@ class NoteSection:
|
|
| 158 |
if self.contents[title].strip():
|
| 159 |
self.placeholders[title].markdown(f"## {title}\n{self.contents[title]}")
|
| 160 |
|
| 161 |
-
def
|
|
|
|
| 162 |
existing_content = ""
|
| 163 |
for title, content in self.structure.items():
|
| 164 |
if self.contents[title].strip():
|
|
|
|
| 76 |
elif "403" in error_msg:
|
| 77 |
st.error("❌ API key doesn't have permission to access Groq API")
|
| 78 |
else:
|
| 79 |
+
st.error(f"❌ Failed to initialize Groq client: {error_msg}")
|
|
|
|
| 80 |
return None
|
| 81 |
|
| 82 |
# Define custom exception for Groq API errors
|
|
|
|
| 157 |
if self.contents[title].strip():
|
| 158 |
self.placeholders[title].markdown(f"## {title}\n{self.contents[title]}")
|
| 159 |
|
| 160 |
+
def
|
| 161 |
+
return_existing_contents(self, level=1) -> str:
|
| 162 |
existing_content = ""
|
| 163 |
for title, content in self.structure.items():
|
| 164 |
if self.contents[title].strip():
|