-
Notifications
You must be signed in to change notification settings - Fork 178
Feat: Replay saving functionality added and readme polished. #618
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
Open
Sameersribot
wants to merge
3
commits into
nottelabs:main
Choose a base branch
from
Sameersribot:test
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| from __future__ import annotations | ||
| import sys | ||
| from pathlib import Path | ||
|
|
||
| from dotenv import load_dotenv | ||
|
|
||
| #There was a clash with the local session.py file and the virtual env file | ||
|
|
||
| def _bootstrap_local_packages() -> None: | ||
| """Ensure we import local Notte packages instead of the virtualenv wheels.""" | ||
|
|
||
| current = Path(__file__).resolve().parent | ||
| repo_root = current | ||
| for candidate in [current, *current.parents]: | ||
| if (candidate / "packages").is_dir() and (candidate / "pyproject.toml").is_file(): | ||
| repo_root = candidate | ||
| break | ||
|
|
||
| packages_root = repo_root / "packages" | ||
| candidate_paths = [ | ||
| repo_root / "src", | ||
| packages_root / "notte-core" / "src", | ||
| packages_root / "notte-browser" / "src", | ||
| packages_root / "notte-agent" / "src", | ||
| packages_root / "notte-llm" / "src", | ||
| packages_root / "notte-sdk" / "src", | ||
| ] | ||
|
|
||
| for path in candidate_paths: | ||
| if path.exists(): | ||
| path_str = str(path) | ||
| if path_str not in sys.path: | ||
| sys.path.insert(0, path_str) | ||
|
|
||
| # Drop any previously imported notte modules so the interpreter reloads from the local paths | ||
| for name in list(sys.modules.keys()): | ||
| if name.startswith(("notte_browser", "notte_core", "notte_agent", "notte_llm", "notte_sdk", "notte")): | ||
| sys.modules.pop(name, None) | ||
|
|
||
|
|
||
| _bootstrap_local_packages() | ||
|
|
||
| import notte | ||
|
|
||
|
|
||
| def main() -> None: | ||
| load_dotenv() | ||
| #Use save_replay_to in Session method to save the screenshots WebP file at the specified location. | ||
| with notte.Session(headless=False, save_replay_to=r".\replays\rp.webp") as session: | ||
| agent = notte.Agent(session=session, reasoning_model="gemini/gemini-2.5-flash", max_steps=30) | ||
| response = agent.run(task="go to google and search for plujss and select the second dropdown suggestion") | ||
|
|
||
| if __name__ == "__main__": | ||
| main() | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unused variable assignment.
The
responsevariable is assigned but never used. Either utilize it or remove the assignment to clean up the code.Apply this diff to remove the unused assignment:
🧰 Tools
🪛 Ruff (0.14.3)
51-51: Local variable
responseis assigned to but never usedRemove assignment to unused variable
response(F841)
🤖 Prompt for AI Agents