Here’s how you create an agent, and run a task:
from notte_sdk import NotteClient
notte = NotteClient()
with notte.Session() as session:
agent = notte.Agent(session=session)
agent.run(task="go to google, and find cat pictures")
Usage
See more information on the available operations:
Running with a session
Providing a session to your agent allows you to choose specific options, like changing your browser or using proxies.
from notte_sdk import NotteClient
notte = NotteClient()
with notte.Session(browser_type="firefox") as session:
_ = notte.Agent(session=session).run(
task="What's the weather like in SF tonight?",
)
Providing credentials
Agents can be provided a vault with credentials in order to securely log in to websites without sharing your information to the LLM.
from notte_sdk import NotteClient
notte = NotteClient()
# Get your vault id from the Notte dashboard
vault = notte.Vault(vault_id="my_vault_id")
# Add your credentials securely
_ = vault.add_credentials(
url="https://github.com/",
email="my_cool_email@gmail.com",
password="my_cool_password",
# Check https://github.com/scito/extract_otp_secrets to extract your MFA secret
# from your authenticator app
mfa_secret="PYNT7I67RFS2EPR5",
)
# Run an agent with secure credential access
with notte.Session() as session:
agent = notte.Agent(vault=vault, session=session, max_steps=10)
response = agent.run(task="Go to the nottelabs/notte repo and star it. If it's already starred don't unstar it.")
Parameters
You can use the default parameters to create your session, or customize them:
The session to connect to.
vault
UnionType[NotteVault, None]
A notte vault instance, if the agent requires authentication (default: None)
notifier
UnionType[BaseNotifier, None]
A notifier (for example, email), which will get called upon task completion. (default: None)
reasoning_model
notte_core.common.config.LlmModel | str
The language model to use for agent reasoning.
Whether to enable vision capabilities for the agent.
Maximum number of steps the agent can take.
Optional ID of the vault to use.
notifier_config
dict[str, typing.Any] | None
Config used for the notifier.
Responses are generated using AI and may contain mistakes.