Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions bindings/react-native/packages/core/src/Public/Api/Models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
getModel as getModelProto,
listModels,
queryModels,
refreshModelRegistry,
registerArchiveModel,
registerModel as registerUrlModel,
registerMultiFileModel,
Expand Down Expand Up @@ -459,6 +460,25 @@ export const models = {
storageFreeBytes: Number(storage?.device?.freeBytes ?? 0),
};
},

/**
* Rescan managed model directories and reconcile downloaded state.
*
* Matches `models.refresh` on the Swift, Kotlin, and Flutter namespaces,
* including its defaults. Non-throwing like the others: a failed refresh
* leaves the current registry contents in place.
*
* `list()` reads the registry as it stands and never rescans, so this is
* the only way to pick up artifacts that changed on disk out from under
* the SDK.
*/
refresh(options?: {
rescanLocal?: boolean;
includeRemoteCatalog?: boolean;
pruneOrphans?: boolean;
}): Promise<void> {
return refreshModelRegistry(options);
},
};

/**
Expand Down
Loading