Mojentic.LLM.Tools.EphemeralTaskManager.Task (Mojentic v1.2.0)

Copy Markdown View Source

Represents a task with an identifier, description, and status.

Tasks follow a state machine that transitions from :pending through :in_progress to :completed.

Summary

Functions

Creates a new task with the given ID and description.

Returns the string representation of a task status.

Types

status()

@type status() :: :pending | :in_progress | :completed

t()

@type t() :: %Mojentic.LLM.Tools.EphemeralTaskManager.Task{
  description: String.t(),
  id: pos_integer(),
  status: status()
}

Functions

new(id, description)

Creates a new task with the given ID and description.

Examples

iex> Task.new(1, "Write tests")
%Task{id: 1, description: "Write tests", status: :pending}

status_to_string(status)

Returns the string representation of a task status.

Examples

iex> Task.status_to_string(:pending)
"pending"

iex> Task.status_to_string(:in_progress)
"in_progress"