tool¶
text instruction tool.
Classes
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.