adk-typescript
Version:
TypeScript port of Google's Agent Development Kit (ADK)
70 lines (69 loc) • 2.36 kB
TypeScript
import { Part } from '../models/types';
import { ArtifactParams, BaseArtifactService } from './BaseArtifactService';
/**
* An artifact service implementation using Google Cloud Storage (GCS).
*/
export declare class GcsArtifactService implements BaseArtifactService {
private bucket;
private storage;
private bucketName;
/**
* Initializes the GcsArtifactService.
*
* @param bucketName The name of the bucket to use
* @param options Optional configuration options for the Google Cloud Storage client
*/
constructor(bucketName: string, options?: Record<string, any>);
/**
* 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 blob name in GCS.
*
* @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
* @param version The version of the artifact
* @returns The constructed blob name in GCS
*/
private getBlobName;
/**
* Saves an artifact to the artifact service storage.
*
* @param params The artifact parameters
* @returns The revision ID
*/
saveArtifact(params: ArtifactParams): Promise<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): Promise<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): Promise<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): Promise<number[]>;
}