feat: refactor model API structure to support specific model types with dedicated API clients for Checkpoints, LoRAs, and Embeddings

refactor: consolidate model API client creation into a factory function for better maintainability
feat: implement move operations for LoRAs and handle unsupported operations for Checkpoints and Embeddings
This commit is contained in:
Will Miao
2025-08-04 19:37:53 +08:00
parent 65ec6aacb7
commit 342a722991
29 changed files with 341 additions and 213 deletions

View File

@@ -0,0 +1,30 @@
import { BaseModelApiClient } from './baseModelApi.js';
import { showToast } from '../utils/uiHelpers.js';
/**
* Embedding-specific API client
*/
export class EmbeddingApiClient extends BaseModelApiClient {
/**
* Move a single embedding to target path
*/
async moveSingleModel(filePath, targetPath) {
if (filePath.substring(0, filePath.lastIndexOf('/')) === targetPath) {
showToast('Embedding is already in the selected folder', 'info');
return null;
}
// TODO: Implement embedding move endpoint when available
showToast('Moving embeddings is not yet implemented', 'info');
return null;
}
/**
* Move multiple embeddings to target path
*/
async moveBulkModels(filePaths, targetPath) {
// TODO: Implement embedding bulk move endpoint when available
showToast('Moving embeddings is not yet implemented', 'info');
return [];
}
}