sto_create_directory

def sto_create_directory(self, dir_name: str, dir_path: str, collection_name: str = None) -> str

Source code

Description: Create a directory based on either dir_name or dir_path

  • If the dir_path is provided, it will create the file directly at the location of the dir_path

  • Else If the dir_name is provided, the directory will be created at the path of os.path.join(self.root_dir, dir_name)

Parameters:

  • dir_name (str): Name of the file to create

  • dir_path (str): Full path where to create the file

  • collection_name (str): Name of the collection/agent (optional)

Returns:

  • Success message (str): "Directory has been created successfully at: {dir_path}"

  • Exists message (str): "Directory already exists at: {dir_path}"

  • Error message (str): "Error creating directory: {error_message}"

Last updated