6
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Vertex AI Agent Builderを試してみた

Posted at

はじめに

2024年4月に,ラスベガスで行なわれたGoogle Cloud Next '24にて,Vertex AI Agent Builderが発表されました.今回はお試しにそれを触ってみようと思います.

Agent Builderとは

Agent Builderとは,生成AIを活用したAgent開発を簡単に行なうことができる,サーバーレスなフルマネージドサービスです.

料金

Vertex AI エージェントはクエリ1000件あたり$12となっています.
image.png

お題

今回はドキュメントに書かれていた「対話型 AI エージェントを構築する」を行ないます.ノーコードでAgentを作成することができます.
題材として,野球に関する質問が来たら,野球の専門家問い合わせをして回答するAppを作成します.

「新しいアプリ」 → 「Agent」

image.png

Agentの作成

以下2つのAgentを作成し,それぞれにGoalとInstructionsを付与します.

  • 質問受け付けAgent(Reception)
  • 野球専門家Agent(baseball expert)

Reception

Goal

Your goal is to collect the user's request and route the user to the correct expert among the various experts. 

Instructions

- Greet the user and tell them that you can help answer question s related baseball.
- DO NOT attempt to answer the user's question ever.
- ALWAYS transfer them directly to another topic.
- There is a topic you can choose from:
    - For questions related to maths transfert to  ${AGENT: baseball expert}

baseball expert

Goal

Your goal is to help users find answers related to baseball. DO NOT answer question of topics other than baseball.

Instructions

- Step 1. Ask the user to share the question.
- Step 2. Once the user shares the question, answer the question based on your knowledge.

image.png

Exampleの作成

Reception内に想定されるやり取りを追加

「Enter user input」で想定するユーザーの入力を行ない,適宜「Add action」を使って編集していきます.
今回は「Agent invocation」を選択し,baseball expertをお呼びします.
image.png

image.png

冒頭がUserからの入力だとエラーが出てExampleが保存できませんでした.なので,冒頭の「User: Hi」を削除して,最初はAgent Responseにします.

Only the default playbook can have examples that begin with a user utterance.

image.png

実際に問い合わせる

それでは,想定通りの質問をして野球の専門家が回答してくれるか確認します.
まずは,「野球に関して質問がある」とReceptionに言うと,baseball expertをお招きいただきました.
いたずらで,「ダブルフォルトとはなんですか?」「ダブルドリブルとはなんですか?」と聞いたのですが,専門外のようなので答えてくれませんでした.「ダブルプレーとはなんですか?」としたところうまく回答してくれました.

image.png

所感

複雑な作業をすることなく,簡単にAgentを作ることができました.非常に簡単ではあるとは思いますが,やはり中の動きがわからなかったり,設定の再現性を担保するにはコードで作る方が良いのかなと感じたりしています.

まとめ

単純な例を使って,Agent Builderを触ってみました.今後は応用先も検討していきたいです.

おまけ: SlackからAgentとやりとりする

ドキュメント通りに,今回作成したAgentをSlackから呼び出す事もできました.
image.png

参考

6
4
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
6
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?