-
Notifications
You must be signed in to change notification settings - Fork 184
[NOT-860] feat(sdk): scope file storage to sessions #903
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
leo-notte
wants to merge
6
commits into
main
Choose a base branch
from
feat/session-scoped-files
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
6 commits
Select commit
Hold shift + click to select a range
cf14965
feat(sdk): scope file storage to sessions
leo-notte 8e69e13
fix(browser): avoid duplicate captured downloads
leo-notte bcfa545
Address session file review feedback
leo-notte 83b811f
Fix session docs parameter synchronization
leo-notte 1210e66
Harden temporary session file downloads
leo-notte 389ffa6
Fix session file SDK CI regressions
leo-notte 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,18 @@ | ||
| --- | ||
| title: "FileSource" | ||
| description: "Enum where members are also (and must be) strings" | ||
| --- | ||
|
|
||
|
|
||
|
|
||
| ## Methods | ||
|
|
||
|
|
||
| ## Inheritance | ||
|
|
||
| Inherits from: StrEnum | ||
|
|
||
|
|
||
| ## Module | ||
|
|
||
| `notte_sdk.types` |
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,26 @@ | ||
| --- | ||
| title: "ListFilesResponse" | ||
| description: "" | ||
| --- | ||
|
|
||
|
|
||
|
|
||
| ## Fields | ||
|
|
||
| <ParamField path="files" type="list[SessionFile]" required> | ||
| List of non-expired session files | ||
| </ParamField> | ||
|
|
||
| <ParamField path="total" type="int" required> | ||
| </ParamField> | ||
|
|
||
| <ParamField path="limit" type="int" required> | ||
| </ParamField> | ||
|
|
||
| <ParamField path="offset" type="int" required> | ||
| </ParamField> | ||
|
|
||
|
|
||
| ## Module | ||
|
|
||
| `notte_sdk.types` |
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,40 @@ | ||
| --- | ||
| title: "SessionFile" | ||
| description: "" | ||
| --- | ||
|
|
||
|
|
||
|
|
||
| ## Fields | ||
|
|
||
| <ParamField path="id" type="str" required> | ||
| </ParamField> | ||
|
|
||
| <ParamField path="session_id" type="str" required> | ||
| </ParamField> | ||
|
|
||
| <ParamField path="filename" type="str" required> | ||
| </ParamField> | ||
|
|
||
| <ParamField path="mime_type" type="str" required> | ||
| </ParamField> | ||
|
|
||
| <ParamField path="size" type="int" required> | ||
| </ParamField> | ||
|
|
||
| <ParamField path="checksum" type="str" required> | ||
| </ParamField> | ||
|
|
||
| <ParamField path="created_at" type="datetime" required> | ||
| </ParamField> | ||
|
|
||
| <ParamField path="expires_at" type="datetime" required> | ||
| </ParamField> | ||
|
|
||
| <ParamField path="source" type="FileSource" required> | ||
| </ParamField> | ||
|
|
||
|
|
||
| ## Module | ||
|
|
||
| `notte_sdk.types` |
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,26 @@ | ||
| --- | ||
| title: "SessionFilesPage" | ||
| description: "" | ||
| --- | ||
|
|
||
|
|
||
|
|
||
| ## Fields | ||
|
|
||
| <ParamField path="files" type="list[SessionFile]" required> | ||
| List of non-expired session files | ||
| </ParamField> | ||
|
|
||
| <ParamField path="total" type="int" required> | ||
| </ParamField> | ||
|
|
||
| <ParamField path="limit" type="int" required> | ||
| </ParamField> | ||
|
|
||
| <ParamField path="offset" type="int" required> | ||
| </ParamField> | ||
|
|
||
|
|
||
| ## Module | ||
|
|
||
| `notte_sdk.types` |
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
8 changes: 1 addition & 7 deletions
8
docs/src/sdk-reference/remotefilestorage/alist_downloaded_files.mdx
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
8 changes: 1 addition & 7 deletions
8
docs/src/sdk-reference/remotefilestorage/alist_uploaded_files.mdx
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,16 @@ | ||
| --- | ||
| title: "delete" | ||
| description: "No description available" | ||
| --- | ||
|
|
||
|
|
||
|
|
||
|
|
||
| ## Parameters | ||
|
|
||
| <ParamField path="file_id" type="str" required> | ||
| </ParamField> | ||
|
|
||
| ## Returns | ||
|
|
||
| `None` |
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 |
|---|---|---|
| @@ -1,30 +1,22 @@ | ||
| --- | ||
| title: "download" | ||
| description: "Stores a file that has been downloaded from a website in the current session" | ||
| description: "No description available" | ||
| --- | ||
| import AgentMdNotice from '/partials/agent-md-notice.mdx'; | ||
|
|
||
| <AgentMdNotice /> | ||
|
|
||
| ```python | ||
| file_storage = notte.FileStorage("<session_id>") | ||
| # file.pdf has been downloaded by an agent in the session | ||
| # you can download it to your local machine using: | ||
| file_storage.download(file_name="file.pdf", local_dir="<local_download_dir>") | ||
| ``` | ||
|
|
||
|
|
||
| ## Parameters | ||
|
|
||
| <ParamField path="file_name" type="str" required> | ||
| <ParamField path="file_id" type="str" required> | ||
| </ParamField> | ||
|
|
||
| <ParamField path="local_dir" type="str" required> | ||
| <ParamField path="local_dir" type="str" default="."> | ||
| </ParamField> | ||
|
|
||
| <ParamField path="force" type="bool" default="False"> | ||
| </ParamField> | ||
|
|
||
| ## Returns | ||
|
|
||
| `bool` | ||
| `str` |
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,16 @@ | ||
| --- | ||
| title: "for_session" | ||
| description: "Bind this storage once, cloning it when another session already owns it" | ||
| --- | ||
|
|
||
|
|
||
|
|
||
|
|
||
| ## Parameters | ||
|
|
||
| <ParamField path="session_id" type="str" required> | ||
| </ParamField> | ||
|
|
||
| ## Returns | ||
|
|
||
| <Visibility for="humans">[`RemoteFileStorage`](/sdk-reference/misc/remotefilestorage)</Visibility><Visibility for="agents">[`RemoteFileStorage`](/sdk-reference/misc/remotefilestorage.md)</Visibility> |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.