fabricatio_actions.actions.output
Dump the finalized output to a file.
Classes
Dump the finalized output to a file. |
|
Render the data to a file. |
|
Persist all the data to a directory. |
|
Retrieve the object from the persistent file. |
|
Retrieve the object from the latest persistent file in the dir at load_path. |
|
Gather the objects from the context as a list. |
|
Forward the object from the context to the output. |
Module Contents
- class fabricatio_actions.actions.output.DumpFinalizedOutput(/, **data: Any)
Bases:
fabricatio_core.models.action.Action,fabricatio_core.capabilities.usages.UseLLMDump the finalized output to a file.
- class fabricatio_actions.actions.output.RenderedDump(/, **data: Any)
Bases:
fabricatio_core.models.action.Action,fabricatio_core.capabilities.usages.UseLLMRender the data to a file.
- class fabricatio_actions.actions.output.PersistentAll(/, **data: Any)
Bases:
fabricatio_core.models.action.Action,fabricatio_core.capabilities.usages.UseLLMPersist all the data to a directory.
This action takes all PersistentAble objects from the execution context and persists them to individual subdirectories within a specified directory. It can handle both individual objects and collections of objects.
- Returns:
The number of objects that were successfully persisted.
- Return type:
Notes
Only objects implementing PersistentAble interface will be persisted
Each object gets its own subdirectory named after the context key
Collections of PersistentAble objects are persisted together in one subdirectory
Non-PersistentAble objects in the context are ignored
If override is True, existing persist_dir will be removed before persisting
- class fabricatio_actions.actions.output.RetrieveFromPersistent[T: fabricatio_capabilities.models.generic.PersistentAble](/, **data: Any)
Bases:
fabricatio_core.models.action.ActionRetrieve the object from the persistent file.
- retrieve_cls: Type[T]
The class of the object to retrieve.
- class fabricatio_actions.actions.output.RetrieveFromLatest[T: fabricatio_capabilities.models.generic.PersistentAble](/, **data: Any)
Bases:
RetrieveFromPersistent[T],fabricatio_actions.models.generic.FromMapping[str | pathlib.Path,RetrieveFromLatest[T]]Retrieve the object from the latest persistent file in the dir at load_path.
- classmethod from_mapping(mapping: Mapping[str, str | pathlib.Path], /, retrieve_cls: Type[T] | None = None, **kwargs) List[RetrieveFromLatest[T]]
Create a list of RetrieveFromLatest from the mapping.
- class fabricatio_actions.actions.output.GatherAsList(/, **data: Any)
Bases:
fabricatio_core.models.action.ActionGather the objects from the context as a list.
Notes
If both gather_suffix and gather_prefix are specified, only the objects with the suffix will be gathered.
- class fabricatio_actions.actions.output.Forward[V: str](/, **data: Any)
Bases:
fabricatio_core.models.action.Action,fabricatio_actions.models.generic.FromMapping,fabricatio_actions.models.generic.FromSequence[V]Forward the object from the context to the output.