Skip to content

API Reference parrot.tools.session_files

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.tools.session_files

View source

Agent-facing view of the per-session file store.

Alias AbstractToolkit

Re-exported from parrot.tools.toolkit.AbstractToolkit.

Attribute DEFAULT_MAX_FILE_BYTES

Class FileTooLarge

The file exceeds the toolkit's per-file byte cap.

Attribute LOCAL_BACKENDS

Class NoBoundSession

No RequestContext is bound to this asyncio task.

Attribute REMOTE_BACKENDS

Attribute SUPPORTED_BACKENDS

Alias SessionFileError

Re-exported from parrot.interfaces.file.session.SessionFileError.

Alias SessionFileStore

Re-exported from parrot.interfaces.file.session.SessionFileStore.

Class SessionFileToolkit

Lists and stages the files of the CURRENT session, addressed by handle.

Parameter Type Default Description
store Optional[SessionFileStore] None Session file store; defaults to the OUTPUT_DIR-rooted store.
local_import_root Optional[Path | str] None Directory the "fs" backend is confined to. When None (the default) "fs" is refused outright, so no agent can read the server's working directory.
max_file_bytes int DEFAULT_MAX_FILE_BYTES Largest single file this toolkit will store, in bytes.

Attributes:

Attribute Type Description
tool_prefix str
local_import_root Optional[Path]

Method SessionFileToolkit.list_session_files

List the files available in this session.

Returns {"files": [{"file_id", "filename", "mime_type", "size", "origin"}]}. Pass a file_id to jira_add_attachment or jira_add_comment to attach it.

list_session_files() -> Dict[str, Any]

Returns: Dict[str, Any]

Method SessionFileToolkit.store_generated_file

Store text this agent produced as a session file, returning its handle.

Returns {"file_id", "filename", "size"}. The file_id can then be passed to jira_add_attachment to attach the file to an issue.

store_generated_file(filename: str, content: str) -> Dict[str, Any]

Parameter Type Default Description
filename str Name for the file, e.g. "report.md".
content str Text content, stored as UTF-8.

Returns: Dict[str, Any]

Method SessionFileToolkit.import_remote_file

Import a file from remote storage into this session, returning its handle.

backend is one of "s3", "gcs", "sharepoint", "onedrive", "gdrive". remote_path is a relative path inside that backend — absolute paths and ".." segments are refused. Returns {"file_id", "filename", "size"}. Use the file_id to attach the file.

import_remote_file(backend: str, remote_path: str, filename: Optional[str] = None) -> Dict[str, Any]

Parameter Type Default Description
backend str
remote_path str
filename Optional[str] None

Returns: Dict[str, Any]

Alias current_context

Re-exported from parrot.utils.helpers.current_context.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally