aixplain.v2.file
FileCreateParams Objects
class FileCreateParams(BaseCreateParams)
Parameters for creating a file.
File Objects
class File(BaseResource, CreateResourceMixin[FileCreateParams, "File"])
Resource for files.
create
@classmethod
def create(cls, *args, **kwargs: Unpack[FileCreateParams]) -> "File"
Create a file.
to_link
@classmethod
def to_link(cls, local_path: str) -> str
Convert a local path to a link.
Arguments:
local_path
- str: The local path to the file.
Returns:
str
- The link to the file.
upload
@classmethod
def upload(cls,
local_path: str,
tags: List[str] = None,
license: "License" = None,
is_temp: bool = True) -> str
Upload a file.
Arguments:
local_path
- str: The local path to the file.
Returns:
str
- The upload URL.
check_storage_type
@classmethod
def check_storage_type(cls, upload_url: str) -> "StorageType"
Check the storage type of a file.
Arguments:
upload_url
- str: The upload URL.
Returns:
StorageType
- The storage type of the file.