Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -178,7 +178,8 @@ class ResearchAgent:
|
|
| 178 |
self.groq_client = Groq(api_key=groq_key)
|
| 179 |
print("✅ Groq API connected")
|
| 180 |
except Exception as e:
|
| 181 |
-
print(f"
|
|
|
|
| 182 |
|
| 183 |
def upload_docs(self, files):
|
| 184 |
if not files:
|
|
@@ -264,7 +265,7 @@ def main():
|
|
| 264 |
|
| 265 |
with gr.Row():
|
| 266 |
with gr.Column():
|
| 267 |
-
chatbot = gr.Chatbot(height=400
|
| 268 |
msg = gr.Textbox(label="Question", placeholder="Ask something...", lines=1)
|
| 269 |
btn_send = gr.Button("Send", variant="primary")
|
| 270 |
btn_clear = gr.Button("Clear")
|
|
@@ -272,7 +273,7 @@ def main():
|
|
| 272 |
with gr.Column():
|
| 273 |
gr.Markdown("### Upload Documents")
|
| 274 |
file_input = gr.Files(label="PDF Files", file_types=[".pdf"])
|
| 275 |
-
upload_status = gr.Textbox(label="Status", interactive=False)
|
| 276 |
|
| 277 |
# Events
|
| 278 |
def respond(message, chat_history):
|
|
|
|
| 178 |
self.groq_client = Groq(api_key=groq_key)
|
| 179 |
print("✅ Groq API connected")
|
| 180 |
except Exception as e:
|
| 181 |
+
print(f"⚠️ Groq not available: {e}")
|
| 182 |
+
self.groq_client = None
|
| 183 |
|
| 184 |
def upload_docs(self, files):
|
| 185 |
if not files:
|
|
|
|
| 265 |
|
| 266 |
with gr.Row():
|
| 267 |
with gr.Column():
|
| 268 |
+
chatbot = gr.Chatbot(height=400)
|
| 269 |
msg = gr.Textbox(label="Question", placeholder="Ask something...", lines=1)
|
| 270 |
btn_send = gr.Button("Send", variant="primary")
|
| 271 |
btn_clear = gr.Button("Clear")
|
|
|
|
| 273 |
with gr.Column():
|
| 274 |
gr.Markdown("### Upload Documents")
|
| 275 |
file_input = gr.Files(label="PDF Files", file_types=[".pdf"])
|
| 276 |
+
upload_status = gr.Textbox(label="Status", interactive=False, lines=4)
|
| 277 |
|
| 278 |
# Events
|
| 279 |
def respond(message, chat_history):
|