marvin.tasks.task
Tasks for Marvin.
A Task is a container for a prompt and its associated state.
Constants
NOTSET
T
Classes
Task
-
friendly_nameGet a friendly name for this task. -
get_actorRetrieve the actor assigned to this task. -
get_end_turn_toolsGet the result tool for this task. -
get_promptGet the rendered prompt for this task. Uses the task’s prompt_template (or default if None) and renders it with this task instance as thetaskvariable. -
get_result_typeGet 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_strGet a string representation of the result type. -
get_toolsGet the tools assigned to this task. -
is_classifierReturn True if this task is a classification task. -
is_completeCheck if the task is complete. -
is_failedCheck if the task is failed. -
is_incompleteCheck if the task is incomplete. -
is_pendingCheck if the task is pending. -
is_readyCheck 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_runningCheck if the task is running. -
is_skippedCheck if the task is skipped. -
is_successfulCheck if the task is successful. -
mark_failedMark the task as failed with an error message. -
mark_failed_tool -
mark_runningMark the task as running. -
mark_skippedMark the task as skipped. -
mark_skipped_tool -
mark_successfulMark the task as successful with an optional result. -
mark_successful_tool -
run -
run_async -
run_stream -
validate_resultValidate a result against the expected type and custom validator.
TaskState
Functions
get_type_adapter
Parent Module:
tasks