aixplain.factories.script_factory
ScriptFactory Objects
class ScriptFactory()
A factory class for handling script file operations.
This class provides functionality for uploading script files to the backend and managing their metadata.
upload_script
@classmethod
def upload_script(cls, script_path: str) -> Tuple[str, str]
Uploads a script file to the backend and returns its ID and metadata.
Arguments:
script_path
str - The file system path to the script file to be uploaded.
Returns:
Tuple[str, str]: A tuple containing:
- file_id (str): The unique identifier assigned to the uploaded file.
- metadata (str): JSON string containing file metadata (name and size).
Raises:
Exception
- If the upload fails or the file cannot be accessed.