diff --git a/src/brainy.ts b/src/brainy.ts index d7b6783f..22729abc 100644 --- a/src/brainy.ts +++ b/src/brainy.ts @@ -1736,7 +1736,7 @@ export class Brainy implements BrainyInterface { */ private async setupStorage(): Promise { const storage = await createStorage({ - type: this.config.storage?.type || 'memory', + type: this.config.storage?.type || 'auto', ...this.config.storage?.options }) return storage @@ -1790,8 +1790,8 @@ export class Brainy implements BrainyInterface { */ private normalizeConfig(config?: BrainyConfig): Required { // Validate storage configuration - if (config?.storage?.type && !['memory', 'filesystem', 'opfs', 'remote'].includes(config.storage.type)) { - throw new Error(`Invalid storage type: ${config.storage.type}. Must be one of: memory, filesystem, opfs, remote`) + if (config?.storage?.type && !['auto', 'memory', 'filesystem', 'opfs', 'remote', 's3', 'r2', 'gcs'].includes(config.storage.type)) { + throw new Error(`Invalid storage type: ${config.storage.type}. Must be one of: auto, memory, filesystem, opfs, remote, s3, r2, gcs`) } // Validate model configuration @@ -1813,7 +1813,7 @@ export class Brainy implements BrainyInterface { } return { - storage: config?.storage || { type: 'memory' }, + storage: config?.storage || { type: 'auto' }, model: config?.model || { type: 'fast' }, index: config?.index || {}, cache: config?.cache ?? true, diff --git a/src/types/brainy.types.ts b/src/types/brainy.types.ts index 1201263c..e23efb10 100644 --- a/src/types/brainy.types.ts +++ b/src/types/brainy.types.ts @@ -311,7 +311,7 @@ export type AggregateMetric = export interface BrainyConfig { // Storage configuration storage?: { - type: 'memory' | 'filesystem' | 's3' | 'r2' | 'opfs' + type: 'auto' | 'memory' | 'filesystem' | 's3' | 'r2' | 'opfs' | 'gcs' options?: any }