Update app.py
Browse files
app.py
CHANGED
@@ -40,7 +40,7 @@ def web_scrapper(url: str, topic: str) -> str:
|
|
40 |
content = scraper.run()
|
41 |
|
42 |
# Prepare the prompt for generating the summary
|
43 |
-
prompt = f"Generate a summary of the following content on the topic ## {topic} ### \n\nCONTENT:\n\n" + content
|
44 |
|
45 |
# Generate the summary using Cohere
|
46 |
response = co.chat(
|
@@ -51,6 +51,13 @@ def web_scrapper(url: str, topic: str) -> str:
|
|
51 |
chat_history=[],
|
52 |
prompt_truncation='AUTO'
|
53 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
|
55 |
return response.text
|
56 |
|
|
|
40 |
content = scraper.run()
|
41 |
|
42 |
# Prepare the prompt for generating the summary
|
43 |
+
prompt = f"Generate a summary of the following content on the topic ## {topic} ### \n\nCONTENT:\n\n" + content
|
44 |
|
45 |
# Generate the summary using Cohere
|
46 |
response = co.chat(
|
|
|
51 |
chat_history=[],
|
52 |
prompt_truncation='AUTO'
|
53 |
)
|
54 |
+
|
55 |
+
summary_response = f"""
|
56 |
+
###
|
57 |
+
Summary: {response.text}
|
58 |
+
URL: {url}
|
59 |
+
###
|
60 |
+
"""
|
61 |
|
62 |
return response.text
|
63 |
|