ADK for TypeScript: API Reference
    Preparing search index...

    Class FileArtifactService

    Service for managing artifacts stored on the local filesystem.

    Stores filesystem-backed artifacts beneath a configurable root directory.

    Storage layout matches the cloud and in-memory services: root/ └── users/ └── {userId}/ β”œβ”€β”€ sessions/ β”‚ └── {sessionId}/ β”‚ └── artifacts/ β”‚ └── {artifactPath}/ // derived from filename β”‚ └── versions/ β”‚ └── {version}/ β”‚ β”œβ”€β”€ {originalFilename} β”‚ └── metadata.json └── artifacts/ └── {artifactPath}/...

    Artifact paths are derived from the provided filenames: separators create nested directories, and path traversal is rejected to keep the layout portable across filesystems. {artifactPath} therefore mirrors the sanitized, scope-relative path derived from each filename.

    Implements

    • Saves an artifact to the artifact service storage.

      The artifact is a file identified by the app name, user ID, session ID, and filename. After saving the artifact, a revision ID is returned to identify the artifact version.

      Parameters

      Returns Promise<number>

      A promise that resolves to The revision ID. The first version of the artifact has a revision ID of 0. This is incremented by 1 after each successful save.