Function: parseResourceKey()
ts
function parseResourceKey(
key: string,
env?: {
remoteHost?: string;
remotePathTemplate?: string;
},
):
| {
filename: string;
repo: string;
}
| undefined;Defined in: src/batteries/llm/transformers_js/model_source.ts:62
Reverse buildResourcePaths' remote-URL key back into {repo, filename}.
Handles the canonical {host}{model}/resolve/{revision}/{filename} template. Returns undefined for any key that is not a remote-host URL (e.g. the local-path probe tryCache issues first), so the caller falls through to the default loader instead of mis-routing.
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | The string transformers.js passes to cache.match (the remote URL). |
env | { remoteHost?: string; remotePathTemplate?: string; } | The (possibly customized) host/template; defaults match the library's own defaults. |
env.remoteHost? | string | - |
env.remotePathTemplate? | string | - |
Returns
| { filename: string; repo: string; } | undefined