notice

This is unreleased documentation for Rasa Open Source Documentation Master/Unreleased version.
For the latest released documentation, see the latest version (2.8.x).

Version: Master/Unreleased

rasa.engine.storage.resource

Resource Objects

@dataclass
class Resource()

Represents a persisted graph component in the graph.

from_cache

@classmethod
def from_cache(cls, node_name: Text, directory: Path, model_storage: ModelStorage) -> Resource

Loads a Resource from the cache.

This automatically loads the persisted resource into the given ModelStorage.

Arguments:

  • node_name - The node name of the Resource.
  • directory - The directory with the cached Resource.
  • model_storage - The ModelStorage which the cached Resource will be added to so that the Resource is accessible for other graph nodes.

Returns:

The ready-to-use and accessible Resource.

to_cache

def to_cache(directory: Path, model_storage: ModelStorage) -> None

Persists the Resource to the cache.

Arguments:

  • directory - The directory which receives the persisted Resource.
  • model_storage - The model storage which currently contains the persisted Resource.

fingerprint

def fingerprint() -> Text

Provides fingerprint for Resource.

The fingerprint can be just the name as the persisted resource only changes if the used training data (which is loaded in previous nodes) or the config (which is fingerprinted separately) changes.

Returns:

Fingerprint for Resource.