structure_run#

  • __all__ = ['BaseStructureRunDriver'] module-attribute

Bases:

ABC

Attributes#

Name

Type

Description

<a href="./#griptape.drivers.structure_run.BaseStructureRunDriver.env" title="env = field(default=Factory(dict), kw_only=True) class-attribute instance-attribute (griptape.drivers.structure_run.BaseStructureRunDriver.env)"><code class="language-python">env</code></a>

dict[str, str]

Environment variables to set before running the Structure.<br/>

Source Code in griptape/drivers/structure_run/base_structure_run_driver.py

@define
class BaseStructureRunDriver(ABC):
    """Base class for Structure Run Drivers.

    Attributes:
        env: Environment variables to set before running the Structure.
    """

    env: dict[str, str] = field(default=Factory(dict), kw_only=True)

    def run(self, *args: BaseArtifact) -> BaseArtifact:
        return self.try_run(*args)

    @abstractmethod
    def try_run(self, *args: BaseArtifact) -> BaseArtifact: ...
  • env = field(default=Factory(dict), kw_only=True) class-attribute instance-attribute

run(*args)#

Source Code in griptape/drivers/structure_run/base_structure_run_driver.py

def run(self, *args: BaseArtifact) -> BaseArtifact:
    return self.try_run(*args)

try_run(*args)abstractmethod#

Source Code in griptape/drivers/structure_run/base_structure_run_driver.py

@abstractmethod
def try_run(self, *args: BaseArtifact) -> BaseArtifact: ...