Skip to content

API Reference parrot.integrations.knowledge_upload.service

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

parrot.integrations.knowledge_upload.service

View source

Platform-agnostic knowledge upload service (FEAT-647).

Alias EmployeeProfile

Re-exported from parrot.auth.userinfo.EmployeeProfile.

Alias IngestTarget

Re-exported from parrot.integrations.knowledge_upload.targets.base.IngestTarget.

Alias KnowledgeUploadConfig

Re-exported from parrot.integrations.knowledge_upload.models.KnowledgeUploadConfig.

Class KnowledgeUploadService

Authorize, validate, stage, ingest, delete, audit and notify.

Parameter Type Default Description
config KnowledgeUploadConfig
targets dict[UploadTargetKind, IngestTarget]
userinfo UserInfoService | None None

Method KnowledgeUploadService.from_config

Build targets, retaining only available ones after sweeping their staging paths.

from_config(config: KnowledgeUploadConfig) -> KnowledgeUploadService

Parameter Type Default Description
config KnowledgeUploadConfig

Returns: KnowledgeUploadService

Method KnowledgeUploadService.available_targets

Return targets that passed the startup availability check.

available_targets() -> set[UploadTargetKind]

Returns: set[UploadTargetKind]

Method KnowledgeUploadService.max_bytes

Return the applicable maximum upload size in bytes.

max_bytes(platform_cap_mb: int | None = None) -> int

Parameter Type Default Description
platform_cap_mb int | None None

Returns: int

Method KnowledgeUploadService.authorize

Return an allowed profile, or None after auditing a denial.

authorize(identity: UploaderIdentity) -> EmployeeProfile | None

Parameter Type Default Description
identity UploaderIdentity

Returns: EmployeeProfile | None

Method KnowledgeUploadService.pre_authorize

Reject an upload before any bytes are fetched.

Adapters call this before downloading so unauthorized users cannot make the bot fetch and buffer files. submit() repeats every check on the real bytes.

pre_authorize(identity: UploaderIdentity, target: UploadTargetKind, filename: str, declared_size: int | None = None) -> UploadOutcome | None

Parameter Type Default Description
identity UploaderIdentity Who is uploading, as seen by the platform adapter.
target UploadTargetKind Requested ingest target.
filename str Platform-reported filename.
declared_size int | None None Platform-reported size in bytes, when known.

Returns: UploadOutcome | None — The audited rejection outcome, or None when the download may proceed.

Method KnowledgeUploadService.submit

Validate and schedule a job, or return an immediate rejected outcome.

submit(request: UploadRequest, notify: Notify) -> UploadOutcome

Parameter Type Default Description
request UploadRequest
notify Notify

Returns: UploadOutcome

Method KnowledgeUploadService.shutdown

Cancel running jobs and await them.

shutdown() -> None

Attribute Notify

Alias UploadOutcome

Re-exported from parrot.integrations.knowledge_upload.models.UploadOutcome.

Alias UploadPolicy

Re-exported from parrot.integrations.knowledge_upload.policy.UploadPolicy.

Alias UploadRequest

Re-exported from parrot.integrations.knowledge_upload.models.UploadRequest.

Alias UploadStatus

Re-exported from parrot.integrations.knowledge_upload.models.UploadStatus.

Alias UploadTargetKind

Re-exported from parrot.integrations.knowledge_upload.models.UploadTargetKind.

Alias UploaderIdentity

Re-exported from parrot.integrations.knowledge_upload.models.UploaderIdentity.

Alias UserInfoService

Re-exported from parrot.auth.userinfo.UserInfoService.

Attribute audit_logger

Alias resolve_profile

Re-exported from parrot.integrations.knowledge_upload.policy.resolve_profile.

Alias safe_filename

Re-exported from parrot.integrations.knowledge_upload.staging.safe_filename.

Alias staged_file

Re-exported from parrot.integrations.knowledge_upload.staging.staged_file.

Alias sweep_staging

Re-exported from parrot.integrations.knowledge_upload.staging.sweep_staging.

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