sto_create_file

def sto_create_file(file_name: str, file_path: str, collection_name: str = None) -> str

Source code

Description: Create a file based on either file_name or file_path

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

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

Parameters:

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

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

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

Returns:

  • Success message (str): "File has been created successfully at: {file_path}"

  • Exists message (str): "File already exists at: {file_path}"

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

Last updated