UNPKG

adk-typescript

Version:

TypeScript port of Google's Agent Development Kit (ADK)

63 lines (62 loc) 2 kB
/** * An in-memory implementation of the artifact service. */ import { Part } from '../models/types'; import { ArtifactParams, BaseArtifactService } from './BaseArtifactService'; /** * An in-memory implementation of the artifact service. */ export declare class InMemoryArtifactService implements BaseArtifactService { private artifacts; /** * Checks if the filename has a user namespace. * * @param filename The filename to check * @returns True if the filename has a user namespace (starts with "user:"), false otherwise */ private fileHasUserNamespace; /** * Constructs the artifact path. * * @param appName The name of the application * @param userId The ID of the user * @param sessionId The ID of the session * @param filename The name of the artifact file * @returns The constructed artifact path */ private artifactPath; /** * Saves an artifact to the artifact service storage. * * @param params The artifact parameters * @returns The revision ID */ saveArtifact(params: ArtifactParams): number; /** * Gets an artifact from the artifact service storage. * * @param params The artifact parameters * @returns The artifact or undefined if not found */ loadArtifact(params: ArtifactParams): Part | undefined; /** * Lists all the artifact filenames within a session. * * @param params The artifact parameters * @returns A list of all artifact filenames within a session */ listArtifactKeys(params: ArtifactParams): string[]; /** * Deletes an artifact. * * @param params The artifact parameters */ deleteArtifact(params: ArtifactParams): Promise<void>; /** * Lists all versions of an artifact. * * @param params The artifact parameters * @returns A list of all available versions of the artifact */ listVersions(params: ArtifactParams): number[]; }