📚

Google AI Agents for Researchで学ぶAI agent 開発

に公開

AI agentの開発情報や開発のためのツールが,ここ最近一気に広まってきたように思います.
Googleが主催するワークショップ "GDG AI for Science (Australia)"にZoomで参加したので,その際に行った話をまとめてみようと思います.

環境構築

API keyの取得

まずは,Google AI StudioのAPI keyを取得することをお勧めします.ここでは個人用のアカウントを使用するのをお勧めします(個人開発の読者を想定.)大学や会社のGoogle Accountでは,そもそもAPI機能がアクティベートされていない可能性が高いからです.

  1. https://aistudio.google.com/api-keys にアクセスし,
  2. Get API keys (Tabの左下)をクリック.
  3. 右上のAPIキーを作成をクリック
  4. キーの名前とプロジェクトを作成.
  5. これでAPI keyが作成できました.

実際にAPIでGeminiを呼び出す

開発環境;Python 3.12.5

  1. pipでインストールする.
pip install google-adk
  1. agentを作成してみましょう,
adk create my_agent  
  1. 実際にagentを呼び出してみましょう.
adk run my_agent

実際に呼び出した結果がこちらです.

[user]: hello gemini, I'm now using adk kit which google is now developping.  What kind of jobs can you execute?
[root_agent]: Hello! It's nice to meet you.

First, just to clarify, I am not Gemini. I am a large language model, and my internal name is "root_agent."
I don't "use" or "develop" kits like the ADK (Accessory Development Kit). The ADK is typically a platform for developers to create accessories that connect to Android devices, and I am an AI, not a human developer or a physical device.

However, as an AI, I can execute a wide variety of "jobs" or tasks for you. Here are some examples of what I can do:

*   **Answer Questions:** I can provide information on a vast range of topics, from general knowledge to specific technical concepts.
*   **Generate Text:** I can write stories, poems, code snippets, scripts, emails, letters, blog posts, and more.
*   **Summarize Information:** I can condense long articles, documents, or conversations into shorter summaries.
*   **Translate Languages:** I can translate text between different languages.
*   **Explain Concepts:** I can break down complex ideas into simpler terms.
*   **Assist with Coding:** I can help you understand code, debug issues (given enough context), or generate code examples in various programming languages.
*   **Brainstorm Ideas:** I can help you come up with creative solutions or generate ideas for projects.
*   **Provide Definitions:** I can define terms and explain jargon.
*   **Perform Calculations:** I can handle mathematical problems.
*   **Help with Learning:** I can act as a study aid by explaining subjects or testing your knowledge.

So, while I don't build hardware accessories, I can certainly assist you with information, creation, and understanding in many other ways! What can I help you with today?
[user]: 

実際に呼び出すことができました!

Discussion