@squidcloud/client
Version:
A typescript implementation of the Squid client
34 lines (33 loc) • 1.15 kB
TypeScript
/**
* Options for uploading a file to an AI provider.
* @category AI
*/
export interface UploadAiFileOptions {
/** The file to upload. */
file: File;
/** Optional expiration time in seconds for automatic cleanup. */
expirationInSeconds?: number;
}
/**
* AiFilesClient provides methods for managing files with a specific AI provider.
* The provider is bound when the client is created via `squid.ai().files(provider)`.
* @category AI
*/
export declare class AiFilesClient {
private readonly provider;
private readonly rpcManager;
/**
* Uploads a file to the AI provider for use with AI features like code interpreter.
*
* @param options - Options for uploading the file.
* @returns A Promise that resolves to the file ID assigned by the provider.
*/
uploadFile(options: UploadAiFileOptions): Promise<string>;
/**
* Deletes a file from the AI provider's storage.
*
* @param fileId - The ID of the file to delete.
* @returns A Promise that resolves to true if the file was deleted, false if it didn't exist.
*/
deleteFile(fileId: string): Promise<boolean>;
}