Spaces:
Sleeping
Sleeping
Update sherlock2.py
Browse files- sherlock2.py +10 -22
sherlock2.py
CHANGED
|
@@ -355,38 +355,26 @@ def investigate():
|
|
| 355 |
with st.expander("Sherlock's Analysis and Suggestions:"):
|
| 356 |
st.write(response.text)
|
| 357 |
|
| 358 |
-
|
| 359 |
-
wikipedia_info = [] # Add this line here
|
| 360 |
-
|
| 361 |
-
search_options = st.multiselect("Search for additional clues:", ["Wikipedia", "Internet"], default=["Wikipedia"])
|
| 362 |
if st.button("Search"):
|
| 363 |
with st.spinner("Searching for clues..."):
|
| 364 |
-
web_search_results =
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
st.
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
st.write(f"**Summary:** {info['summary']}")
|
| 371 |
-
st.write(f"**URL:** {info['url']}")
|
| 372 |
-
if "Internet" in search_options:
|
| 373 |
-
web_search_results = search_internet("\n\n".join(case_text))
|
| 374 |
-
st.subheader("Internet Search Results:")
|
| 375 |
-
for result in web_search_results:
|
| 376 |
-
st.write(f"**Title:** {result['title']}")
|
| 377 |
-
st.write(f"**Snippet:** {result['snippet']}")
|
| 378 |
-
st.write(f"**URL:** {result['url']}")
|
| 379 |
|
| 380 |
# Generate report button
|
| 381 |
if st.button("Generate Case Report"):
|
| 382 |
with st.spinner("Generating report..."):
|
| 383 |
report_prompt = """
|
| 384 |
You are Sherlock Holmes, the renowned detective. Based on the case information, your analysis, findings from
|
| 385 |
-
|
| 386 |
including deductions, potential suspects, and conclusions.
|
| 387 |
-
"""
|
| 388 |
final_report = model.generate_content([sherlock_persona, sherlock_guidelines, report_prompt,
|
| 389 |
-
case_embeddings_str, str(
|
| 390 |
st.header("Case Report")
|
| 391 |
st.write(final_report.text)
|
| 392 |
|
|
|
|
| 355 |
with st.expander("Sherlock's Analysis and Suggestions:"):
|
| 356 |
st.write(response.text)
|
| 357 |
|
| 358 |
+
search_options = st.multiselect("Search for additional clues:", ["Internet"], default=["Internet"]) # Only "Internet" option
|
|
|
|
|
|
|
|
|
|
| 359 |
if st.button("Search"):
|
| 360 |
with st.spinner("Searching for clues..."):
|
| 361 |
+
web_search_results = search_internet("\n\n".join(case_text))
|
| 362 |
+
st.subheader("Internet Search Results:")
|
| 363 |
+
for result in web_search_results:
|
| 364 |
+
st.write(f"**Title:** {result['title']}")
|
| 365 |
+
st.write(f"**Snippet:** {result['snippet']}")
|
| 366 |
+
st.write(f"**URL:** {result['url']}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 367 |
|
| 368 |
# Generate report button
|
| 369 |
if st.button("Generate Case Report"):
|
| 370 |
with st.spinner("Generating report..."):
|
| 371 |
report_prompt = """
|
| 372 |
You are Sherlock Holmes, the renowned detective. Based on the case information, your analysis, findings from
|
| 373 |
+
the web, and the extracted keywords, generate a comprehensive case report in your signature style,
|
| 374 |
including deductions, potential suspects, and conclusions.
|
| 375 |
+
"""
|
| 376 |
final_report = model.generate_content([sherlock_persona, sherlock_guidelines, report_prompt,
|
| 377 |
+
case_embeddings_str, str(web_search_results)]) # Removed wikipedia_info
|
| 378 |
st.header("Case Report")
|
| 379 |
st.write(final_report.text)
|
| 380 |
|