パーソナルAIコパイロットは、実際のゲームチェンジャーとして登場しています。これらは、私たちが日常のタスクや責任を管理する方法を変革する可能性を持っています。基本的なチャットボットとは異なり、これらの知的アシスタントは、私たちの個人的な生活のニュアンスを理解する洗練されたシステムであり、日々の活動をよりスムーズかつ効率的にします。
そのようなAIコパイロットを構築するのは、適切なインフラがなければ複雑です。AWSマルチエージェントオーケストレーターは、複数のAIエージェントを管理するための柔軟で強力なフレームワークです。複数のAIエージェント。オーケストレーターの分類器は、ユーザー入力、エージェントの特性、および会話履歴に基づいて適切なエージェントを選択します。オーケストレーターはまた、エージェントごとの会話履歴の保存を促進します。
様々なタスクのためのAIコパイロットの構築
AIコパイロットを構築しましょう。このコパイロットはカレンダーをチェックし、フィットネスルーチンを提案し、ニュースを読むことができます。ニュースこれらは完全に異なるタスクであり、ユーザーとのインタラクションの中で異なる文脈を持つことがあります。このパーソナルアシスタントの完全なソースコードはこちらで見つけることができます。
カレンダーエージェント
これは内部でApiAgentを使用してCalendly APIを使用してカレンダーの招待状を取得するチェーンエージェントです。ApiAgentからのレスポンスはBedrockLLMAgentにストリーミングされ、招待状を要約します。
agent1 = ApiAgent(ApiAgentOptions(
endpoint = f"https://api.calendly.com/user_busy_times?user={CALENDLY_USER_URI}&start_time={start_time}&end_time={end_time}",
method = "GET",
name = "Calendly Schedule Agent",
description = "Specializes in Calendar scheduling",
streaming=False,
headers_callback=custom_headers_callback,
))
agent2 = BedrockLLMAgent(BedrockLLMAgentOptions(
name="Calendar Summarization",
streaming=True,
description="You are an AI agent specialized in summarizing calendar events. Given a list of events, produce a concise summary"\
" highlighting key details such as event names, dates, times, and participants. Ensure the summary is clear, brief, and "\
"informative for quick understanding. Do not provide duplicate information or irrelevant details.",
model_id="anthropic.claude-3-5-sonnet-20240620-v1:0",
callbacks=ChainlitAgentCallbacks()
))
ニュースリーダーエージェント
ニュースリーダーエージェントもチェーンエージェントを使用しており、内部でApiAgentを使用してGnews APIを使用してニュースを取得します。ApiAgentからのレスポンスはBedrockLLMAgentにストリーミングされ、ニュースを要約します。
agent1 = ApiAgent(ApiAgentOptions(
endpoint = f"https://gnews.io/api/v4/search?q=example&apikey={GNEWS_API_KEY}",
method = "GET",
name = "News Reader Agent",
description = "Specializes in reading news from various sources",
streaming=False
))
agent2 = BedrockLLMAgent(BedrockLLMAgentOptions(
name="News Summarization Agent",
streaming=True,
description="You are a skilled journalist tasked with creating concise, engaging news summaries."\
"Given the following text, produce a clear and informative summary that captures the key points," \
"main actors, and significant details. Your summary should be objective, well-structured, "\
"and easily digestible for a general audience. Aim for clarity and brevity while maintaining the essence of the news story.",
model_id="anthropic.claude-3-5-sonnet-20240620-v1:0",
callbacks=ChainlitAgentCallbacks()
))
フィットネスエージェント
フィットネスエージェントはスタンドアロンのエージェントで、LLMモデルを使用してフィットネスルーチン、食事プラン、健康に関するヒントを提案します。
fitness_agent = BedrockLLMAgent(BedrockLLMAgentOptions(
name="Fitness Agent",
streaming=True,
description="Specializes in fitness, health, and wellness. It can provide workout routines, diet plans, and general health tips.",
model_id="anthropic.claude-3-5-sonnet-20240620-v1:0",
callbacks=ChainlitAgentCallbacks()
))
アプリの実行
前提条件については以下の手順に従ってください。
1. リポジトリをクローンします:
git clone https://github.com/ravilaudya/task-copilot.git
cd task-copilot
2. 仮想環境を作成:
conda create -p venv python=3.12
conda activate ./venv
3. 必要な依存関係をインストール:
pip install -r requirements.txt
4. アプリを実行します:
chainlit run app.py --port 8888
コパイロットとのインタラクション
アプリが起動すると、ブラウザウィンドウが開き、そこでAIコパイロットと対話できます。質問例としては以下のものがあります:
- 「最新のニュースは何ですか?」
- 「今週のカレンダーはどうなっていますか?」
- 「どうすれば脂肪を落とせますか?」
結論
AIコパイロットは日常のタスクを効率化し、個々の好みに合わせた迅速かつ関連性の高い情報を提供することで生産性を向上させます。適切なインフラが整えば、このようなAIコパイロットの構築は管理可能で報酬の高いプロジェクトとなります。このようなコパイロットを持つことは、信頼できるパートナーが側にいるようなもので、生活を少しでも楽にすることができます。
Source:
https://dzone.com/articles/ai-copilot-using-multi-agent-orchestrator