Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI updates #54

Merged
merged 40 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
4a10428
gradient animation + logo + close button
deepak-akkil Jun 18, 2024
928ee16
interim commit
deepak-akkil Jun 19, 2024
8b1bb82
working version
deepak-akkil Jun 19, 2024
3b07f00
Merge branch 'dev' into UI-updates
deepak-akkil Jun 19, 2024
4fe424e
First version
deepak-akkil Jun 19, 2024
34c8443
Gradient Update
deepak-akkil Jun 20, 2024
c5e454e
Stable version
deepak-akkil Jun 20, 2024
460848d
First stable version
deepak-akkil Jun 20, 2024
eb8004d
remove redundancy
deepak-akkil Jun 20, 2024
5fa8116
minor version
deepak-akkil Jun 20, 2024
2b1f778
Commit UI updates
deepak-akkil Jun 20, 2024
45bb1a5
Convert messaget_type to enum
deepak-akkil Jun 21, 2024
829d8b9
Clean up
deepak-akkil Jun 21, 2024
d4b8ab5
changes to address review comments
deepak-akkil Jun 21, 2024
2223db4
seeme like an extra character
Jun 21, 2024
375ab90
remove extra characters
Jun 21, 2024
e58a16b
small ruff adjustments
Jun 21, 2024
0ad6ced
remove unneeded vars/imports
Jun 21, 2024
a81aceb
Merge branch 'dev' into UI-updates
Jun 21, 2024
ba3ffb0
Enable button if text available in input field
deepak-akkil Jun 24, 2024
827634a
Minor bug fix to UI
deepak-akkil Jul 2, 2024
43e798a
Make UI refresh on Show_Details toggle change
deepak-akkil Jul 2, 2024
658e029
Priortize UI operation
deepak-akkil Jul 2, 2024
9bf44d0
Make slightly more responsive when minimized
deepak-akkil Jul 2, 2024
276f189
Add agente- prefix to all styles and ids to avoid style leak
deepak-akkil Jul 2, 2024
47fd92a
Merge branch 'dev' into UI-updates
deepak-akkil Jul 2, 2024
0749f29
bug fix
deepak-akkil Jul 2, 2024
8f62911
bug fix
deepak-akkil Jul 2, 2024
35db242
Add !important so styles do not get overridden
deepak-akkil Jul 2, 2024
2631b51
Merge branch 'dev' into UI-updates
Jul 2, 2024
1ad5c5a
linting to make ruff happy
Jul 2, 2024
6bfea14
more ruff stuff
Jul 2, 2024
36fc8a7
print the error clearly
Jul 2, 2024
3516c28
message type can only be one value, no reason to run all the checks
Jul 2, 2024
2d9e813
cleanup
Jul 2, 2024
4035083
fix typos in planner prompt
Jul 2, 2024
15390f7
this should be a debug level message
Jul 2, 2024
a7a765e
JS tripple equal for literal comparison
Jul 2, 2024
5b5750e
typos and logic tightening
Jul 2, 2024
c2ca27b
use logger
Jul 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'dev' into UI-updates
  • Loading branch information
deepak-akkil authored Jul 2, 2024
commit 47fd92ab80caef7dcfa7845927c6e1909d26e9f4
5 changes: 3 additions & 2 deletions ae/core/autogen_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ def reflection_message(recipient, messages, sender, config): # type: ignore
last_message=messages[-1]["content"] # type: ignore
content_json = parse_response(last_message) # type: ignore
next_step = content_json.get('next_step', None)
if next_step is None:

if next_step is None:
print ("Message to nested chat returned None")
return None
else:
next_step = next_step.strip() +" " + get_url() # type: ignore
Expand Down Expand Up @@ -337,7 +339,6 @@ async def process_command(self, command: str, current_url: str | None = None) ->
try:
if self.agents_map is None:
raise ValueError("Agents map is not initialized.")
print(self.agents_map["browser_nav_executor"].function_map) # type: ignore

result=await self.agents_map["user"].a_initiate_chat( # type: ignore
self.agents_map["planner_agent"], # self.manager # type: ignore
Expand Down
9 changes: 4 additions & 5 deletions ae/core/post_process_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ def final_reply_callback_user_proxy(recipient: autogen.ConversableAgent, message

return False, None


def final_reply_callback_planner_agent(message:str, message_type:MessageType = MessageType.STEP): # type: ignore
browser_manager = PlaywrightManager(browser_type='chromium', headless=False)
loop = asyncio.get_event_loop()
loop.run_until_complete(browser_manager.notify_user(message, message_type=message_type))
return False, None # required to ensure the agent communication flow continues
browser_manager = PlaywrightManager(browser_type='chromium', headless=False)
loop = asyncio.get_event_loop()
loop.run_until_complete(browser_manager.notify_user(message, message_type=message_type))
return False, None # required to ensure the agent communication flow continues
8 changes: 4 additions & 4 deletions ae/core/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
4. Very Important: Helper cannot go back to previous pages. If you need the helper to return to a previous page, you must explicitly add the URL of the previous page in the step (e.g. return to the search result page by navigating to the url https://www.google.com/search?q=Finland")

Guidelines:

1. If you know a URL, you can provide it to the helper to navigate to a new page (e.g. go to www.espn.com).
2. Do not assume any capability exists on the webpage. Ask questions to the helper to confirm the presence of features (e.g. is there a sort by price feature available on the page?). This will help you revise the plan as needed and also establish common ground with the helper.
3. Do not combine multiple steps into one. A step should be strictly as simple as interacting with a single element or navigating to a page. If you need to interact with multiple elements or perform multiple actions, you will break it down into multiple steps.
Expand Down Expand Up @@ -84,10 +85,9 @@
Execute function sequentially to avoid navigation timing issues. Once a task is completed, confirm completion with ##TERMINATE TASK##.
The given actions are NOT parallelizable. They are intended for sequential execution.
If you need to call multiple functions in a task step, call one function at a time. Wait for the function's response before invoking the next function. This is important to avoid collision.
Prefer to submit a form by clicking the submit button. Use enter key press only strictly when the submit button is not available.
Important: Always press Enter key after inputting dates as it is the most common way to submit dates.
Important: Unless otherwise specified, the task must be performed strictly the current page. Do not use openurl unless explicitly instructed to navigate to a page.
You will NOT provide any URLs of links on webpage. If user asks for URLs, you will instead provide the text of the hyperlink on the page and offer to click on it. This is very very important.
Strictly for search fields, submit the field by pressing Enter key. For other forms, click on the submit button.
Unless otherwise specified, the task must be performed on the current page. Use openurl only when explicitly instructed to navigate to a new page with a url specified. If you do not know the URL ask for it.
You will NOT provide any URLs of links on webpage. If user asks for URLs, you will instead provide the text of the hyperlink on the page and offer to click on it. This is very very important.
When inputing information, remember to follow the format of the input field. For example, if the input field is a date field, you will enter the date in the correct format (e.g. YYYY-MM-DD), you may get clues from the placeholder text in the input field.
if the task is ambigous or there are multiple options to choose from, you will ask the user for clarification. You will not make any assumptions.
Individual function will reply with action success and if any changes were observed as a consequence. Adjust your approach based on this feedback.
Expand Down
1 change: 1 addition & 0 deletions ae/core/ui_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def update_overlay_state(self, is_collapsed: bool):
self.overlay_is_collapsed = is_collapsed



async def update_overlay_show_details(self, show_details: bool, page: Page):
"""
Updates the state of the overlay to either show steps or not.
Expand Down
2 changes: 2 additions & 0 deletions ae/utils/autogen_sequential_function_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import asyncio
import inspect
from typing import Any

from typing import Dict
from typing import List
from typing import Optional
Expand All @@ -12,6 +13,7 @@
from autogen import UserProxyAgent



class UserProxyAgent_SequentialFunctionExecution(UserProxyAgent):
def __init__(self, *args, **kwargs): # type: ignore
super().__init__(*args, **kwargs) # type: ignore
Expand Down
5 changes: 5 additions & 0 deletions ae/utils/dom_mutation_observer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@

import asyncio

import json
from typing import Callable # noqa: UP035

from playwright.async_api import Page

# Create an event loop
loop = asyncio.get_event_loop()

Expand Down
3 changes: 0 additions & 3 deletions ae/utils/response_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ def parse_response(message: str) -> dict[str, Any]:
"""
# Parse the response content
json_response = {}

#if message starts with ``` and ends with ``` then remove them
if message.startswith("```"):
message = message[3:]
Expand All @@ -23,10 +22,8 @@ def parse_response(message: str) -> dict[str, Any]:
except Exception as e:
# If the response is not a valid JSON, try pass it using string matching.
#This should seldom be triggered

message = message.replace("\\n", "\n")
message = message.replace("\n", "") # type: ignore

if ("plan" in message and "next_step" in message):
start = message.index("plan") + len("plan")
end = message.index("next_step")
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.