StoreUploadedDocumentSourceUnit
Copy an uploaded file into a directory of its own and hash it.
The upload lives in a temporary directory that is removed once the job
ends, so the copy is what the document keeps as its source. Publishes the
copy's location as source_path and its sha256 as file_hash.
Where the upload landed and what it is called are known only to whatever received it, so both are runtime params.
Parameters
- path : string, default=
- Directory the original file is copied into, so the document keeps its source even after the upload or the download is gone.
Methods
execute(self, ctx: DashAI.back.units.context.ExecutionContext) -> None
StoreUploadedDocumentSourceUnitDo the unit's work, reading from and writing to the context.
Parameters
- ctx : ExecutionContext
- The shared execution context.
get_credential(self, name: str)
ConfigObjectResolve a registered credential component by name.
Parameters
- name : str
- Credential component class name (e.g. "HuggingFaceCredential").
Returns
- BaseCredential
- An instance of the requested credential component.
get_schema(cls) -> dict
ConfigObjectGenerates the component related Json Schema.
Returns
- dict
- Dictionary representing the Json Schema of the component.
validate(self, ctx: DashAI.back.units.context.ExecutionContext) -> None
BaseUnitCheck preconditions without executing the unit.
Parameters
- ctx : ExecutionContext
- The shared execution context.
validate_and_transform(self, raw_data: dict) -> dict
ConfigObjectIt takes the data given by the user to initialize the model and returns it with all the objects that the model needs to work.
Parameters
- raw_data : dict
- A dictionary with the data provided by the user to initialize the model.
Returns
- dict
- A validated dictionary with the necessary objects.