-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
62 lines (41 loc) · 1.33 KB
/
main.py
File metadata and controls
62 lines (41 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
from langchain_google_genai import ChatGoogleGenerativeAI
from browser_use import Agent
from dotenv import load_dotenv
import os
import asyncio
# Read GEMINI_API_KEY into env
load_dotenv()
key = os.getenv("GEMINI_API_KEY")
# Initialize the model
llm = ChatGoogleGenerativeAI(model='gemini-2.0-flash',
temperature=1,
timeout=100,
api_key=key,
)
async def main():
# Create agent with the model
agent = Agent(
task="""
Task Overview
Please execute the following steps in order:
Create Google Account:
Navigate to Google Account creation.
Register a new personal Google account with the following details:
First Name: Sahil
Last Name: Kumar
Email: sahilkumar15792@gmail.com
Password: sahil123
Send Email Notification:
After account creation, log into the newly created Gmail account.
Compose and send an email to: saramali15792@gmail.com
Subject: Account Created
Body: Write something about browser-use agent.
ChatGPT Signup and Interaction:
Go to ChatGPT and sign up using the created Gmail account.
After successful signup and login, ask a Python-related question in ChatGPT
""",
llm=llm
)
await agent.run()
if __name__ == "__main__":
asyncio.run(main())