tool

text instruction tool.

Classes

InstructionTool

text instruction tool.

class InstructionTool(chain, overwrite=False, verbose=True)[source]

Bases: TextTool

text instruction tool.

Parameters:
  • chain (RunnableSerializable :param chain: The instruction chain that is applied by the tool.)

  • overwrite (Optional[bool] :param overwrite: Whether to overwrite existing files, otherwise raise an error.)

  • verbose (Union[bool, int, None] :param verbose: Whether to execute the computation verbosely.)

apply_to_csv(input_path, output_path, output_column='result')[source]

Apply the instruction tool to a .csv file.

Parameters:
  • input_path (Union[str, Path]) – Path to the input .csv file.

  • output_path (Union[str, Path]) – Path to the output .csv file.

  • output_column (Optional[str]) – Name of the column to write the result of the instruction in.

apply_to_txt(input_path, output_path)[source]

Apply the instruction tool to a .txt file.

Parameters:
  • input_path (Union[str, Path]) – Path to the input .txt file.

  • output_path (Union[str, Path]) – Path to the output .txt file.

apply_to_vtt(input_path, output_path)[source]

Apply the instruction tool to a .vtt file.

Parameters:
  • input_path (Union[str, Path]) – Path to the input .vtt file.

  • output_path (Union[str, Path]) – Path to the output .txt file.