Skip to content

extraction_task

ExtractionTask

Bases: BaseTextInputTask

Source code in griptape/tasks/extraction_task.py
@define
class ExtractionTask(BaseTextInputTask):
    extraction_engine: BaseExtractionEngine = field(kw_only=True)
    args: dict = field(kw_only=True, factory=dict)

    def run(self) -> ListArtifact | ErrorArtifact:
        return self.extraction_engine.extract_artifacts(
            ListArtifact([self.input]), rulesets=self.all_rulesets, **self.args
        )

args: dict = field(kw_only=True, factory=dict) class-attribute instance-attribute

extraction_engine: BaseExtractionEngine = field(kw_only=True) class-attribute instance-attribute

run()

Source code in griptape/tasks/extraction_task.py
def run(self) -> ListArtifact | ErrorArtifact:
    return self.extraction_engine.extract_artifacts(
        ListArtifact([self.input]), rulesets=self.all_rulesets, **self.args
    )