You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
944 B
44 lines
944 B
import asyncio
|
|
|
|
from browser_use import Agent
|
|
from dotenv import load_dotenv
|
|
from langchain_openai import ChatOpenAI
|
|
|
|
from swarms import ConcurrentWorkflow
|
|
|
|
load_dotenv()
|
|
|
|
|
|
class BrowserAgent:
|
|
def __init__(self, agent_name: str = "BrowserAgent"):
|
|
self.agent_name = agent_name
|
|
|
|
async def browser_agent_test(self, task: str):
|
|
agent = Agent(
|
|
task=task,
|
|
llm=ChatOpenAI(model="gpt-4o"),
|
|
)
|
|
result = await agent.run()
|
|
return result
|
|
|
|
def run(self, task: str):
|
|
return asyncio.run(self.browser_agent_test(task))
|
|
|
|
|
|
swarm = ConcurrentWorkflow(
|
|
agents=[BrowserAgent() for _ in range(3)],
|
|
)
|
|
|
|
swarm.run(
|
|
"""
|
|
Go to pump.fun.
|
|
|
|
2. Make an account: use email: "test@test.com" and password: "test1234"
|
|
|
|
3. Make a coin called and give it a cool description and etc. Fill in the form
|
|
|
|
4. Sit back and watch the coin grow in value.
|
|
|
|
"""
|
|
)
|