You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Qwant is a French search engine, free without any tracking. Similar to DuckDuckGo. The advantage is that there is no token to create. This function call can help putting the LLM fastly uptodate with specific news. I finally hardcoded the page to return to 10 and language to english.
Code
frominstructorimportOpenAISchema# SuperclassfrompydanticimportField# Used by ShellGPT to anotate codeimportrequests# HTTP GETfromurllib.parseimportquote# urlencode textclassFunction(OpenAISchema):
""" Search web pages with the Qwant search engine Make queries like the following -- https://api.qwant.com/v3/search/web?q=example+text&count=10&locale=es_CL&offset=0&device=desktop&tgp=3&safesearch=1&displayed=true """s_text: str=Field(
...,
example="Charlie Chaplin movie list",
description="Query text to send to the search engine.",
)
classConfig:
title="search_with_qwant_search_engine"@classmethoddefexecute(cls, s_text: str, i_page_number: int=10, s_locale: str="en_us") ->str:
s_text=quote(s_text)
s_url=f'https://api.qwant.com/v3/search/web?q={s_text}&count={i_page_number}&locale={s_locale}'d_header= {
'User-Agent': 'ShellGPT',
'Accept': 'application/json',
}
response=requests.get(s_url, headers=d_header)
ifresponse.status_code==200:
returnresponse.textelse:
returnf"Error: Failed to download the web page. Status code: {response.status_code}"
Example
Use Qwant function calling to tell me the top 10 science fiction movies to watch on Netflix. Hopefully movies that I did not already see.
Here are some top science fiction movies currently available on Netflix:
1 The Matrix (1999) - A classic that explores reality and artificial
intelligence. Read more
2 The Adam Project (2022) - A time travel adventure with a nostalgic feel.
Read more
3 Godzilla Minus One (2023) - A fresh take on the iconic monster. Read more
4 Upgrade (2018) - A thrilling story of revenge and technology. Read more
5 Life (2017) - A gripping tale of an alien life form aboard the ISS. Read
more
6 Starship Troopers (1997) - A satirical look at militarism and alien
warfare. Read more
7 The Platform (2019) - A unique social commentary set in a dystopian
prison. Read more
8 Oxygen (2021) - A survival thriller set in a cryogenic pod. Read more
9 Spider-Man: Into the Spider-Verse (2018) - An animated adventure across
multiple dimensions. Read more
10 The Midnight Sky (2020) - A post-apocalyptic tale of hope and survival.
Read more
Check them out and enjoy!
Write the square and the square root of 9.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Qwant is a French search engine, free without any tracking. Similar to DuckDuckGo. The advantage is that there is no token to create. This function call can help putting the LLM fastly uptodate with specific news. I finally hardcoded the page to return to 10 and language to english.
Code
Example
Use Qwant function calling to tell me the top 10 science fiction movies to watch on Netflix. Hopefully movies that I did not already see.
Beta Was this translation helpful? Give feedback.
All reactions