import { BaseExtension, ExtensionTypeEnum } from '../extension' import { Model, ModelInterface, ModelSource, OptionType } from '../../types' /** * Model extension for managing models. */ export abstract class ModelExtension extends BaseExtension implements ModelInterface { /** * Model extension type. */ type(): ExtensionTypeEnum | undefined { return ExtensionTypeEnum.Model } abstract configurePullOptions(configs: { [key: string]: any }): Promise abstract getModels(): Promise abstract pullModel(model: string, id?: string, name?: string): Promise abstract cancelModelPull(modelId: string): Promise abstract importModel( model: string, modePath: string, name?: string, optionType?: OptionType ): Promise abstract updateModel(modelInfo: Partial): Promise abstract deleteModel(model: string): Promise abstract isModelLoaded(model: string): Promise /** * Get model sources */ abstract getSources(): Promise /** * Add a model source */ abstract addSource(source: string): Promise /** * Delete a model source */ abstract deleteSource(source: string): Promise /** * Fetch models hub */ abstract fetchModelsHub(): Promise }