Skip to content

Module cli

The CLI for the deepset Cloud SDK.

download

@cli_app.command()
def download(workspace_name: str = DEFAULT_WORKSPACE_NAME,
             file_dir: Optional[str] = None,
             name: Optional[str] = None,
             content: Optional[str] = None,
             odata_filter: Optional[str] = None,
             include_meta: bool = True,
             batch_size: int = 50,
             api_key: Optional[str] = None,
             api_url: Optional[str] = None,
             show_progress: bool = True) -> None

Download files from deepset Cloud to your local machine.

Arguments:

  • workspace_name: Name of the workspace to download the files from. Uses the workspace from the .ENV file by default.
  • file_dir: Path to the folder to download. If the folder contains unsupported files, they're skipped. during the upload. Supported file formats are TXT and PDF.
  • name: Name of the file to odata_filter for.
  • content: Content of the file to odata_filter for.
  • odata_filter: odata_filter to apply to the file list.
  • include_meta: Whether to include the file meta in the folder.
  • batch_size: Batch size for the listing.
  • api_key: API key to use for authentication.
  • api_url: API URL to use for authentication.
  • show_progress: Shows the upload progress.

login

@cli_app.command()
def login() -> None

Log in to deepset Cloud. This command creates an .ENV file with your deepset Cloud API key and the default workspace used for all operations.

Run this command before performing any tasks in deepset Cloud using the SDK or CLI, unless you already created the .ENV file.

Example:

deepset-cloud login

This prompts you to provide your deepset Cloud API key and workspace name.

logout

@cli_app.command()
def logout() -> None

Log out of deepset Cloud. This command deletes the .ENV file created during login.

Example:

deepset-cloud logout

list_files

@cli_app.command()
def list_files(api_key: Optional[str] = None,
               api_url: Optional[str] = None,
               content: Optional[str] = None,
               name: Optional[str] = None,
               odata_filter: Optional[str] = None,
               workspace_name: str = DEFAULT_WORKSPACE_NAME,
               batch_size: int = 10,
               timeout_s: Optional[int] = None) -> None

List files that exist in the specified deepset Cloud workspace.

Arguments:

  • api_key: deepset Cloud API key to use for authentication.
  • api_url: API URL to use for authentication.
  • workspace_name: Name of the workspace to list the files from. Uses the workspace from the .ENV file by default.
  • name: Name of the file to odata_filter for.
  • content: Content of the file to odata_filter for.
  • odata_filter: odata_filter to apply to the file list.
  • batch_size: Batch size to use for the file list.
  • timeout_s: The timeout for this request, in seconds. Example: deepset-cloud list-files --batch-size 10

Example using an odata filter to show only files whose category is "news": deepset-cloud list-files --odata-filter 'category eq "news"'

list_upload_sessions

@cli_app.command()
def list_upload_sessions(api_key: Optional[str] = None,
                         api_url: Optional[str] = None,
                         is_expired: Optional[bool] = False,
                         workspace_name: str = DEFAULT_WORKSPACE_NAME,
                         batch_size: int = 10,
                         timeout_s: Optional[int] = None) -> None

List the details of all upload sessions for the specified workspace, including closed sessions.

Arguments:

  • api_key: deepset Cloud API key to use for authentication.
  • api_url: API URL to use for authentication.
  • workspace_name: Name of the workspace to list the files from. Uses the workspace from the .ENV file by default.
  • is_expired: Whether to list expired upload sessions.
  • batch_size: Batch size to use for the file list.
  • timeout_s: Timeout in seconds for the API requests. Example: deepset-cloud list-upload-sessions --workspace-name default

get_upload_session

@cli_app.command()
def get_upload_session(session_id: UUID,
                       api_key: Optional[str] = None,
                       api_url: Optional[str] = None,
                       workspace_name: str = DEFAULT_WORKSPACE_NAME) -> None

Fetch an upload session from deepset Cloud. This method is useful for checking

the status of an upload session after uploading files to deepset Cloud.

Arguments:

  • session_id: ID of the upload session whose status you want to check.
  • api_key: deepset Cloud API key to use for authentication.
  • api_url: API URL to use for authentication.
  • workspace_name: Name of the workspace where you upload your files. Uses the workspace from the .ENV file by default. Example: deepset-cloud get-upload-session --workspace-name default

version_callback

def version_callback(value: bool) -> None

Show the SDK version and exit.

Arguments:

  • value: Value of the version option. Example: deepset-cloud --version

main

@cli_app.callback()
def main(_: Optional[bool] = typer.Option(
    None,
    "--version",
    callback=version_callback,
    is_eager=True,
    help="Show the SDK version and exit.")) -> None

The CLI for the deepset Cloud SDK.

run_packaged

def run_packaged() -> None

Run the packaged CLI.

This is the entrypoint for the package to enable running the CLI using typer.

Example:

deepset cloud run-packaged