קופילוטים אישיים מבוססי בינה מלאכותית מתהווים כמשנים משחק אמיתיים. יש להם את הפוטנציאל לשנות את האופן שבו אנו מנהלים את המשימות והאחריות היומיות שלנו. בניגוד לצ'אטבוטים בסיסיים, העוזרים החכמים הללו הם מערכות מתקדמות שמבינות את הניואנסים של חיינו האישיים, מה שהופך את הפעולות היומיות שלנו לחלקות ויעילות יותר.
בניית קופילוט בינה מלאכותית כזה יכולה להיות מורכבת ללא תשתית מתאימה. AWS Multi-Agent Orchestrator הוא מסגרת גמישה וחזקה לניהול מספר סוכני בינה מלאכותית. ה מאורגן מסווג בוחר את הסוכן המתאים בהתבסס על הקלט של המשתמש, על מאפייני הסוכן, ועל היסטוריית השיחות. המאורגן גם מקל על אחסון היסטוריית השיחות לכל סוכן.
בניית קופילוט בינה מלאכותית למשימות שונות
בואו נבנה AI שותף שיכול לבדוק את היומן, להציע רוטינות כושר ולקרוא את החדשות בו זמנית. אלו הן משימות נפרדות לחלוטין שיכולות להיות להן הקשרים שונים במהלך האינטראקציות של המשתמש איתן. הקוד המקורי המלא של עוזר אישי זה ניתן למצוא כאן.
סוכן יומן
זהו סוכן שרשרת שמשתמש בפנימית ב-ApiAgent כדי למשוך הזמנות ליומן באמצעות ה-APIs של Calendly. התגובה מ-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 APIs. התגובה מ-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
התקשרות עם השותף הרובוטי
כאשר האפליקציה פועלת, חלון דפדפן ייפתח בו תוכל להתקשר עם השותף הרובוטי המלמד. כמה שאלות דוגמה שתוכל לשאול כוללות:
- "מהן החדשות האחרונות?"
- "איך נראה לוח השנה שלי השבוע?"
- "איך אני יכול לרדת במשקל?"
מסקנה
השותף הרובוטי מקצר משימות יומיות ומשפר את היציבות על ידי לספק מידע מהיר ורלוונטי המותאם להעדפות האישיות. עם התשתית הנכונה במקום, בניית שותף כזה הופכת לפרויקט ניהולי וממליץ. בעזרת שותף כזה זה כאילו יש לך שותף אמין לידך, שמקל קצת על חייך.
Source:
https://dzone.com/articles/ai-copilot-using-multi-agent-orchestrator