A class allowing access to MakerSuite prompts that have been saved in Google Drive. MakerSuite prompts are pulled based on their Google Drive ID (which is available from Google Drive or as part of the URL when the prompt is open in MakerSuite). There is a basic cache that will store the prompt in memory for a time specified in milliseconds. This defaults to 0, indicating the prompt should always be pulled from Google Drive.

Hierarchy

  • MakerSuiteHub

Constructors

Properties

Methods

Constructors

Properties

cache: Record<string, CacheEntry> = {}
cacheTimeout: number
caller: AsyncCaller

Methods

  • Get a MakerSuitePrompt that is specified by the Google Drive ID. This will always be loaded from Google Drive.

    Parameters

    • id: string

    Returns Promise<MakerSuitePrompt>

    A MakerSuitePrompt which can be used to create a template, model, or chain.

  • Is the current cache entry valid, or does it need to be refreshed. It will need to be refreshed under any of the following conditions:

    • It does not currently exist in the cache
    • The cacheTimeout is 0
    • The cache was last updated longer ago than the cacheTimeout allows

    Parameters

    • entry: CacheEntry

      The cache entry, including when this prompt was last refreshed

    Returns boolean

  • Get a MakerSuitePrompt that is specified by the Google Drive ID. This may be loaded from Google Drive or, if there is a valid copy in the cache, the cached copy will be returned.

    Parameters

    • id: string

    Returns Promise<MakerSuitePrompt>

    A MakerSuitePrompt which can be used to create a template, model, or chain.

Generated using TypeDoc