Blacktraffic

Blacktraffic

The namespace for all UF/Blacktraffic utility functions, typically for static methods.

Source:

Classes

AgentBrowser
Worker

Members

(static) lm__studio_url :string

The LM Studio URL to use as the default gateway.

Source:
Type:
  • string

Methods

(static) LMStudio_prompt(arg0_prompt, arg1_optionsopt) → {Promise.<(string|undefined)>}

Prompts LMStudio's current model and waits for a response.

Source:
Parameters:
Name Type Attributes Description
arg0_prompt string
arg1_options Object <optional>

Any options used by LMStudio models to fine-tune parameters.

Name Type Attributes Default Description
temperature number <optional>
0.7
url string <optional>
Blacktraffic.lm_studio_url
Returns:
Type:
Promise.<(string|undefined)>

(static) LMStudio_promptImage(arg0_prompt, arg1_image_path, arg2_optionsopt) → {Promise.<(string|undefined)>}

Prompts LMStudio's current model with an image and associated text and waits for a response.

Source:
Parameters:
Name Type Attributes Description
arg0_prompt string
arg1_image_path string
arg2_options <optional>
Name Type Attributes Default Description
url string <optional>
Blacktraffic.lm_studio_url
Returns:
Type:
Promise.<(string|undefined)>

(static) Python_execNotebook(arg0_input_file_path, arg1_output_file_path) → {Promise.<string>}

Executes an .ipynb notebook with both an input and output file path to which the job output is written to.

Source:
Parameters:
Name Type Description
arg0_input_file_path string
arg1_output_file_path string
Returns:
Type:
Promise.<string>

(static) Python_execNotebookWithPapermill(arg0_input_file_path, arg1_output_file_path, arg2_parameters_obj) → {Promise.<string>}

Executes an .ipynb notebook using Papermill to pass parameters.

Source:
Parameters:
Name Type Description
arg0_input_file_path string
arg1_output_file_path string
arg2_parameters_obj Object
Returns:
Type:
Promise.<string>

(static) Python_run(arg0_input_file_path, argn_arguments) → {Promise.<(Object|string)>}

Runs a .py file within the current Node.js process asynchronously.

Source:
Parameters:
Name Type Description
arg0_input_file_path string
argn_arguments
Returns:
Type:
Promise.<(Object|string)>

(static) R_callMethod(arg0_input_file_path, arg1_method_name, arg2_params, arg3_R_path) → {string}

Calls an R function located in an external script with parameters and returns the result.

Source:
Parameters:
Name Type Description
arg0_input_file_path string
arg1_method_name string
arg2_params Array.<any>
arg3_R_path string | undefined
Returns:
Type:
string

(static) R_callMethodAsync(arg0_input_file_path, arg1_method_name, arg2_params, arg3_R_path) → {Promise.<string>}

Calls an R function located in an external script with parameters and returns the result asynchronously.

Source:
Parameters:
Name Type Description
arg0_input_file_path string
arg1_method_name string
arg2_params Array.<any>
arg3_R_path string | undefined
Returns:
Type:
Promise.<string>

(static) R_callStandardMethod(arg0_method_name, arg1_params, arg2_R_path) → {string}

Calls a standard R function with parameters and returns the result.

Source:
Parameters:
Name Type Description
arg0_method_name string
arg1_params Array.<any>
arg2_R_path string | undefined
Returns:
Type:
string

(static) R_convertMethodSyntaxToString(arg0_method_name, arg1_params) → {string}

Converts a JS method syntax to a string. Internal helper function.

Source:
Parameters:
Name Type Description
arg0_method_name string
arg1_params Array.<any>
Returns:
Type:
string

(static) R_convertParamsArray(arg0_params) → {string}

Formats the parameters so that R can read them.

Source:
Parameters:
Name Type Description
arg0_params Array.<any>
Returns:
Type:
string

(static) R_execCommand(arg0_command, arg1_R_path) → {Array.<any>}

Executes a specific 1-line command for R.

Source:
Parameters:
Name Type Description
arg0_command string
arg1_R_path string | undefined
Returns:
Type:
Array.<any>

(static) R_execCommandAsync(arg0_command, arg1_R_path) → {Promise.<Array.<any>>}

Executes a specific 1-line command for R asynchronously.

Source:
Parameters:
Name Type Description
arg0_command string
arg1_R_path string | undefined
Returns:
Type:
Promise.<Array.<any>>

(static) R_execScript(arg0_input_file_path, arg1_R_path) → {Array.<any>}

Executes all the commands in a file specified by the given arg0_input_file_path.

Note. The function reads only variables printed to stdout by the cat() or print() function. It is recommended to use the print() function instead of cat() to avoid line break issues. If you use cat(), remember to add the newline character "\n" at the end of each cat: for example, cat("...\n").

Source:
Parameters:
Name Type Description
arg0_input_file_path string
arg1_R_path string | undefined
Returns:
Type:
Array.<any>

(static) R_filterMultiline(arg0_command_result) → {Array.<any>}

Filters the multiline output from Blacktraffic.R_execCommand and Blacktraffic.R_execScript functions using RegEx and cast filtering.

Source:
Parameters:
Name Type Description
arg0_command_result string
Returns:
Type:
Array.<any>

(static) R_getBinaryPath(arg0_R_path) → {string}

Check if Rscript(R) is installed od the system and returns the path where the binary is installed. Returns the file path of the given installation.

Source:
Parameters:
Name Type Description
arg0_R_path string

Alternative path to use as binaries directory.

Returns:
Type:
string

(static) execCommand(arg0_command, argn_arguments) → {Object}

Executes a shell command.

Source:
Parameters:
Name Type Description
arg0_command string
argn_arguments
Returns:
Type:
Object

(static) execCommandAsync(arg0_command, argn_arguments) → {Promise.<{stderr: string, stdout: string}>}

Executes a shell command asynchronously.

Source:
Parameters:
Name Type Description
arg0_command string
argn_arguments
Returns:
Type:
Promise.<{stderr: string, stdout: string}>

(static) getChromeBinaryPath() → {string}

Attempts to return the Chrome binary path.

Source:
Returns:
Type:
string

(static) getChromeDefaultProfilePath(arg0_profileopt) → {string}

Attempts to return the default Chrome profile path.

Source:
Parameters:
Name Type Attributes Description
arg0_profile string <optional>
Returns:
Type:
string

(static) getFirefoxBinaryPath() → {string}

Attempts to return the Firefox binary path.

Source:
Returns:
Type:
string

(static) getFreePort() → {Promise.<number>}

Returns any available port that can be used by Puppeteer/Selenium agents, or for server work.

Source:
Returns:
Type:
Promise.<number>

(static) getOS() → {string}

Returns the current operating system. Either 'lin'/'mac'/'win'.

Source:
Returns:
Type:
string

(static) sleep(arg0_ms) → {Promise.<unknown>}

Waits a certain number of ms before continuing with the current process as a synchronous command.

Source:
Parameters:
Name Type Description
arg0_ms number
Returns:
Type:
Promise.<unknown>