The system is designed to automate the process of booking an appointment through a web interface. The system leverages agentic AI to dynamically plan the steps based on user commands, locate the required elements on the web page, handle missing required fields, execute the steps using Selenium, and format the available appointment dates and times for user display. The system consists of several key components: the planning agent, element locator agent, Selenium executor, and a formatter agent.
- User Command Input
- Planning Agent
- Element Locator Agent
- Required Field Checker
- Selenium Executor
- Formatter Agent
-
User Command Input
- The user provides a command to book an appointment, specifying any known details (e.g., "Book a doctor's appointment for John Doe").
-
Planning Agent
- The planning agent interprets the user command and breaks it down into a sequence of actionable steps required to complete the booking process.
- Output: A list of steps, such as opening the booking page, entering user details, selecting appointment type, and submitting the form.
-
Element Locator Agent
- For each step, the element locator agent dynamically finds the best element locators using the
get_element_attributes
function. - Functionality:
- Extract attributes such as
id
,name
,class
,type
,placeholder
,aria-label
, andrequired
. - Identify the best locator for each element based on the extracted attributes.
- Extract attributes such as
- Output: A list of steps with corresponding element locators.
- For each step, the element locator agent dynamically finds the best element locators using the
-
Required Field Checker
- The system checks if all required fields are covered by the user-provided data.
- If any required field is missing, the system prompts the user to enter the missing information and updates the steps accordingly.
- Output: An updated list of steps with all required fields filled.
-
Selenium Executor
- The system executes the steps using Selenium, interacting with the web elements as planned and located.
- Functionality:
- Open the web page.
- Enter text in input fields.
- Click buttons or submit forms.
- Output: The system navigates through the booking process and extracts the available appointment dates and times.
-
Formatter Agent
- The extracted appointment dates and times are passed to another LLM (Language Model) to format them into a structured format.
- Output: A user-friendly display of available appointment dates and times.
User Command Input
|
v
Planning Agent
|
v
Element Locator Agent
|
v
Required Field Checker <--> User Interaction (if required fields are missing)
|
v
Selenium Executor
|
v
Formatter Agent
|
v
Formatted Appointment Availability
This system design ensures that the appointment booking process is dynamic, adaptable to changes in the web page design, and user-friendly. By separating the responsibilities into distinct agents and incorporating a robust workflow, the system can handle complex user queries efficiently and provide accurate results.