Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -45,14 +45,6 @@ def save_chat_history(messages):
|
|
| 45 |
with shelve.open("chat_history") as db:
|
| 46 |
db["messages"] = messages
|
| 47 |
|
| 48 |
-
'''def fetch_wikipedia_link(topic):
|
| 49 |
-
api_url = f"https://en.wikipedia.org/api/rest_v1/page/summary/{topic}"
|
| 50 |
-
response = requests.get(api_url)
|
| 51 |
-
if response.status_code == 200:
|
| 52 |
-
return response.json()['content_urls']['desktop']['page']
|
| 53 |
-
st.error("Failed to fetch Wikipedia content.")
|
| 54 |
-
return None'''
|
| 55 |
-
|
| 56 |
from urllib.parse import quote
|
| 57 |
|
| 58 |
def fetch_wikipedia_link(topic: str) -> str | None:
|
|
|
|
| 45 |
with shelve.open("chat_history") as db:
|
| 46 |
db["messages"] = messages
|
| 47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
from urllib.parse import quote
|
| 49 |
|
| 50 |
def fetch_wikipedia_link(topic: str) -> str | None:
|