tool
Adapted from the Griptape AI Framework documentation.
Bases:
BaseTool
Attributes
Name | Type | Description |
---|---|---|
description | str | A description of what the Structure does. |
structure_run_driver | BaseStructureRunDriver | Driver to run the Structure. |
Source Code in griptape/tools/structure_run/tool.py
@define class StructureRunTool(BaseTool): """Tool for running a Structure. Attributes: description: A description of what the Structure does. structure_run_driver: Driver to run the Structure. """ description: str = field(kw_only=True, metadata={"serializable": True}) structure_run_driver: BaseStructureRunDriver = field(kw_only=True, metadata={"serializable": True}) @activity( config={ "description": "Can be used to run a Gen AI Builder Structure with the following description: {{ _self.description }}", "schema": Schema( { Literal("args", description="A list of string arguments to submit to the Structure Run"): Schema( [str] ) }, ), }, ) def run_structure(self, params: dict) -> BaseArtifact: args: list[str] = params["values"]["args"] return self.structure_run_driver.run(*[TextArtifact(arg) for arg in args])
description = field(kw_only=True, metadata={'serializable': True})
class-attribute instance-attributestructure_run_driver = field(kw_only=True, metadata={'serializable': True})
class-attribute instance-attribute
run_structure(params)
Source Code in griptape/tools/structure_run/tool.py
@activity( config={ "description": "Can be used to run a Gen AI Builder Structure with the following description: {{ _self.description }}", "schema": Schema( { Literal("args", description="A list of string arguments to submit to the Structure Run"): Schema( [str] ) }, ), }, ) def run_structure(self, params: dict) -> BaseArtifact: args: list[str] = params["values"]["args"] return self.structure_run_driver.run(*[TextArtifact(arg) for arg in args])
- On this page
- Attributes
- run_structure(params)
Could this page be better? Report a problem or suggest an addition!