自動(dòng)版本的ChatGPT,AutoGPT自動(dòng)人工智能AI任務(wù)實(shí)踐(Python3.10) 全球關(guān)注
當(dāng)我們使用ChatGPT完成某些工作的時(shí)候,往往需要多輪對(duì)話,比如讓ChatGPT分析、翻譯、總結(jié)一篇網(wǎng)上的文章或
當(dāng)我們使用ChatGPT完成某些工作的時(shí)候,往往需要多輪對(duì)話,比如讓ChatGPT分析、翻譯、總結(jié)一篇網(wǎng)上的文章或者文檔,再將總結(jié)的結(jié)果以文本的形式存儲(chǔ)在本地。過程中免不了要和ChatGPT“折沖樽俎”一番,事實(shí)上,這個(gè)“交涉”的過程也可以自動(dòng)化,AutoGPT可以幫助我們自動(dòng)拆解任務(wù),沒錯(cuò),程序能做到的事情,人類絕不親力親為。
(資料圖)
我們唯一需要做的,就是告訴AutoGPT一個(gè)任務(wù)目標(biāo),AutoGPT會(huì)自動(dòng)根據(jù)任務(wù)目標(biāo)將任務(wù)拆解成一個(gè)個(gè)的小任務(wù),并且逐個(gè)完成,簡(jiǎn)單且高效。
先確保本地環(huán)境安裝好了Python3.10.9。
接著運(yùn)行Git命令拉取項(xiàng)目:
git clone https://github.com/Significant-Gravitas/Auto-GPT.git
隨后進(jìn)入項(xiàng)目的目錄:
cd Auto-GPT
安裝相關(guān)的依賴庫(kù):
pip3 install -r requirements.txt
安裝成功后,復(fù)制一下項(xiàng)目的配置文件:
cp .env.template .env
這里通過cp命令將配置文件模版.env.template復(fù)制成為一個(gè)新的配置文件.env。
隨后將Openai的秘鑰填入配置文件:
### OPENAI# OPENAI_API_KEY - OpenAI API Key (Example: my-openai-api-key)# TEMPERATURE - Sets temperature in OpenAI (Default: 0)# USE_AZURE - Use Azure OpenAI or not (Default: False)OPENAI_API_KEY=您的秘鑰TEMPERATURE=0USE_AZURE=False
除了Openai官方的接口秘鑰,AutoGPT也支持微軟Azure的接口。
如果希望使用微軟Azure的接口,需要將配置中的USE_AZURE設(shè)置為True,隨后復(fù)制azure.yaml.template配置模版為新的azure.yaml配置文件。
接著將微軟Azure服務(wù)的秘鑰填入azure.yaml即可。
由于微軟Azure接入Openai接口需要極其復(fù)雜的申請(qǐng)流程,這里還是直接使用OpenAI官方的接口。
當(dāng)然了,如果不想在本地裝那么多依賴,也可以通過Docker來構(gòu)建Auto-GPT的容器:
docker build -t autogpt .docker run -it --env-file=./.env -v $PWD/auto_gpt_workspace:/app/auto_gpt_workspace autogpt
這里Docker會(huì)自動(dòng)讀取項(xiàng)目中的Dockerfile配置文件進(jìn)行構(gòu)建,相當(dāng)方便。
至此,Auto-GPT就配置好了。
在項(xiàng)目根目錄運(yùn)行命令:
python3 -m autogpt --debug
即可啟動(dòng)AutoGPT:
? Auto-GPT git:(master) python -m autogpt --debug Warning: The file "AutoGpt.json" does not exist. Local memory would not be saved to a file.Debug Mode: ENABLEDWelcome to Auto-GPT! Enter the name of your AI and its role below. Entering nothing will load defaults.Name your AI: For example, "Entrepreneur-GPT"AI Name:
首先創(chuàng)建AutoGPT機(jī)器人的名字:
AI Name: v3u.cnv3u.cn here! I am at your service.Describe your AI"s role: For example, "an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth."v3u.cn is:
創(chuàng)建好名字以后,Auto-GPT就可以隨時(shí)為您效勞了。
首先為AutoGPT設(shè)置目標(biāo):
v3u.cn is: Analyze the contents of this article,the url is https://v3u.cn/a_id_303,and write the result to goal.txt
這里我們要求AutoGPT分析并且總結(jié)v3u.cn/a_id_303這篇文章,并且將分析結(jié)果寫入本地的goal.txt文件。
程序返回:
Enter up to 5 goals for your AI: For example: Increase net worth, Grow Twitter Account, Develop and manage multiple businesses autonomously"Enter nothing to load defaults, enter nothing when finished.Goal 1: Using memory of type: LocalCache
AutoGPT會(huì)告訴你可以最多拆解為五個(gè)任務(wù),我們可以自己拆解,也可以讓機(jī)器人幫助我們拆解,直接按回車,讓AutoGPT自動(dòng)拆解任務(wù)即可。
接著程序會(huì)自動(dòng)爬取這篇文章的內(nèi)容,然后使用gpt-3.5-turbo模型來進(jìn)行分析:
Goal 1: Using memory of type: LocalCacheUsing Browser: chrome Token limit: 4000 Memory Stats: (0, (0, 1536)) Token limit: 4000 Send Token Count: 936 Tokens remaining for response: 3064 ------------ CONTEXT SENT TO AI --------------- System: The current time and date is Mon Apr 17 20:29:37 2023 System: This reminds you of these events from your past: User: Determine which next command to use, and respond using the format specified above: ----------- END OF CONTEXT ----------------Creating chat completion with model gpt-3.5-turbo, temperature 0.0, max_tokens 3064The JSON object is valid. THOUGHTS: Let"s start by browsing the article at https://v3u.cn/a_id_303 to get a better understanding of its contents.REASONING: Browsing the article will allow us to analyze its contents and determine the appropriate next steps.PLAN: - Browse the article- Analyze its contents- Determine the appropriate next stepsCRITICISM: NoneNEXT ACTION: COMMAND = browse_website ARGUMENTS = {"url": "https://v3u.cn/a_id_303", "question": "analyze the contents of the article"}Enter "y" to authorise command, "y -N" to run N continuous commands, "n" to exit program, or enter feedback for ...Input:y-=-=-=-=-=-=-= COMMAND AUTHORISED BY USER -=-=-=-=-=-=-= [WDM] - Downloading: 100%|████████████████████████████████████████████| 8.04M/8.04M [00:03<00:00, 2.42MB/s]Text length: 6977 charactersAdding chunk 1 / 1 to memorySummarizing chunk 1 / 1Creating chat completion with model gpt-3.5-turbo, temperature 0.0, max_tokens 300SYSTEM: Command browse_website returned: Error: This model"s maximum context length is 4097 tokens. However, you requested 4339 tokens (4039 in the messages, 300 in the completion). Please reduce the length of the messages or completion. Token limit: 4000 Memory Stats: (2, (2, 1536)) Token limit: 4000 Send Token Count: 1472 Tokens remaining for response: 2528 ------------ CONTEXT SENT TO AI --------------- System: The current time and date is Mon Apr 17 20:30:19 2023 System: This reminds you of these events from your past:["Assistant Reply: {
\"thoughts\": {
\"text\": \"Let\"s start by browsing the article at https://v3u.cn/a_id_303 to get a better understanding of its contents.\",
\"reasoning\": \"Browsing the article will allow us to analyze its contents and determine the appropriate next steps.\",
\"plan\": \"- Browse the article\n- Analyze its contents\n- Determine the appropriate next steps\",
\"criticism\": \"None\",
\"speak\": \"I suggest we start by browsing the article at the given URL to analyze its contents and determine the appropriate next steps.\"
},
\"command\": {
\"name\": \"browse_website\",
\"args\": {
\"url\": \"https://v3u.cn/a_id_303\",
\"question\": \"analyze the contents of the article\"
}
}
}
Result: Command browse_website returned: Error: This model\"s maximum context length is 4097 tokens. However, you requested 4339 tokens (4039 in the messages, 300 in the completion). Please reduce the length of the messages or completion.
Human Feedback: GENERATE NEXT COMMAND JSON "] User: Determine which next command to use, and respond using the format specified above: Assistant: { \"thoughts\": { \"text\": \"Let"s start by browsing the article at https://v3u.cn/a_id_303 to get a better understanding of its contents.\", \"reasoning\": \"Browsing the article will allow us to analyze its contents and determine the appropriate next steps.\", \"plan\": \"- Browse the article
- Analyze its contents
- Determine the appropriate next steps\", \"criticism\": \"None\", \"speak\": \"I suggest we start by browsing the article at the given URL to analyze its contents and determine the appropriate next steps.\" }, \"command\": { \"name\": \"browse_website\", \"args\": { \"url\": \"https://v3u.cn/a_id_303\", \"question\": \"analyze the contents of the article\" } }} User: Determine which next command to use, and respond using the format specified above: ----------- END OF CONTEXT ----------------Creating chat completion with model gpt-3.5-turbo, temperature 0.0, max_tokens 2528
最后將分析結(jié)果寫入goal.txt文件:
這篇文章主要闡釋了蘋果Mac電腦可以完成機(jī)器學(xué)習(xí)和深度學(xué)習(xí)任務(wù),并且通過深度學(xué)習(xí)框架Tensorflow的安裝和運(yùn)行進(jìn)行了佐證,同時(shí)也對(duì)Tensorflow的CPU和GPU的兩種模型訓(xùn)練模式進(jìn)行了深度對(duì)比和測(cè)試。
一氣呵成,流暢絲滑。
AutoGPT和其他 AI 程序的不同之處在于,它專門專注于在無需人工干預(yù)的情況下生成提示和自動(dòng)執(zhí)行多步驟任務(wù)。它還具有掃描互聯(lián)網(wǎng)或在用戶計(jì)算機(jī)上執(zhí)行命令以獲取信息的能力,這使其有別于可能僅依賴于預(yù)先存在的數(shù)據(jù)集的其他人工智能程序。
AutoGPT的底層邏輯并不復(fù)雜:先通過搜索引擎檢索任務(wù),然后把結(jié)果和目標(biāo)丟給gpt讓它給出序列化方案json,再把方案分段丟給gpt,最后用shell去創(chuàng)建Python文件+json.load并且執(zhí)行,是一個(gè)反復(fù)遞歸的過程。
不能否認(rèn)的是,雖然實(shí)現(xiàn)邏輯簡(jiǎn)單,但這無疑是一種“自我進(jìn)化”的過程,相信隨著時(shí)間的推移,AutoGPT可以更好地處理愈加復(fù)雜的任務(wù)。
關(guān)鍵詞:
當(dāng)我們使用ChatGPT完成某些工作的時(shí)候,往往需要多輪對(duì)話,比如讓ChatGPT分析、翻譯、總結(jié)一篇網(wǎng)上的文章或
2023年4月18日北京市冬瓜批發(fā)市場(chǎng)價(jià)格最新行情監(jiān)測(cè)顯示:2023年4月18日北京市冬瓜批發(fā)價(jià)格均價(jià)1 9元 公斤,
【擠爆!上海車展“太熱了”上千企業(yè)參展特斯拉沒來!新能源車企大秀肌肉】“太熱了!”這是記者走在上海車
你需要的東西紗鉤針枕頭填充物或填料大眼鈍針使用您的鉤編技巧來連接各種家居裝飾品??粗阒挥勉^針、一些
1、打開手機(jī)上的天氣App。2、在天氣應(yīng)用的主頁(yè)上,設(shè)置您的當(dāng)前位置。3、然后下拉到底部,可以看到當(dāng)前的氣
萬辰生物2022年年度董事會(huì)經(jīng)營(yíng)評(píng)述內(nèi)容如下: 一、報(bào)告期內(nèi)公司所處行業(yè)情況 公司是主要從事于食用菌
據(jù)國(guó)家突發(fā)事件預(yù)警信息發(fā)布網(wǎng):南城縣氣象臺(tái)2023年04月18日20時(shí)47分繼續(xù)發(fā)布雷電黃色預(yù)警信號(hào):6小時(shí)內(nèi)我
走進(jìn)江蘇東臺(tái)晶澳科技項(xiàng)目工地,塔吊林立、機(jī)械轟鳴,數(shù)十輛工程車來回穿梭,1500多名工人在作業(yè)面上綁扎鋼
據(jù)中國(guó)報(bào)告大廳對(duì)2023年4月18日安徽省四氯乙烯價(jià)格最新走勢(shì)監(jiān)測(cè)顯示:2023年4月18日安徽省四氯乙烯(含量99 9
攜客云已先后完成五輪融資創(chuàng)業(yè)邦獲悉,供應(yīng)鏈關(guān)系管理系統(tǒng)攜客云宣布完成數(shù)千萬元B+輪融資,由隱山資本領(lǐng)投
現(xiàn)在,人工智能已經(jīng)開始進(jìn)入各個(gè)領(lǐng)域,其中包括修復(fù)老照片。隨著時(shí)間的流逝,老照片可能會(huì)變得破損、模糊或
明日方舟音律聯(lián)覺演出上海站即將在4月29日正式開啟,這次的演出內(nèi)容也是非常精彩的,預(yù)計(jì)時(shí)長(zhǎng)有130分鐘,玩
犯罪嫌疑人被抓獲歸案。警方供圖華龍網(wǎng)-新重慶客戶端訊(記者余志斌)26年前,在重慶市潼南區(qū)上和鎮(zhèn),發(fā)生
今天來聊聊關(guān)于cad2014打開圖紙顯示不全怎么回事,cad2014打開圖紙顯示不全的文章,現(xiàn)在就為大家來簡(jiǎn)單介紹下ca
零食是很多人喜歡吃的視食品,味道好,種類多,可以閑暇時(shí)間解饞,尤其受年輕人喜歡,不少人想要開一家零食
千味央廚4月19日公布2022年年度分紅預(yù)案:以8664 24萬股股本為基數(shù),向全體股東每10股派發(fā)現(xiàn)金紅利1 7元(含
多重繼承是指一個(gè)子類繼承多個(gè)父類,而這些父類本身也繼承自其它類。在Python中,多重繼承可以實(shí)現(xiàn)復(fù)雜的繼
俄羅斯釣魚4是一款免費(fèi)的模擬類多人開放世界釣魚游戲,玩家可以與朋友在游戲中盡情垂釣,官方在4月18日發(fā)布
近年來,消費(fèi)品行業(yè)雖受到宏觀環(huán)境的較大影響,但其發(fā)展仍舊表現(xiàn)出極強(qiáng)韌性,隨著國(guó)家消費(fèi)刺激政策及產(chǎn)業(yè)扶持
派真生物是一家腺相關(guān)病毒研發(fā)生產(chǎn)商,專注于快速、大規(guī)模生產(chǎn)高純度、高滴度、高感染力的臨床前和臨床級(jí)別
4月18日,外交部發(fā)言人汪文斌主持例行記者會(huì)。有記者提問,美國(guó)務(wù)卿布林肯在G7外長(zhǎng)會(huì)上表示,中國(guó)必須表明
17個(gè)項(xiàng)目集中簽約逾200億元湖北首屆國(guó)際物流峰會(huì)在鄂州召開---湖北日?qǐng)?bào)訊(記者戴勁松、李朝霞、周鵬)4月1
針對(duì)信用卡持卡人不同的消費(fèi)需求建設(shè)更多優(yōu)質(zhì)消費(fèi)場(chǎng)景,已成為各家銀行搶奪信用卡市場(chǎng)份額的制勝法寶。4大
作為全國(guó)“東數(shù)西算”工程大灣區(qū)國(guó)家樞紐節(jié)點(diǎn),廣東韶關(guān)正成為大數(shù)據(jù)產(chǎn)業(yè)集聚的“優(yōu)選之地”。
4月18日北向資金全天成交額1272 77億元,成交凈買入21 37億元。證券時(shí)報(bào)?數(shù)據(jù)寶統(tǒng)計(jì)顯示,4月18日滬指上漲0
Copyright 2015-2023 今日酒業(yè)網(wǎng) 版權(quán)所有 備案號(hào):滬ICP備2023005074號(hào)-40 聯(lián)系郵箱:5 85 59 73 @qq.com