-
Notifications
You must be signed in to change notification settings - Fork 184
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
Magentic One Websurfer #192
Open
Merlinvt
wants to merge
4
commits into
ag2ai:magentic-one
Choose a base branch
from
Merlinvt:web-surfer
base: magentic-one
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
281 changes: 281 additions & 0 deletions
281
autogen/agentchat/contrib/magentic_one/web_tool_definitions.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,281 @@ | ||
TOOL_VISIT_URL = { | ||
"type": "function", | ||
"function": { | ||
"name": "visit_url", | ||
"description": "Navigate directly to a provided URL using the browser's address bar. Prefer this tool over other navigation techniques in cases where the user provides a fully-qualified URL (e.g., choose it over clicking links, or inputing queries into search boxes).", | ||
"parameters": { | ||
"type": "object", | ||
"properties": { | ||
"reasoning": { | ||
"type": "string", | ||
"description": "A short explanation of the reasoning for calling this tool and taking this action.", | ||
}, | ||
"url": { | ||
"type": "string", | ||
"description": "The URL to visit in the browser.", | ||
}, | ||
}, | ||
"required": ["reasoning", "url"], | ||
}, | ||
}, | ||
} | ||
|
||
TOOL_WEB_SEARCH = { | ||
"type": "function", | ||
"function": { | ||
"name": "web_search", | ||
"description": "Performs a web search on Bing.com with the given query.", | ||
"parameters": { | ||
"type": "object", | ||
"properties": { | ||
"reasoning": { | ||
"type": "string", | ||
"description": "A short explanation of the reasoning for calling this tool and taking this action.", | ||
}, | ||
"query": { | ||
"type": "string", | ||
"description": "The web search query to use.", | ||
}, | ||
}, | ||
"required": ["reasoning", "query"], | ||
}, | ||
}, | ||
} | ||
|
||
|
||
TOOL_HISTORY_BACK = { | ||
"type": "function", | ||
"function": { | ||
"name": "history_back", | ||
"description": "Navigates back one page in the browser's history. This is equivalent to clicking the browser back button.", | ||
"parameters": { | ||
"type": "object", | ||
"properties": { | ||
"reasoning": { | ||
"type": "string", | ||
"description": "A short explanation of the reasoning for calling this tool and taking this action.", | ||
}, | ||
}, | ||
"required": ["reasoning"], | ||
}, | ||
}, | ||
} | ||
|
||
TOOL_PAGE_UP = { | ||
"type": "function", | ||
"function": { | ||
"name": "page_up", | ||
"description": "Scrolls the entire browser viewport one page UP towards the beginning.", | ||
"parameters": { | ||
"type": "object", | ||
"properties": { | ||
"reasoning": { | ||
"type": "string", | ||
"description": "A short explanation of the reasoning for calling this tool and taking this action.", | ||
}, | ||
}, | ||
"required": ["reasoning"], | ||
}, | ||
}, | ||
} | ||
|
||
|
||
TOOL_PAGE_DOWN = { | ||
"type": "function", | ||
"function": { | ||
"name": "page_down", | ||
"description": "Scrolls the entire browser viewport one page DOWN towards the end.", | ||
"parameters": { | ||
"type": "object", | ||
"properties": { | ||
"reasoning": { | ||
"type": "string", | ||
"description": "A short explanation of the reasoning for calling this tool and taking this action.", | ||
}, | ||
}, | ||
"required": ["reasoning"], | ||
}, | ||
}, | ||
} | ||
|
||
|
||
TOOL_CLICK = { | ||
"type": "function", | ||
"function": { | ||
"name": "click", | ||
"description": "Clicks the mouse on the target with the given id.", | ||
"parameters": { | ||
"type": "object", | ||
"properties": { | ||
"reasoning": { | ||
"type": "string", | ||
"description": "A short explanation of the reasoning for calling this tool and taking this action.", | ||
}, | ||
"target_id": { | ||
"type": "integer", | ||
"description": "The numeric id of the target to click.", | ||
}, | ||
}, | ||
"required": ["reasoning", "target_id"], | ||
}, | ||
}, | ||
} | ||
|
||
|
||
TOOL_INPUT_TEXT = { | ||
"type": "function", | ||
"function": { | ||
"name": "input_text", | ||
"description": "Types the given text value into the specified field.", | ||
"parameters": { | ||
"type": "object", | ||
"properties": { | ||
"reasoning": { | ||
"type": "string", | ||
"description": "A short explanation of the reasoning for calling this tool and taking this action.", | ||
}, | ||
"input_field_id": { | ||
"type": "integer", | ||
"description": "The numeric id of the input field to receive the text.", | ||
}, | ||
"text_value": { | ||
"type": "string", | ||
"description": "The text to type into the input field.", | ||
}, | ||
}, | ||
"required": ["reasoning", "input_field_id", "text_value"], | ||
}, | ||
}, | ||
} | ||
|
||
|
||
TOOL_SCROLL_ELEMENT_DOWN = { | ||
"type": "function", | ||
"function": { | ||
"name": "scroll_element_down", | ||
"description": "Scrolls a given html element (e.g., a div or a menu) DOWN.", | ||
"parameters": { | ||
"type": "object", | ||
"properties": { | ||
"reasoning": { | ||
"type": "string", | ||
"description": "A short explanation of the reasoning for calling this tool and taking this action.", | ||
}, | ||
"target_id": { | ||
"type": "integer", | ||
"description": "The numeric id of the target to scroll down.", | ||
}, | ||
}, | ||
"required": ["reasoning", "target_id"], | ||
}, | ||
}, | ||
} | ||
|
||
|
||
TOOL_SCROLL_ELEMENT_UP = { | ||
"type": "function", | ||
"function": { | ||
"name": "scroll_element_up", | ||
"description": "Scrolls a given html element (e.g., a div or a menu) UP.", | ||
"parameters": { | ||
"type": "object", | ||
"properties": { | ||
"reasoning": { | ||
"type": "string", | ||
"description": "A short explanation of the reasoning for calling this tool and taking this action.", | ||
}, | ||
"target_id": { | ||
"type": "integer", | ||
"description": "The numeric id of the target to scroll UP.", | ||
}, | ||
}, | ||
"required": ["reasoning", "target_id"], | ||
}, | ||
}, | ||
} | ||
|
||
TOOL_READ_PAGE_AND_ANSWER = { | ||
"type": "function", | ||
"function": { | ||
"name": "answer_question", | ||
"description": "Uses AI to answer a question about the current webpage's content.", | ||
"parameters": { | ||
"type": "object", | ||
"properties": { | ||
"reasoning": { | ||
"type": "string", | ||
"description": "A short explanation of the reasoning for calling this tool and taking this action.", | ||
}, | ||
"question": { | ||
"type": "string", | ||
"description": "The question to answer.", | ||
}, | ||
}, | ||
"required": ["reasoning", "question"], | ||
}, | ||
}, | ||
} | ||
|
||
|
||
TOOL_SUMMARIZE_PAGE = { | ||
"type": "function", | ||
"function": { | ||
"name": "summarize_page", | ||
"description": "Uses AI to summarize the entire page.", | ||
"parameters": { | ||
"type": "object", | ||
"properties": { | ||
"reasoning": { | ||
"type": "string", | ||
"description": "A short explanation of the reasoning for calling this tool and taking this action.", | ||
}, | ||
}, | ||
"required": ["reasoning"], | ||
}, | ||
}, | ||
} | ||
|
||
TOOL_SLEEP = { | ||
"type": "function", | ||
"function": { | ||
"name": "sleep", | ||
"description": "Wait a short period of time. Call this function if the page has not yet fully loaded, or if it is determined that a small delay would increase the task's chances of success.", | ||
"parameters": { | ||
"type": "object", | ||
"properties": { | ||
"reasoning": { | ||
"type": "string", | ||
"description": "A short explanation of the reasoning for calling this tool and taking this action.", | ||
}, | ||
}, | ||
"required": ["reasoning"], | ||
}, | ||
}, | ||
} | ||
|
||
|
||
TOOL_TYPE = { | ||
"type": "function", | ||
"function": { | ||
"name": "input_text", | ||
"description": "Types the given text value into the specified field.", | ||
"parameters": { | ||
"type": "object", | ||
"properties": { | ||
"reasoning": { | ||
"type": "string", | ||
"description": "A short explanation of the reasoning for calling this tool and taking this action.", | ||
}, | ||
"input_field_id": { | ||
"type": "integer", | ||
"description": "The numeric id of the input field to receive the text.", | ||
}, | ||
"text_value": { | ||
"type": "string", | ||
"description": "The text to type into the input field.", | ||
}, | ||
}, | ||
"required": ["reasoning", "input_field_id", "text_value"], | ||
}, | ||
}, | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please give a magentic one specific name. General name may lead to overwriting other tools.
Also applies to following tool names.