GeezerVison is showing adk.dev — FileArtifactService | ADK for TypeScript: API Reference - v2.5.0
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.
Constructors
constructor
-
new FileArtifactService(rootDirOrUri: string): FileArtifactService
Returns FileArtifactService
Methods
deleteArtifact
-
Returns Promise<void>
A promise that resolves when the artifact is deleted.
getArtifactVersion
-
Gets metadata for a specific artifact version.
A promise that resolves to the artifact version metadata or undefined.
listArtifactKeys
-
Lists all the artifact filenames within a session.
Returns Promise<string[]>
A promise that resolves to a list of all artifact filenames within
a session.
listArtifactVersions
-
Lists metadata for each artifact version.
A promise that resolves to a list of artifact version metadata.
listVersions
-
Lists all versions of an artifact.
Returns Promise<number[]>
A promise that resolves to a list of all available versions of the
artifact.
loadArtifact
-
Gets an artifact from the artifact service storage.
The artifact is a file identified by the app name, user ID, session ID, and
filename.
Returns Promise<Part | undefined>
A promise that resolves to the artifact or undefined if not found.
saveArtifact
-
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.
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.