LoginSignup
57
57

More than 1 year has passed since last update.

Auto-GPTで会社の基本理念を分析してみた

Last updated at Posted at 2023-04-13

はじめに: Auto-GPTの紹介

Auto-GPTは、GPT-4が完全自動で動作する最初の例の1つとして、作られたそうです。
この記事では、Auto-GPTのインストールと使用方法について解説します。

※この記事は2023年4月時点のものです。

準備: Python3とAuto-GPTの環境構築

Python3をインストール

公式サイトのダウンロードページから、お使いのOSに合ったインストーラーをダウンロードし、インストール手順に従ってください。

Auto-GPTの環境を整える

https://github.com/Significant-Gravitas/Auto-GPT

git clone https://github.com/Significant-Gravitas/Auto-GPT.git
cd 'Auto-GPT'
pip install -r requirements.txt
mv .env.template .env

APIキーの取得と設定

Auto-GPTは、複数のAPIを利用して機能を提供します。以下のサービスからAPIキーを取得し、.envファイルに設定します。

OpenAI API

  1. OpenAIのウェブサイトでアカウントを作成します。
  2. APIキーのページで新しいシークレットキーを作成します。
  3. シークレットキーを.envファイルのOPENAI_API_KEYにコピー&ペーストします。

Pinecone API (AIの長期記憶用)

  1. Pineconeのウェブサイトでアカウントを作成します。
  2. APIキーを作成し、.envファイルのPINECONE_API_KEYにコピー&ペーストします。

Elevenlabs API (AIに話してもらいたい場合)

今回は不要なのですが、一応記載しておきます。

  1. Elevenlabsのウェブサイトでアカウントを作成します。
  2. プロフィールページでAPIキーを取得し、.envファイルのELEVENLABS_API_KEYにコピー&ペーストします。

Google API (検索用)

  1. Google Cloud Consoleで新しいプロジェクトを作成します。
  2. メニューから「APIとサービス」→「ライブラリ」→「Custom Search API」を選択します。
  3. APIを有効にし、認証情報を作成します。
  4. APIキーを.envファイルのGOOGLE_API_KEYにコピー&ペーストします。

プログラム可能な検索エンジン (検索用)

  1. Googleのプログラム可能な検索エンジンにアクセスします。
  2. 検索エンジンの名前を入力し、「ウェブ全体を検索」を選択します。
  3. 「作成」をクリックします。
  4. 以下のようなコードが出力されるので、cx=の値を.envのCUSTOM_SEARCH_ENGINE_IDにコピペします。
<script async src="https://cse.google.com/cse.js?cx=xxxxxxxxxxxxxxxxxx">
</script>
<div class="gcse-search"></div>

最終的に、.envがこんな感じになります。
スクリーンショット 2023-04-14 1.49.42.png

動作確認

VSCodeなどでscripts/main.pyを実行すると、対話型で進みます。(実行はコマンドラインでもOK)

AIに名前を付ける

今回は、myGPTという名前にしました。

Welcome 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: myGPT

役割の設定

優秀なコンサルタントの設定にしました。

myGPT 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.'
myGPT is: 優秀なコンサルタント

タスクの指示

最大で5つのタスクを指示できます。
5つなくても大丈夫ですが、最後は処理を終わらせましょう。
英語で指示した方が精度が高いようですが、今回は日本語で指示をしてみます。

所属している会社の基本理念を分析して、解説してもらいます。

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: 株式会社ダイヤモンドファンタジーのサイト(https://diamond-f.co.jp/about/philosophy/)から基本理念と5カ条を取得して、philosophy.txtに日本語で出力する
Goal 2: 基本理念と5カ条について、より詳細な解説をphilosophy_detail.txtに日本語で出力する
Goal 3: 終わったら終了する
Goal 4: 

以下のようなメッセージが出力されるので、yで進みます。
何度か同じようなやりとりを繰り返しますが、今回は全て「y」でお任せしました。
様々なサイトを巡回して、調査してくれます。

Using memory of type: LocalCache
MYGPT THOUGHTS:  Let's begin by searching for the website of the company, 株式会社ダイヤモンドファンタジー, using the 'google' command.
REASONING:  Searching for the website will allow us to find out more about the company's philosophy and 5カ条, which will help us complete the task at hand.
PLAN: 
-  Use 'google' to search for the website of 株式会社ダイヤモンドファンタジー
-  Extract the information we need from their website
CRITICISM:  None
Attempting to fix JSON by finding outermost brackets 
Apparently json was fixed. 
NEXT ACTION:  COMMAND = google ARGUMENTS = {'input': '株式会社ダイヤモンドファンタジー website'}
Enter 'y' to authorise command, 'y -N' to run N continuous commands, 'n' to exit program, or enter feedback for myGPT...
Input:y

◾️各項目の説明
MYGPT THOUGHTS:AIが考えていることを表します。
REASONING:AIがなぜその考えに至ったかを説明します。
PLAN:AIがどのようにタスクを実行するかの計画です。
CRITICISM:AIが自分の考えや計画に対する批判的な意見を提供します。
NEXT ACTION:AIが次に実行するアクションです。

実行結果

結果がauto_gpt_workspaceディレクトリに出力されるので、確認してみます。
出力が英語だったので、ChatGPTに翻訳してもらった文章も追記しました。

The basic philosophy of Diamond Fantasy Inc is to be a wonderful person that the world seeks. The 5 principles of being a wonderful person are to show love, gratitude, and respect for customers, colleagues, and family; enjoy work and accomplish it passionately; communicate promptly and collaborate with people involved; challenge new things with a "let's try it" spirit; and cultivate a humorous mindset.

Diamond Fantasy Incの基本哲学は、世界が求める素晴らしい人物であることです。素晴らしい人物であるための5つの原則は、顧客、同僚、家族に対して愛情、感謝、尊敬の念を示すこと;仕事を楽しみ、情熱を持って達成すること;適切にコミュニケーションを取り、関係者と協力すること;「やってみよう」の精神で新しいことに挑戦すること;そしてユーモアあふれる心構えを養うことです。

続いて、詳細な解説の方を確認してみます。

The basic philosophy of Diamond Fantasy Inc. is to be a wonderful person who is actively sought after by society. This is achieved by following the '5 articles of a wonderful person,' which are as follows:

  1. Show love, gratitude, and respect to customers, colleagues, and family. Do not take them for granted and be sure to show your appreciation.

  2. Enjoy work and tackle it with enthusiasm. Find something that you are passionate about and pour your heart and soul into it.

  3. Respond to communication quickly and cooperate with others. Communication is key to success in any team, and good communication skills are a must.

  4. Challenge yourself with a 'let's try it' attitude. Do not be afraid to take risks, as it is only through these risks that you can truly grow.

  5. Nurturing a humorous imagination. Finding humor in the everyday things around us can help to create a positive and productive work environment.

Diamond Fantasy Inc.の基本哲学は、社会から積極的に求められる素晴らしい人物であることです。これは、「素晴らしい人物の5箇条」に従うことで実現されます。それらは以下の通りです。

  1. 顧客、同僚、家族に愛情、感謝、尊敬の念を示すこと。彼らを当たり前と思わず、感謝の気持ちを忘れずに示しましょう。

  2. 仕事を楽しみ、情熱を持って取り組むこと。情熱を持てる何かを見つけ、心と魂を注ぎ込んで取り組みましょう。

  3. 迅速にコミュニケーションに対応し、他者と協力すること。コミュニケーションはどんなチームでも成功の鍵であり、良いコミュニケーションスキルは必須です。

  4. 「やってみよう」の姿勢で自分に挑戦すること。リスクを恐れずに挑戦してみることで、真に成長できます。

  5. ユーモアあふれる想像力を育てること。身の回りの日常的なことでユーモアを見つけることで、前向きで生産的な職場環境を作り出す助けとなります。

基本理念そのままではなく、解釈も加えて出力してます。

日本語で指示をしても、ちゃんと動きましたね。
役割がコンサルタントだったからか、このあとも基本理念に基づく提案を作成してくれました。(長くなりそうだったので「n」で終了させました)

気になるコスト

OpenAIのコストを見てみます。
普段よりはコストがかかりましたが、繰り返しテストしても1ドルかかりませんでした。
無料枠(18ドル分)が残っていたので、今回はコストがかかってないです。
スクリーンショット 2023-04-14 1.51.02.png
他のAPIも、今回はコストがかかってません。(おそらく)

まとめ

この記事では、Auto-GPTのインストールと基本的な使い方を解説しました。AIを利用して自動的にタスクを実行することで、作業効率が向上し、新たな可能性が広がります。Auto-GPTを活用して、さまざまなタスクに挑戦してみてください:smiley:

私もまだ使い始めなので、色々と検証してみます!

57
57
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
57
57