Skip to content

File Tools

Tools for working with files uploaded to Turingpaper or created in Turingpaper:

  • file_create
  • file_create_folder
  • file_read
  • file_edit
  • file_update
  • file_rename
  • file_copy
  • file_delete
  • file_search
  • file_grok

Documentation

file_create

Create a file with text content. The filename must include an extension. The content must be valid UTF-8 text. The file must be unique within the folder where it is being created.

Parameters

content
The UTF-8 text content of the file.

output_path
The fully qualified path to the file to create with the content. The file name must be unique within the folder where it is being created, otherwise an error will be returned.

file_create_folder

Create a new folder. The folder must by fully qualified starting from the / folder. The folder must be unique within the folder where it is being created. All folders in the path that do not exist will be created.

Parameters

output_path
The fully qualified path to the folder to create. The folder name must be unique within the folder where it is being created, otherwise an error will be returned.

file_read

Read text content from a file. The file must contain valid UTF-8 text. A maximum of 200K characters will be read from the file. The file can be a binary file like a PDF, DOCX, PPTX because text extraction will be performed.

Parameters

input_path
The fully qualified path to the file to read the text contents of.

output_path
Optional parameter specifying a fully qualified file or folder name where the output is saved: if a filename is provided and it already exists, an error is returned; if a folder is provided, a new file with a .json extension is auto-generated and saved in that folder; an empty string or '-' displays the output directly, with '-' being the recommended default for direct display

file_edit

Edit a file based on replacing a search string with a replacement string. Regex is not supported, only exact matching is supported.

Parameters

search_text
The text to search for and replace with the replacement text. Each occurrence of the search text will be replaced with the replacement text.

replace_text
The text to put in place of the search text. Each occurrence of the search text will be replaced with the replacement text.

replace_num_occurrences
The number of occurrences of the found text to replace. When set to zero, all occurrences will be replaced. When set to some positive number n, up to n occurrences will be replaced.

input_path
The fully qualified path to the file to edit or use as a template.

output_path
Optional parameter that when set to a fully qualified filename will write the edited contents to the output file rather than editing the input file in place. A good default is the empty string which will edit the existing file in place.

file_update

Update the content of a text based file. The existing file content is replaced in full by the new content.

Parameters

content
The text content to put in place of the existing content. The existing content will be overwritten by new content.

input_path
The fully qualified path to the file to update.

output_path
Optional parameter that when set must match the input path.

file_rename

Rename a file to a new file name, or a folder to a new folder name. File names must include an extension, and folder names must not have an extension. Renaming a file or folder cannot move it to a different parent path. Fully qualified paths should be used when renaming.

Parameters

input_path
The fully qualified path to the existing file or folder that will be renamed.

output_path
The fully qualified path to the new file or folder name that must share the same path prefix with the input name. In other words file_rename cannot be used to move files or folders, it can only be used to rename a file or folder in its current location.

file_copy

Copy a file to a destination folder.

Parameters

input_path
The fully qualified path to the file to be copied.

output_path
The fully qualified path to the folder, or file name, where the copy will be created.

file_delete

Delete a file or a folder.

Parameters

input_path
The fully qualified path to the file or folder to be deleted.

output_path
Optional parameter specifying a fully qualified file or folder name where the output is saved: if a filename is provided and it already exists, an error is returned; if a folder is provided, a new file with a .json extension is auto-generated and saved in that folder; an empty string or '-' displays the output directly, with '-' being the recommended default for direct display

file_search

Search a single file or all files inside a single folder. The search term can be text that contains concepts or specific terms being searched for.

Parameters

search_term
The search term used to search the file or folder of files for relevant content.

input_path
The fully qualified path to the folder of files, or single file, to search for the search term.

output_path
Optional parameter specifying a fully qualified file or folder name where the output is saved: if a filename is provided and it already exists, an error is returned; if a folder is provided, a new file with a .json extension is auto-generated and saved in that folder; an empty string or '-' displays the output directly, with '-' being the recommended default for direct display

file_grok

Research the file for a specific objective or question. The research objective should describe what kind of information needs be retrieved from the source file.

Parameters

objective
The research objective used during the grokking of the file.

input_path
The fully qualified path to the file to examine for the research objective.

output_path
Optional parameter specifying a fully qualified file or folder name where the output is saved: if a filename is provided and it already exists, an error is returned; if a folder is provided, a new file with a .json extension is auto-generated and saved in that folder; an empty string or '-' displays the output directly, with '-' being the recommended default for direct display

Copyright © 2024-2025 Turingpaper Technologies, Inc.