Update app.py
Browse files
app.py
CHANGED
@@ -33,10 +33,12 @@ def search_knowledge_base_for_context(query: str) -> str:
|
|
33 |
data = {"query": query}
|
34 |
modal_url = os.getenv("MODAL_LABS_HACKATHON_RAG_TOOLS_URL")
|
35 |
response = requests.post(modal_url, json=data, timeout=600.0)
|
36 |
-
|
37 |
if response.status_code != 200:
|
38 |
print(f"Error in modal RAG response: {response.status_code} - {response.text}")
|
39 |
return "Error in retrieving context from the knowledge base."
|
|
|
|
|
40 |
return response.text or "No relevant information found"
|
41 |
|
42 |
def research_write_review_topic(query: str) -> str:
|
@@ -65,10 +67,12 @@ def research_write_review_topic(query: str) -> str:
|
|
65 |
data = {"query": query}
|
66 |
modal_url = os.getenv("MODAL_LABS_HACKATHON_RESEARCH_TOOLS_URL")
|
67 |
response = requests.post(modal_url, json=data, timeout=600.0)
|
68 |
-
|
69 |
if response.status_code != 200:
|
70 |
print(f"Error in modal RESEARCH response: {response.status_code} - {response.text}")
|
71 |
return "Error in retrieving research topic."
|
|
|
|
|
72 |
return response.text or "Research completed, but no content was generated."
|
73 |
|
74 |
with gr.Blocks() as server_info:
|
|
|
33 |
data = {"query": query}
|
34 |
modal_url = os.getenv("MODAL_LABS_HACKATHON_RAG_TOOLS_URL")
|
35 |
response = requests.post(modal_url, json=data, timeout=600.0)
|
36 |
+
|
37 |
if response.status_code != 200:
|
38 |
print(f"Error in modal RAG response: {response.status_code} - {response.text}")
|
39 |
return "Error in retrieving context from the knowledge base."
|
40 |
+
|
41 |
+
print(f"modal RAG Response: {response.text}")
|
42 |
return response.text or "No relevant information found"
|
43 |
|
44 |
def research_write_review_topic(query: str) -> str:
|
|
|
67 |
data = {"query": query}
|
68 |
modal_url = os.getenv("MODAL_LABS_HACKATHON_RESEARCH_TOOLS_URL")
|
69 |
response = requests.post(modal_url, json=data, timeout=600.0)
|
70 |
+
|
71 |
if response.status_code != 200:
|
72 |
print(f"Error in modal RESEARCH response: {response.status_code} - {response.text}")
|
73 |
return "Error in retrieving research topic."
|
74 |
+
|
75 |
+
print(f"modal RESEARCH Response: {response.txt}")
|
76 |
return response.text or "Research completed, but no content was generated."
|
77 |
|
78 |
with gr.Blocks() as server_info:
|