tasks
__all__ = ['ActionsSubtask', 'OutputSchemaValidationSubtask', 'AssistantTask', 'AudioTranscriptionTask', 'BaseAudioGenerationTask', 'BaseImageGenerationTask', 'BaseTask', 'BaseSubtask', 'BaseTextInputTask', 'BranchTask', 'CodeExecutionTask', 'ExtractionTask', 'InpaintingImageGenerationTask', 'OutpaintingImageGenerationTask', 'PromptImageGenerationTask', 'PromptTask', 'RagTask', 'StructureRunTask', 'TextSummaryTask', 'TextToSpeechTask', 'ToolTask', 'ToolkitTask', 'VariationImageGenerationTask']
module-attribute
ActionsSubtask
Bases: BaseSubtask[Union[ListArtifact, ErrorArtifact]]
Source code in griptape/tasks/actions_subtask.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 |
|
ACTIONS_PATTERN = '(?s)Actions:[^\\[]*(\\[.*\\])'
class-attribute
instance-attribute
ANSWER_PATTERN = '(?s)^Answer:\\s?([\\s\\S]*)$'
class-attribute
instance-attribute
RESPONSE_STOP_SEQUENCE = '<|Response|>'
class-attribute
instance-attribute
THOUGHT_PATTERN = '(?s)^Thought:\\s*(.*?)$'
class-attribute
instance-attribute
_input = field(default=lambda task: task.full_context['args'][0] if task.full_context['args'] else TextArtifact(value=''), alias='input')
class-attribute
instance-attribute
_memory = None
class-attribute
instance-attribute
_origin_task = field(default=None, kw_only=True)
class-attribute
instance-attribute
actions = field(factory=list, kw_only=True)
class-attribute
instance-attribute
generate_assistant_subtask_template = field(default=Factory(lambda self: self.default_generate_assistant_subtask_template, takes_self=True), kw_only=True)
class-attribute
instance-attribute
generate_user_subtask_template = field(default=Factory(lambda self: self.default_generate_user_subtask_template, takes_self=True), kw_only=True)
class-attribute
instance-attribute
input
property
writable
output = field(default=None, init=False)
class-attribute
instance-attribute
response_stop_sequence = field(default=RESPONSE_STOP_SEQUENCE, kw_only=True)
class-attribute
instance-attribute
thought = field(default=None, kw_only=True)
class-attribute
instance-attribute
__init_from_artifact(artifact)
Parses the input Artifact to extract either a final answer or thought and actions.
When the input Artifact is a TextArtifact, it is assumed to be the final answer. When the input Artifact is a ListArtifact, it is assumed to contain both thought and actions. Text Artifacts are parsed as the thought, and ToolAction Artifacts parsed as the actions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
artifact
|
TextArtifact | AudioArtifact | ListArtifact
|
The input Artifacts. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
Source code in griptape/tasks/actions_subtask.py
__init_from_prompt(value)
Source code in griptape/tasks/actions_subtask.py
__parse_actions(actions_matches)
Source code in griptape/tasks/actions_subtask.py
__process_action_object(action_object)
Source code in griptape/tasks/actions_subtask.py
__validate_action(action)
Source code in griptape/tasks/actions_subtask.py
_process_task_input(task_input)
Source code in griptape/tasks/actions_subtask.py
actions_to_dicts()
Source code in griptape/tasks/actions_subtask.py
actions_to_json()
add_to_prompt_stack(stack)
Source code in griptape/tasks/actions_subtask.py
after_run()
Source code in griptape/tasks/actions_subtask.py
attach_to(parent_task)
Source code in griptape/tasks/actions_subtask.py
before_run()
Source code in griptape/tasks/actions_subtask.py
default_generate_assistant_subtask_template(subtask)
default_generate_user_subtask_template(subtask)
run_action(action)
Source code in griptape/tasks/actions_subtask.py
run_actions(actions)
Source code in griptape/tasks/actions_subtask.py
try_run()
Source code in griptape/tasks/actions_subtask.py
AssistantTask
Bases: BaseTextInputTask[TextArtifact]
Task to run an Assistant.
Attributes:
Name | Type | Description |
---|---|---|
assistant_driver |
BaseAssistantDriver
|
Driver to run the Assistant. |
Source code in griptape/tasks/assistant_task.py
AudioTranscriptionTask
Bases: BaseAudioInputTask[TextArtifact]
Source code in griptape/tasks/audio_transcription_task.py
audio_transcription_driver = field(default=Factory(lambda: Defaults.drivers_config.audio_transcription_driver), kw_only=True)
class-attribute
instance-attribute
BaseAudioGenerationTask
Bases: ArtifactFileOutputMixin
, RuleMixin
, BaseTask[AudioArtifact]
, ABC
Source code in griptape/tasks/base_audio_generation_task.py
after_run()
BaseImageGenerationTask
Bases: ArtifactFileOutputMixin
, RuleMixin
, BaseTask[ImageArtifact]
, ABC
Provides a base class for image generation-related tasks.
Attributes:
Name | Type | Description |
---|---|---|
negative_rulesets |
list[Ruleset]
|
List of negatively-weighted rulesets applied to the text prompt, if supported by the driver. |
negative_rules |
list[Rule]
|
List of negatively-weighted rules applied to the text prompt, if supported by the driver. |
output_dir |
Optional[str]
|
If provided, the generated image will be written to disk in output_dir. |
output_file |
Optional[str]
|
If provided, the generated image will be written to disk as output_file. |
Source code in griptape/tasks/base_image_generation_task.py
DEFAULT_NEGATIVE_RULESET_NAME = 'Negative Ruleset'
class-attribute
instance-attribute
_negative_rulesets = field(factory=list, kw_only=True, alias='negative_rulesets')
class-attribute
instance-attribute
image_generation_driver = field(default=Factory(lambda: Defaults.drivers_config.image_generation_driver), kw_only=True)
class-attribute
instance-attribute
negative_rules = field(factory=list, kw_only=True)
class-attribute
instance-attribute
negative_rulesets
property
_get_negative_prompts()
_get_prompts(prompt)
BaseSubtask
Source code in griptape/tasks/base_subtask.py
children
property
origin_task
property
parents
property
add_child(child)
add_parent(parent)
add_to_prompt_stack(stack)
abstractmethod
BaseTask
Bases: FuturesExecutorMixin
, SerializableMixin
, RunnableMixin['BaseTask']
, ABC
, Generic[T]
Source code in griptape/tasks/base_task.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 |
|
_execution_args = field(factory=tuple, init=False)
class-attribute
instance-attribute
child_ids = field(factory=list, kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
children
property
context = field(factory=dict, kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
execution_args
property
full_context
property
id = field(default=Factory(lambda: uuid.uuid4().hex), kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
input
abstractmethod
property
max_meta_memory_entries = field(default=20, kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
meta_memories
property
output = field(default=None, init=False)
class-attribute
instance-attribute
parent_ids = field(factory=list, kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
parent_outputs
property
parents
property
parents_output_text
property
state = field(default=State.PENDING, kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
structure = field(default=None, kw_only=True)
class-attribute
instance-attribute
State
Bases: Enum
Source code in griptape/tasks/base_task.py
FINISHED = 3
class-attribute
instance-attribute
PENDING = 1
class-attribute
instance-attribute
RUNNING = 2
class-attribute
instance-attribute
SKIPPED = 4
class-attribute
instance-attribute
__attrs_post_init__()
__lshift__(other)
__rshift__(other)
__str__()
add_child(child)
Source code in griptape/tasks/base_task.py
add_children(children)
add_parent(parent)
Source code in griptape/tasks/base_task.py
add_parents(parents)
after_run()
Source code in griptape/tasks/base_task.py
before_run()
Source code in griptape/tasks/base_task.py
can_run()
Source code in griptape/tasks/base_task.py
is_finished()
is_pending()
is_running()
is_skipped()
preprocess(structure)
reset()
run(*args)
Source code in griptape/tasks/base_task.py
BaseTextInputTask
Bases: RuleMixin
, BaseTask[T]
, ABC
Source code in griptape/tasks/base_text_input_task.py
DEFAULT_INPUT_TEMPLATE = '{{ args[0] }}'
class-attribute
instance-attribute
_input = field(default=DEFAULT_INPUT_TEMPLATE, alias='input')
class-attribute
instance-attribute
input
property
writable
after_run()
BranchTask
Bases: CodeExecutionTask[Union[InfoArtifact, ListArtifact[InfoArtifact]]]
Source code in griptape/tasks/branch_task.py
on_run = field(kw_only=True)
class-attribute
instance-attribute
try_run()
Source code in griptape/tasks/branch_task.py
CodeExecutionTask
Source code in griptape/tasks/code_execution_task.py
DEFAULT_INPUT_TEMPLATE = '{{ args[0] }}'
class-attribute
instance-attribute
_input = field(default=DEFAULT_INPUT_TEMPLATE, alias='input')
class-attribute
instance-attribute
input
property
on_run = field(kw_only=True)
class-attribute
instance-attribute
ExtractionTask
Bases: BaseTextInputTask[ListArtifact]
Source code in griptape/tasks/extraction_task.py
args = field(kw_only=True, factory=dict)
class-attribute
instance-attribute
extraction_engine = field(kw_only=True)
class-attribute
instance-attribute
InpaintingImageGenerationTask
Bases: BaseImageGenerationTask
A task that modifies a select region within an image using a mask.
Accepts a text prompt, image, and mask as input in one of the following formats: - tuple of (template string, ImageArtifact, ImageArtifact) - tuple of (TextArtifact, ImageArtifact, ImageArtifact) - Callable that returns a tuple of (TextArtifact, ImageArtifact, ImageArtifact).
Attributes:
Name | Type | Description |
---|---|---|
image_generation_driver |
BaseImageGenerationDriver
|
The driver used to generate the image. |
negative_rulesets |
list[Ruleset]
|
List of negatively-weighted rulesets applied to the text prompt, if supported by the driver. |
negative_rules |
list[Rule]
|
List of negatively-weighted rules applied to the text prompt, if supported by the driver. |
output_dir |
Optional[str]
|
If provided, the generated image will be written to disk in output_dir. |
output_file |
Optional[str]
|
If provided, the generated image will be written to disk as output_file. |
Source code in griptape/tasks/inpainting_image_generation_task.py
_input = field(default=None, alias='input')
class-attribute
instance-attribute
input
property
writable
try_run()
Source code in griptape/tasks/inpainting_image_generation_task.py
OutpaintingImageGenerationTask
Bases: BaseImageGenerationTask
A task that modifies an image outside the bounds of a mask.
Accepts a text prompt, image, and mask as input in one of the following formats: - tuple of (template string, ImageArtifact, ImageArtifact) - tuple of (TextArtifact, ImageArtifact, ImageArtifact) - Callable that returns a tuple of (TextArtifact, ImageArtifact, ImageArtifact).
Attributes:
Name | Type | Description |
---|---|---|
image_generation_driver |
BaseImageGenerationDriver
|
The engine used to generate the image. |
negative_rulesets |
list[Ruleset]
|
List of negatively-weighted rulesets applied to the text prompt, if supported by the driver. |
negative_rules |
list[Rule]
|
List of negatively-weighted rules applied to the text prompt, if supported by the driver. |
output_dir |
Optional[str]
|
If provided, the generated image will be written to disk in output_dir. |
output_file |
Optional[str]
|
If provided, the generated image will be written to disk as output_file. |
Source code in griptape/tasks/outpainting_image_generation_task.py
_input = field(default=None, alias='input')
class-attribute
instance-attribute
input
property
writable
try_run()
Source code in griptape/tasks/outpainting_image_generation_task.py
OutputSchemaValidationSubtask
Bases: BaseSubtask
Source code in griptape/tasks/output_schema_validation_subtask.py
_input = field(alias='input')
class-attribute
instance-attribute
_validation_errors = field(default=None, init=False)
class-attribute
instance-attribute
generate_assistant_subtask_template = field(default=Factory(lambda self: self.default_generate_assistant_subtask_template, takes_self=True), kw_only=True)
class-attribute
instance-attribute
generate_user_subtask_template = field(default=Factory(lambda self: self.default_generate_user_subtask_template, takes_self=True), kw_only=True)
class-attribute
instance-attribute
input
property
writable
output_schema = field(kw_only=True)
class-attribute
instance-attribute
structured_output_strategy = field(default='rule', kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
validation_errors
property
add_to_prompt_stack(stack)
Source code in griptape/tasks/output_schema_validation_subtask.py
after_run()
Source code in griptape/tasks/output_schema_validation_subtask.py
attach_to(parent_task)
Source code in griptape/tasks/output_schema_validation_subtask.py
before_run()
default_generate_assistant_subtask_template(subtask)
default_generate_user_subtask_template(subtask)
PromptImageGenerationTask
Bases: BaseImageGenerationTask
Used to generate an image from a text prompt.
Accepts prompt as input in one of the following formats: - template string - TextArtifact - Callable that returns a TextArtifact.
Attributes:
Name | Type | Description |
---|---|---|
image_generation_driver |
BaseImageGenerationDriver
|
The engine used to generate the image. |
negative_rulesets |
list[Ruleset]
|
List of negatively-weighted rulesets applied to the text prompt, if supported by the driver. |
negative_rules |
list[Rule]
|
List of negatively-weighted rules applied to the text prompt, if supported by the driver. |
output_dir |
Optional[str]
|
If provided, the generated image will be written to disk in output_dir. |
output_file |
Optional[str]
|
If provided, the generated image will be written to disk as output_file. |
Source code in griptape/tasks/prompt_image_generation_task.py
DEFAULT_INPUT_TEMPLATE = '{{ args[0] }}'
class-attribute
instance-attribute
_input = field(default=DEFAULT_INPUT_TEMPLATE, alias='input')
class-attribute
instance-attribute
input
property
writable
try_run()
Source code in griptape/tasks/prompt_image_generation_task.py
PromptTask
Bases: BaseTask[Union[TextArtifact, AudioArtifact, GenericArtifact, JsonArtifact, ListArtifact, ErrorArtifact]]
, RuleMixin
, ActionsSubtaskOriginMixin
Source code in griptape/tasks/prompt_task.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 |
|
DEFAULT_MAX_STEPS = 20
class-attribute
instance-attribute
RESPONSE_STOP_SEQUENCE = '<|Response|>'
class-attribute
instance-attribute
_conversation_memory = field(default=Factory(lambda: NOTHING), kw_only=True, alias='conversation_memory')
class-attribute
instance-attribute
_input = field(default=lambda task: task.full_context['args'][0] if task.full_context['args'] else TextArtifact(value=''), alias='input')
class-attribute
instance-attribute
conversation_memory
property
writable
generate_assistant_subtask_template = field(default=Factory(lambda self: self.default_generate_assistant_subtask_template, takes_self=True), kw_only=True)
class-attribute
instance-attribute
generate_system_template = field(default=Factory(lambda self: self.default_generate_system_template, takes_self=True), kw_only=True)
class-attribute
instance-attribute
generate_user_subtask_template = field(default=Factory(lambda self: self.default_generate_user_subtask_template, takes_self=True), kw_only=True)
class-attribute
instance-attribute
input
property
writable
max_subtasks = field(default=DEFAULT_MAX_STEPS, kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
output = field(default=None, init=False)
class-attribute
instance-attribute
output_schema = field(default=None, kw_only=True)
class-attribute
instance-attribute
prompt_driver = field(default=Factory(lambda: Defaults.drivers_config.prompt_driver), kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
prompt_stack
property
reflect_on_tool_use = field(default=True, kw_only=True)
class-attribute
instance-attribute
response_stop_sequence = field(default=RESPONSE_STOP_SEQUENCE, kw_only=True)
class-attribute
instance-attribute
rulesets
property
subtask_runners = field(default=Factory(lambda self: [self.default_run_actions_subtasks, self.default_run_output_schema_validation_subtasks], takes_self=True), kw_only=True)
class-attribute
instance-attribute
subtasks = field(factory=list)
class-attribute
instance-attribute
task_memory = field(default=None, kw_only=True)
class-attribute
instance-attribute
tool_output_memory
property
tools = field(factory=list, kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
__attrs_post_init__()
_process_task_input(task_input)
Source code in griptape/tasks/prompt_task.py
actions_schema()
add_subtask(subtask)
Source code in griptape/tasks/prompt_task.py
after_run()
Source code in griptape/tasks/prompt_task.py
before_run()
default_generate_assistant_subtask_template(subtask)
default_generate_system_template(_)
Source code in griptape/tasks/prompt_task.py
default_generate_user_subtask_template(subtask)
default_run_actions_subtasks(subtask_input)
Source code in griptape/tasks/prompt_task.py
default_run_output_schema_validation_subtasks(subtask_input)
Source code in griptape/tasks/prompt_task.py
find_memory(memory_name)
find_subtask(subtask_id)
find_tool(tool_name)
preprocess(structure)
set_default_tools_memory(memory)
Source code in griptape/tasks/prompt_task.py
try_run()
Source code in griptape/tasks/prompt_task.py
validate_output_schema(_, output_schema)
Source code in griptape/tasks/prompt_task.py
validate_tools(_, tools)
Source code in griptape/tasks/prompt_task.py
RagTask
Bases: BaseTextInputTask[Union[ListArtifact, ErrorArtifact]]
Source code in griptape/tasks/rag_task.py
rag_engine = field(kw_only=True, default=Factory(lambda: RagEngine()))
class-attribute
instance-attribute
StructureRunTask
Bases: BaseTask
Task to run a Structure.
Attributes:
Name | Type | Description |
---|---|---|
structure_run_driver |
BaseStructureRunDriver
|
Driver to run the Structure. |
Source code in griptape/tasks/structure_run_task.py
_input = field(default=lambda task: task.full_context['args'][0] if task.full_context['args'] else TextArtifact(value=''))
class-attribute
instance-attribute
input
property
writable
structure_run_driver = field(kw_only=True)
class-attribute
instance-attribute
_process_task_input(task_input)
Source code in griptape/tasks/structure_run_task.py
TextSummaryTask
Bases: BaseTextInputTask[TextArtifact]
Source code in griptape/tasks/text_summary_task.py
summary_engine = field(default=Factory(lambda: PromptSummaryEngine()), kw_only=True)
class-attribute
instance-attribute
TextToSpeechTask
Bases: BaseAudioGenerationTask
Source code in griptape/tasks/text_to_speech_task.py
DEFAULT_INPUT_TEMPLATE = '{{ args[0] }}'
class-attribute
instance-attribute
_input = field(default=DEFAULT_INPUT_TEMPLATE)
class-attribute
instance-attribute
input
property
writable
text_to_speech_driver = field(default=Factory(lambda: Defaults.drivers_config.text_to_speech_driver), kw_only=True)
class-attribute
instance-attribute
try_run()
Source code in griptape/tasks/text_to_speech_task.py
ToolTask
Bases: PromptTask
, ActionsSubtaskOriginMixin
Source code in griptape/tasks/tool_task.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
|
ACTION_PATTERN = '(?s)[^{]*({.*})'
class-attribute
instance-attribute
DEFAULT_MAX_STEPS = 0
class-attribute
instance-attribute
max_subtasks = field(default=DEFAULT_MAX_STEPS, kw_only=True, metadata={'serializable': False})
class-attribute
instance-attribute
prompt_stack
property
subtask = field(default=None, kw_only=True)
class-attribute
instance-attribute
task_memory = field(default=None, kw_only=True)
class-attribute
instance-attribute
tool = field(kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
tools = field(factory=list, kw_only=True, metadata={'serializable': False})
class-attribute
instance-attribute
__attrs_post_init__()
actions_schema()
add_subtask(subtask)
Source code in griptape/tasks/tool_task.py
default_generate_system_template(_)
Source code in griptape/tasks/tool_task.py
find_memory(memory_name)
find_subtask(subtask_id)
find_tool(tool_name)
preprocess(structure)
set_default_tools_memory(memory)
Source code in griptape/tasks/tool_task.py
try_run()
Source code in griptape/tasks/tool_task.py
ToolkitTask
Bases: PromptTask
Source code in griptape/tasks/toolkit_task.py
try_run()
Source code in griptape/tasks/toolkit_task.py
VariationImageGenerationTask
Bases: BaseImageGenerationTask
A task that generates a variation of an image using a prompt.
Accepts a text prompt and image as input in one of the following formats: - tuple of (template string, ImageArtifact) - tuple of (TextArtifact, ImageArtifact) - Callable that returns a tuple of (TextArtifact, ImageArtifact).
Attributes:
Name | Type | Description |
---|---|---|
image_generation_driver |
BaseImageGenerationDriver
|
The engine used to generate the image. |
negative_rulesets |
list[Ruleset]
|
List of negatively-weighted rulesets applied to the text prompt, if supported by the driver. |
negative_rules |
list[Rule]
|
List of negatively-weighted rules applied to the text prompt, if supported by the driver. |
output_dir |
Optional[str]
|
If provided, the generated image will be written to disk in output_dir. |
output_file |
Optional[str]
|
If provided, the generated image will be written to disk as output_file. |