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

Implement websurfer agent #701

Merged
merged 9 commits into from
Jan 29, 2025
Merged

Implement websurfer agent #701

merged 9 commits into from
Jan 29, 2025

Conversation

rjambrecic
Copy link
Collaborator

@rjambrecic rjambrecic commented Jan 29, 2025

Why are these changes needed?

We want to be able to use:

config_list = [{"model": "gpt-4o-mini", "api_key": os.environ["OPENAI_API_KEY"]}]

llm_config = {
    "config_list": config_list,
}

web_tool="browser_use" # or "crawl4ai"
user_proxy = UserProxyAgent(name="user_proxy", human_input_mode="NEVER")
websurfer = WebSurferAgent(name="WebSurfer", llm_config=llm_config, web_tool=web_tool)

websurfer_tools = websurfer.tools
# WebSurferAgent has a list of tools which are registered for LLM
# We need to register the tools for execution with the UserProxyAgent
for tool in websurfer_tools:
    tool.register_for_execution(user_proxy)

user_proxy.initiate_chat(
    recipient=websurfer,
    message="Get info from https://docs.ag2.ai/docs/Home",
    max_turns=2,
)

Related issue number

Closes #660

Checks

@davorrunje davorrunje added this pull request to the merge queue Jan 29, 2025
Merged via the queue into main with commit eaa5255 Jan 29, 2025
294 of 301 checks passed
@rjambrecic rjambrecic deleted the add-websurfer-agent branch January 29, 2025 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create uniform API for WebSurfer (uses different engines below)
2 participants