notte-agent 0.0.dev0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
notte_agent/main.py ADDED
@@ -0,0 +1,77 @@
1
+ import asyncio
2
+ from collections.abc import Callable
3
+
4
+ from notte_browser.window import BrowserWindow
5
+ from notte_core.credentials.base import BaseVault
6
+ from notte_core.llms.engine import LlmModel
7
+ from notte_sdk.types import DEFAULT_MAX_NB_STEPS, AgentCreateRequest
8
+
9
+ from notte_agent.common.base import BaseAgent
10
+ from notte_agent.common.notifier import BaseNotifier, NotifierAgent
11
+ from notte_agent.common.types import AgentResponse
12
+ from notte_agent.falco.agent import FalcoAgent, FalcoAgentConfig
13
+ from notte_agent.falco.types import StepAgentOutput
14
+
15
+
16
+ class Agent:
17
+ def __init__(
18
+ self,
19
+ headless: bool = False,
20
+ reasoning_model: LlmModel = LlmModel.default(), # type: ignore[reportCallInDefaultInitializer]
21
+ max_steps: int = DEFAULT_MAX_NB_STEPS,
22
+ use_vision: bool = True,
23
+ # /!\ web security is disabled by default to increase agent performance
24
+ # turn it off if you need to input confidential information on trajectories
25
+ web_security: bool = False,
26
+ chrome_args: list[str] | None = None,
27
+ vault: BaseVault | None = None,
28
+ notifier: BaseNotifier | None = None,
29
+ window: BrowserWindow | None = None,
30
+ ):
31
+ # just validate the request to create type dependency
32
+ _ = AgentCreateRequest(
33
+ reasoning_model=reasoning_model,
34
+ use_vision=use_vision,
35
+ max_steps=max_steps,
36
+ persona_id=None,
37
+ vault_id=None,
38
+ )
39
+ self.config: FalcoAgentConfig = (
40
+ FalcoAgentConfig()
41
+ .use_vision(use_vision)
42
+ .model(reasoning_model, deep=True)
43
+ .map_session(
44
+ lambda session: (
45
+ session.agent_mode()
46
+ .steps(max_steps)
47
+ .headless(headless)
48
+ .web_security(web_security)
49
+ .set_chrome_args(chrome_args)
50
+ )
51
+ )
52
+ )
53
+ self.vault: BaseVault | None = vault
54
+ self.notifier: BaseNotifier | None = notifier
55
+ self.window: BrowserWindow | None = window
56
+
57
+ def create_agent(
58
+ self,
59
+ step_callback: Callable[[str, StepAgentOutput], None] | None = None,
60
+ ) -> BaseAgent:
61
+ agent = FalcoAgent(
62
+ config=self.config,
63
+ vault=self.vault,
64
+ window=self.window,
65
+ step_callback=step_callback,
66
+ )
67
+ if self.notifier:
68
+ agent = NotifierAgent(agent, notifier=self.notifier)
69
+ return agent
70
+
71
+ async def arun(self, task: str, url: str | None = None) -> AgentResponse:
72
+ agent = self.create_agent()
73
+ return await agent.run(task, url=url)
74
+
75
+ def run(self, task: str, url: str | None = None) -> AgentResponse:
76
+ agent = self.create_agent()
77
+ return asyncio.run(agent.run(task, url=url))
notte_agent/py.typed ADDED
File without changes
@@ -0,0 +1,8 @@
1
+ Metadata-Version: 2.4
2
+ Name: notte-agent
3
+ Version: 0.0.dev0
4
+ Summary: Notte Web AI Agents
5
+ Author-email: Notte Team <hello@notte.cc>
6
+ Requires-Python: >=3.11
7
+ Requires-Dist: notte-browser==0.0.dev
8
+ Requires-Dist: notte-core==0.0.dev
@@ -0,0 +1,34 @@
1
+ notte_agent/README.md,sha256=qFOkfS1l8n2Jkxk-1KyrrHk4Xiz-Hj7qlJHEAmnJ0Ic,2231
2
+ notte_agent/__init__.py,sha256=LfPglyBqY8BxOzM5GlSWRMnQsTsfFoKqQaGuW6mXvgA,150
3
+ notte_agent/main.py,sha256=zReSxGNHl7L9_qQA0YvpDoc-U7Fv0gt88F6_FAzUafA,2832
4
+ notte_agent/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ notte_agent/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ notte_agent/common/base.py,sha256=AJ07GLlM01iMZne-rp4SNm4NMEEireHHUsMdvODcinE,363
7
+ notte_agent/common/captcha_detector.py,sha256=IKtcFsmVlXIogZRzVSEHn0VAjv-mFb35RKqVgr3tpok,2629
8
+ notte_agent/common/config.py,sha256=z7Lt26BkqIC2WljmT1MtBQGo6orIVPQxFxF-_7-yJuk,8780
9
+ notte_agent/common/conversation.py,sha256=lUs_uXT3JRgQSOcO1MbjcsQYc6ouqK5JQ4cCbVrD1hg,9511
10
+ notte_agent/common/notifier.py,sha256=SNkKWcaNQeG3pMblFZRMQWQrKdcXFyAvBEVrN2wBax4,1569
11
+ notte_agent/common/parser.py,sha256=fb5Det1QW65q7wMQLpNmDTjNIn_f781z8lZbxLlxXaA,2310
12
+ notte_agent/common/perception.py,sha256=65JIeDrJDp_rlOqM96P2q3xLPsSqMe2Pzlpa6OH0phA,474
13
+ notte_agent/common/prompt.py,sha256=-eDCNR51Cw2L4KGChkUDzg_AMoF08S4aqUDefHaBLVU,275
14
+ notte_agent/common/safe_executor.py,sha256=OBzf6PXAaQAm3sEL4eZSJjSNglh50RgUrFX7SBY2SNU,3504
15
+ notte_agent/common/trajectory_history.py,sha256=i2ivaJ2xtaM5Q-eUm-sX-yc73kedzENFmtfiiDxCRok,3818
16
+ notte_agent/common/types.py,sha256=_HKlF6tMPHQbealJRAzeEajGbIdsKOER2wdyvOJ55UQ,1389
17
+ notte_agent/common/validator.py,sha256=ZxecbIeIKAVVwroEk7QoyKx2lJCZGBxIxgC2j9GtK80,2739
18
+ notte_agent/falco/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
+ notte_agent/falco/agent.py,sha256=PE4rXzDyZibwew8s8sQmhmXY_OTgYAXoYRWqBhTgVjs,15852
20
+ notte_agent/falco/perception.py,sha256=td01ZbuwIoYQ8wJVDUzV41cmcsg8Y8PTjHnCf6ze00c,2671
21
+ notte_agent/falco/prompt.py,sha256=IFJOK5eRDAaYm03XcdU6yOuBGpmMsC4yEtTLKnGgdvE,4912
22
+ notte_agent/falco/trajectory_history.py,sha256=BURxgZeeFYnSvvLvBtZR8XmY2eXPcWt6b0N0SmX2Y_c,1453
23
+ notte_agent/falco/types.py,sha256=ffrU0vHBrp5AIg_z8q55mz6rUikzoIAaOH22dSVp1N4,5215
24
+ notte_agent/falco/prompts/system_prompt_multi_actions.md,sha256=Zc73x25eQOkFImKBjLsJKxbPzU6_7xgqjeYU5MrKTSQ,4716
25
+ notte_agent/falco/prompts/system_prompt_single_action.md,sha256=lRLCgWB4UNhDcLH94UM_M3pO11ga9Tl--yKilu85evE,4980
26
+ notte_agent/gufo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
+ notte_agent/gufo/agent.py,sha256=LkbL5wO6sOa1FTSHxm9jab3b5QNxNl5yEbPtNURYgZk,8020
28
+ notte_agent/gufo/parser.py,sha256=hhIJCwG7DUXpxZTnCAiwNA_nxG7JpDb322_KF7v-V1A,3054
29
+ notte_agent/gufo/perception.py,sha256=eaAr4Hp8Qz0DH762SH9sKgS1LyQy7pX58sX2Zh3WWb8,1492
30
+ notte_agent/gufo/prompt.py,sha256=ipyPbgRahrlyw7oQc7K6tMKJyDDM-VxyLlvR-FJrhEg,2274
31
+ notte_agent/gufo/system.md,sha256=gFoMRVTfir-_asj8w25up5HvGCWWLc0PPDqMpCmXVJk,427
32
+ notte_agent-0.0.dev0.dist-info/METADATA,sha256=osGZAi0Sq-yUprinFxBPOtw9O30nJ8Yf30vDkaEMEao,227
33
+ notte_agent-0.0.dev0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
34
+ notte_agent-0.0.dev0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.27.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any