task
Tasks for Marvin.
marvin.tasks.task
Tasks for Marvin.
A Task is a container for a prompt and its associated state.
Constants
NOTSET
T
Classes
Task
A task is a container for a prompt and its associated state.
Methods:
-
friendly_name
Get a friendly name for this task.
-
get_actor
Retrieve the actor assigned to this task.
-
get_end_turn_tools
Get the result tool for this task.
-
get_prompt
Get the rendered prompt for this task.
Uses the task’s prompt_template (or default if None) and renders it with this task instance as the
task
variable. -
get_result_type
Get the effective result type for this task. For classification tasks, returns the type that should be used for validation (e.g., int or list[int]).
-
get_result_type_str
Get a string representation of the result type.
-
get_tools
Get the tools assigned to this task.
-
is_classifier
Return True if this task is a classification task.
-
is_complete
Check if the task is complete.
-
is_failed
Check if the task is failed.
-
is_incomplete
Check if the task is incomplete.
-
is_pending
Check if the task is pending.
-
is_ready
Check if the task is ready to run.
A task is ready if it is incomplete and all of its dependencies (including subtasks) are complete.
-
is_running
Check if the task is running.
-
is_skipped
Check if the task is skipped.
-
is_successful
Check if the task is successful.
-
mark_failed
Mark the task as failed with an error message.
-
mark_failed_tool
-
mark_running
Mark the task as running.
-
mark_skipped
Mark the task as skipped.
-
mark_skipped_tool
-
mark_successful
Mark the task as successful with an optional result.
-
mark_successful_tool
-
run
-
run_async
-
run_stream
-
validate_result
Validate a result against the expected type and custom validator.
TaskState
State of a task.
Functions
get_type_adapter
Parent Module: tasks