intelliweb GPT
1.0.0
Intelliweb-GPT是一個智慧搜尋引擎/問答模組,它使用GPT技術為使用者查詢提供準確且相關的答案。這個搜尋引擎可以搜尋多個來源(包括 Google News 和 Google Web)以產生答案,還可以利用 GPT 的現有知識直接回答一般用戶的查詢。當 GPT 連接到網路後,它基本上就是 GPT 的增強版!這就是當您使用 Bing Chat 時 Bing 進行搜尋的方式。
Intelliweb-GPT 提供以下功能:
首先安裝requirements.txt中提到的所有函式庫和模組:
pip install -r requirements.txt
在.env
檔案中,將OPENAI_API_KEY
ENV 變數的值替換為您自己的 OpenAI API 金鑰。
另外,如果您想使用 serper API 從網路取得相關文章,請從此處取得您自己的 API 金鑰,並將您的 API 金鑰新增至SERPER_API_KEY
環境變數。它為您提供 1000 次免費搜索,比使用其他方法更安全、更可靠。呼叫generate_answer
方法時,將use_serper_api
參數設定為True
。
接下來,這是一個如何使用 Intelliweb-GPT 的簡單範例:
from pprint import pprint
from intelliweb_GPT import generate_answer
query = "How did the Super Mario Bros. movie fare at the box office?"
answer_dict = generate_answer ( query , use_serper_api = False )
pprint ( answer_dict )
輸出:
{ ' answer ' : ' The Super Mario Bros. movie has been a massive success at the box '
' office, breaking multiple records and becoming the '
' highest-grossing video game adaptation of all time, surpassing '
' Detective Pikachu. As of 2023-04-15, the film grossed $204.6 '
' million domestically and $377 million globally in its opening '
' weekend, and has since surpassed $500 million worldwide. It has '
' become the biggest opening of 2023, the highest-grossing debut '
' for Illumination, and the second-biggest debut ever for an '
' animated movie. The movie has already made more than 2.5 times its '
' budget, which is generally what a movie needs to break even. '
" There's a strong chance that the video game movie could join the "
' billion-dollar club despite the bad reviews. However, it remains '
' to be seen how well it will do in the following weeks. ' ,
' sources ' : [ ' https://deadline.com/2023/04/super-mario-bros-movie-crosses-500-million-worldwide-box-office-1235325476/ ' ,
' https://collider.com/super-mario-bros-movie-global-box-office-434-million/ ' ,
' https://variety.com/2023/film/news/super-mario-bros-movie-box-office-records-opening-weekend-1235577764/ ' ,
' https://www.shacknews.com/article/135069/super-mario-bros-movie-highest-grossing-video-game-film ' ,
' https://screenrant.com/super-mario-bros-movie-every-box-office-record/ ' ]}
還有一個 GUI 可用於與 intelliweb-GPT 互動。 UI 是使用 chainlit 創建的,可以使用以下命令運行:
PYTHONPATH= $PWD chainlit run chainlit_app/app.py
Chainlit UI 如何與 intelliweb-GPT 搭配使用的示範: