• Что бы вступить в ряды "Принятый кодер" Вам нужно:
    Написать 10 полезных сообщений или тем и Получить 10 симпатий.
    Для того кто не хочет терять время,может пожертвовать средства для поддержки сервеса, и вступить в ряды VIP на месяц, дополнительная информация в лс.

  • Пользаватели которые будут спамить, уходят в бан без предупреждения. Спам сообщения определяется администрацией и модератором.

  • Гость, Что бы Вы хотели увидеть на нашем Форуме? Изложить свои идеи и пожелания по улучшению форума Вы можете поделиться с нами здесь. ----> Перейдите сюда
  • Все пользователи не прошедшие проверку электронной почты будут заблокированы. Все вопросы с разблокировкой обращайтесь по адресу электронной почте : info@guardianelinks.com . Не пришло сообщение о проверке или о сбросе также сообщите нам.

Google Agent Development Kit (ADK) Introduction (2): Building a Multi-Agent Meeting Scheduling System

Lomanu4 Оффлайн

Lomanu4

Команда форума
Администратор
Регистрация
1 Мар 2015
Сообщения
1,481
Баллы
155
Learning Objectives

  • Master Tool Development and Integration Patterns: Learn how to design, implement, and integrate multiple tools within a multi-agent architecture.
  • Implement Complex Task Decomposition and Execution: Break down complex tasks like meeting scheduling into multiple steps, executed collaboratively by different agents.
  • API Permission Management and Error Handling: Understand Google Calendar API permission application, token management, and common error handling strategies.
  • Technical Breadth: Compare Google ADK with OpenAI Function Calling for multi-step task planning.
System Architecture and Project Structure


This project uses the Google ADK (Agent Development Kit) multi-agent architecture, breaking the meeting scheduling process into three specialized agents:

  • Validator Agent: Validates attendee email formats
  • Scheduler Agent: Integrates with Google Calendar API, responsible for scheduling and conflict detection
  • Notifier Agent: Generates and sends meeting notifications

These three agents are connected via SequentialAgent, forming a complete multi-step workflow.


meeting_workflow/
├── meeting_workflow_adk.py # Main ADK implementation
├── streamlit_app.py # Web interface
├── common/ # Shared utilities
│ └── google_auth.py # Google authentication functionality
├── agents/ # Agent configurations
│ └── .../.well-known/agent.json
├── requirements.txt # Dependencies
└── README.md # Project documentation
Tool Development and Integration

Tool Implementation


Each agent’s core capability is implemented as a Tool, inheriting from BaseTool and implementing the execute method.

Example: Email Validation Tool


class ValidateAttendeesTool(BaseTool):
def execute(self, context, attendees: list):
invalid_emails = [email for email in attendees if '@' not in email or '.' not in email]
if invalid_emails:
return {"valid": False, "invalid_emails": invalid_emails}
return {"valid": True}
Example: Meeting Scheduling Tool (Google Calendar Integration)


class ScheduleMeetingTool(BaseTool):
def execute(self, context, summary, start_time, duration_min, attendees, description=None):
# 1. Get Google Calendar credentials
service = get_calendar_service()
# 2. Check for time conflicts
# 3. If no conflicts, create the meeting event
# 4. Return the result
Example: Notification Tool


class SendMeetingNotificationTool(BaseTool):
def execute(self, context, event_id, summary, start_time, duration_min, attendees, description=None):
# Generate notification content; can be integrated with Email/Line/Slack, etc.
return {"status": "success", "message": "Notification sent"}
Integrating Tools into Agents


Each Agent is built around its tools and can be given an instruction:


validate_agent = Agent(
name="attendee_validator",
model="gemini-pro",
tools=[ValidateAttendeesTool()],
instruction="Validate meeting attendee email formats"
)
Multi-Step Task Planning (Workflow)


Use SequentialAgent to connect the three agents, forming a multi-step workflow:


meeting_workflow = SequentialAgent(
name="meeting_workflow",
sub_agents=[validate_agent, scheduling_agent, notification_agent],
instruction="Complete meeting scheduling workflow"
)

The main process process_meeting_request will:

  1. Validate email formats
  2. Attempt to schedule the meeting (if conflicts, return suggested times)
  3. Send meeting notifications
Google Calendar API Permission Management and Error Handling

Permissions and Token Management

  • You must first create a project in Google Cloud Console, enable the Calendar API, set up OAuth, and download credentials.json.
  • On first run, token.json is generated automatically and refreshed as needed.

def get_calendar_service():
if os.path.exists('token.json'):
creds = Credentials.from_authorized_user_file('token.json', SCOPES)
# ... If not, guide through OAuth flow ...
return build('calendar', 'v3', credentials=creds)
Error Handling

  • Email format errors, API errors, time conflicts, and network issues are all clearly reported.
  • All exceptions are logged for easy debugging.

try:
# Google Calendar API operations
except HttpError as error:
logger.error(f"Calendar API error: {error}")
return {"status": "error", "message": f"API Error: {str(error)}"}
Web Interface (Streamlit)


A simple web interface is provided for users to enter meeting information and instantly see scheduling results and conflict suggestions.


# streamlit_app.py
summary = st.text_input("Meeting Subject", "Product Development Discussion")
meeting_date = st.date_input("Meeting Date", ...)
meeting_time = st.time_input("Meeting Time", ...)
# ... On submit, call process_meeting_request ...
Comparison with OpenAI Function Calling

ItemGoogle ADK Multi-Agent/ToolOpenAI Function Calling
Multi-step Task FlowSupports SequentialAgentMust design multi-step logic manually
Tool IntegrationRegister as Tool classRegister as function schema
Permission & API MgmtHandle OAuth yourselfHandled by external code
Error HandlingCustomizable granularityMust wrap yourself
Multi-Agent WorkflowBuilt-in sub-agent supportMust decompose manually

Conclusion:

Google ADK is suitable for applications requiring multi-agent collaboration and complex task decomposition, with clear Tool/Agent concepts. OpenAI Function Calling is suitable for single-step, single-model-driven tasks; complex workflows must be designed manually.

Certainly! Here’s the revised conclusion section, now including clear instructions on how to execute the Python app from both the command line and the web interface:

Conclusion


This project demonstrates how to use Google ADK to develop a multi-agent meeting scheduling system, covering tool development, API integration, multi-step task planning, permission management, and error handling. You are encouraged to further try:

  • Adding cross-timezone support
  • Integrating meeting room reservations
  • Supporting natural language input and parsing
How to Run This Python App


Command Line Usage:

You can schedule a meeting directly from the command line by running:


python meeting_workflow_adk.py --summary "Product Meeting" --time "2025-05-15T14:00:00" --duration 60 --attendees "alice@example.com,bob@example.com" --description "Product development meeting"

Or, for a demonstration with example parameters, simply run:


python meeting_workflow_adk.py

Web Interface:

To use the Streamlit web interface, run:


streamlit run streamlit_app.py

Then open the displayed URL in your browser (typically

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

).

For complete code and examples, please refer to this project’s

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

.

Next Article Preview


Multi-Agent Collaboration System: Project Management Collaboration Platform

In the next article, we will explore how to build a multi-agent collaboration system for project management, featuring Manager, Engineering, and QA/Test agents. This system will demonstrate advanced agent collaboration patterns for handling project planning, task assignment, and quality assurance workflows. Stay tuned!


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

 
Вверх Снизу