Polyman Documentation - v3.1.0
    Preparing search index...

    Live model lists, cached on disk.

    Index
    dir: string

    Folder of the cache files.

    fetchFn:
        | (
            (
                input: string | URL | Request,
                init?: RequestInit,
            ) => Promise<Response>
        )
        | undefined
    now: () => number
    ttlMs: number
    timeoutMs: number
    • The model list of a provider: the cache when it is fresh, else the live list (saved to the cache), else the old cache. Returns undefined when the provider has no list or nothing works. It never throws.

      Parameters

      Returns Promise<ModelList | undefined>

    • The caller's signal plus the time limit.

      Parameters

      • signal: AbortSignal | undefined

      Returns AbortSignal

    • Reads a cache. A missing, broken or foreign cache gives undefined.

      Parameters

      • providerId: string
      • baseUrl: string

      Returns CacheFile | undefined

    • Writes a cache: temp file, then rename. Errors are ignored.

      Parameters

      • cache: CacheFile

      Returns void