import { BlobStore, BlobStoreOptions, MediaBlob } from "./utils/media_core.cjs"; import { GoogleConnectionParams, GoogleRawResponse, GoogleResponse } from "../types.cjs"; import { GoogleAbstractedClient, GoogleAbstractedClientOpsMethod } from "../auth.cjs"; import { GoogleHostConnection, GoogleRawConnection } from "../connection.cjs"; import { AsyncCaller, AsyncCallerCallOptions, AsyncCallerParams } from "@langchain/core/utils/async_caller"; //#region src/experimental/media.d.ts interface GoogleUploadConnectionParams extends GoogleConnectionParams {} declare abstract class GoogleMultipartUploadConnection extends GoogleHostConnection { constructor(fields: GoogleConnectionParams | undefined, caller: AsyncCaller, client: GoogleAbstractedClient); _body(separator: string, data: MediaBlob, metadata: Record): Promise; request(data: MediaBlob, metadata: Record, options: CallOptions): Promise; } declare abstract class GoogleDownloadConnection extends GoogleHostConnection { request(options: CallOptions): Promise; } declare abstract class GoogleDownloadRawConnection extends GoogleRawConnection { buildMethod(): GoogleAbstractedClientOpsMethod; request(options: CallOptions): Promise; } interface BlobStoreGoogleParams extends GoogleConnectionParams, AsyncCallerParams, BlobStoreOptions {} declare abstract class BlobStoreGoogle extends BlobStore { caller: AsyncCaller; client: GoogleAbstractedClient; constructor(fields?: BlobStoreGoogleParams); abstract buildClient(fields?: BlobStoreGoogleParams): GoogleAbstractedClient; abstract buildSetMetadata([key, blob]: [string, MediaBlob]): Record; abstract buildSetConnection([key, blob]: [string, MediaBlob]): GoogleMultipartUploadConnection; _set(keyValuePair: [string, MediaBlob]): Promise; mset(keyValuePairs: [string, MediaBlob][]): Promise; abstract buildGetMetadataConnection(key: string): GoogleDownloadConnection; _getMetadata(key: string): Promise>; abstract buildGetDataConnection(key: string): GoogleDownloadRawConnection; _getData(key: string): Promise; _getMimetypeFromMetadata(metadata: Record): string; _get(key: string): Promise; mget(keys: string[]): Promise<(MediaBlob | undefined)[]>; abstract buildDeleteConnection(key: string): GoogleDownloadConnection; _del(key: string): Promise; mdelete(keys: string[]): Promise; yieldKeys(_prefix: string | undefined): AsyncGenerator; } /** * Based on https://cloud.google.com/storage/docs/json_api/v1/objects#resource */ interface GoogleCloudStorageObject extends Record { id?: string; name?: string; contentType?: string; metadata?: Record; } interface GoogleCloudStorageResponse extends GoogleResponse { data: GoogleCloudStorageObject; } type BucketAndPath = { bucket: string; path: string; }; declare class GoogleCloudStorageUri { static uriRegexp: RegExp; bucket: string; path: string; constructor(uri: string); get uri(): string; get isValid(): boolean; static uriToBucketAndPath(uri: string): BucketAndPath; static isValidUri(uri: string): boolean; } interface GoogleCloudStorageConnectionParams { uri: string; } interface GoogleCloudStorageUploadConnectionParams extends GoogleUploadConnectionParams, GoogleCloudStorageConnectionParams {} declare class GoogleCloudStorageUploadConnection extends GoogleMultipartUploadConnection { uri: GoogleCloudStorageUri; constructor(fields: GoogleCloudStorageUploadConnectionParams, caller: AsyncCaller, client: GoogleAbstractedClient); buildUrl(): Promise; } interface GoogleCloudStorageDownloadConnectionParams extends GoogleCloudStorageConnectionParams, GoogleConnectionParams { method: GoogleAbstractedClientOpsMethod; alt: "media" | undefined; } declare class GoogleCloudStorageDownloadConnection extends GoogleDownloadConnection { uri: GoogleCloudStorageUri; method: GoogleAbstractedClientOpsMethod; alt: "media" | undefined; constructor(fields: GoogleCloudStorageDownloadConnectionParams, caller: AsyncCaller, client: GoogleAbstractedClient); buildMethod(): GoogleAbstractedClientOpsMethod; buildUrl(): Promise; } interface GoogleCloudStorageRawConnectionParams extends GoogleCloudStorageConnectionParams, GoogleConnectionParams {} declare class GoogleCloudStorageRawConnection extends GoogleDownloadRawConnection { uri: GoogleCloudStorageUri; constructor(fields: GoogleCloudStorageRawConnectionParams, caller: AsyncCaller, client: GoogleAbstractedClient); buildUrl(): Promise; } interface BlobStoreGoogleCloudStorageBaseParams extends BlobStoreGoogleParams { uriPrefix: GoogleCloudStorageUri; } declare abstract class BlobStoreGoogleCloudStorageBase extends BlobStoreGoogle { params: BlobStoreGoogleCloudStorageBaseParams; constructor(fields: BlobStoreGoogleCloudStorageBaseParams); buildSetConnection([key, _blob]: [string, MediaBlob]): GoogleMultipartUploadConnection; buildSetMetadata([key, blob]: [string, MediaBlob]): Record; buildGetMetadataConnection(key: string): GoogleDownloadConnection; buildGetDataConnection(key: string): GoogleDownloadRawConnection; buildDeleteConnection(key: string): GoogleDownloadConnection; } type AIStudioFileState = "PROCESSING" | "ACTIVE" | "FAILED" | "STATE_UNSPECIFIED"; type AIStudioFileVideoMetadata = { videoMetadata: { videoDuration: string; }; }; type AIStudioFileMetadata = AIStudioFileVideoMetadata; interface AIStudioFileObject { name?: string; displayName?: string; mimeType?: string; sizeBytes?: string; createTime?: string; updateTime?: string; expirationTime?: string; sha256Hash?: string; uri?: string; state?: AIStudioFileState; error?: { code: number; message: string; details: Record[]; }; metadata?: AIStudioFileMetadata; } declare class AIStudioMediaBlob extends MediaBlob { _valueAsDate(value: string): Date; _metadataFieldAsDate(field: string): Date; get createDate(): Date; get updateDate(): Date; get expirationDate(): Date; get isExpired(): boolean; } interface AIStudioFileGetResponse extends GoogleResponse { data: AIStudioFileObject; } interface AIStudioFileSaveResponse extends GoogleResponse { data: { file: AIStudioFileObject; }; } interface AIStudioFileListResponse extends GoogleResponse { data: { files: AIStudioFileObject[]; nextPageToken: string; }; } type AIStudioFileResponse = AIStudioFileGetResponse | AIStudioFileSaveResponse | AIStudioFileListResponse; interface AIStudioFileConnectionParams {} interface AIStudioFileUploadConnectionParams extends GoogleUploadConnectionParams, AIStudioFileConnectionParams {} declare class AIStudioFileUploadConnection extends GoogleMultipartUploadConnection { get computedApiVersion(): string; buildUrl(): Promise; } interface AIStudioFileDownloadConnectionParams extends AIStudioFileConnectionParams, GoogleConnectionParams { method: GoogleAbstractedClientOpsMethod; name: string; } declare class AIStudioFileDownloadConnection extends GoogleDownloadConnection { method: GoogleAbstractedClientOpsMethod; name: string; constructor(fields: AIStudioFileDownloadConnectionParams, caller: AsyncCaller, client: GoogleAbstractedClient); get computedApiVersion(): string; buildMethod(): GoogleAbstractedClientOpsMethod; buildUrl(): Promise; } interface BlobStoreAIStudioFileBaseParams extends BlobStoreGoogleParams { retryTime?: number; } declare abstract class BlobStoreAIStudioFileBase extends BlobStoreGoogle { params?: BlobStoreAIStudioFileBaseParams; retryTime: number; constructor(fields?: BlobStoreAIStudioFileBaseParams); _pathToName(path: string): string; abstract buildAbstractedClient(fields?: BlobStoreGoogleParams): GoogleAbstractedClient; buildApiKeyClient(apiKey: string): GoogleAbstractedClient; buildApiKey(fields?: BlobStoreGoogleParams): string | undefined; buildClient(fields?: BlobStoreGoogleParams): GoogleAbstractedClient; _regetMetadata(key: string): Promise; _set([key, blob]: [string, MediaBlob]): Promise; buildSetConnection([_key, _blob]: [string, MediaBlob]): GoogleMultipartUploadConnection; buildSetMetadata([_key, _blob]: [string, MediaBlob]): Record; buildGetMetadataConnection(key: string): GoogleDownloadConnection; buildGetDataConnection(_key: string): GoogleDownloadRawConnection; _get(key: string): Promise; buildDeleteConnection(key: string): GoogleDownloadConnection; } //#endregion export { AIStudioFileConnectionParams, AIStudioFileDownloadConnection, AIStudioFileDownloadConnectionParams, AIStudioFileGetResponse, AIStudioFileListResponse, AIStudioFileMetadata, AIStudioFileObject, AIStudioFileResponse, AIStudioFileSaveResponse, AIStudioFileState, AIStudioFileUploadConnection, AIStudioFileUploadConnectionParams, AIStudioFileVideoMetadata, AIStudioMediaBlob, BlobStoreAIStudioFileBase, BlobStoreAIStudioFileBaseParams, BlobStoreGoogle, BlobStoreGoogleCloudStorageBase, BlobStoreGoogleCloudStorageBaseParams, BlobStoreGoogleParams, BucketAndPath, GoogleCloudStorageConnectionParams, GoogleCloudStorageDownloadConnection, GoogleCloudStorageDownloadConnectionParams, GoogleCloudStorageObject, GoogleCloudStorageRawConnection, GoogleCloudStorageRawConnectionParams, GoogleCloudStorageResponse, GoogleCloudStorageUploadConnection, GoogleCloudStorageUploadConnectionParams, GoogleCloudStorageUri, GoogleDownloadConnection, GoogleDownloadRawConnection, GoogleMultipartUploadConnection, GoogleUploadConnectionParams }; //# sourceMappingURL=media.d.cts.map