Packages

Become the CEO of your own AI workforce, efficiently managing countless intelligent agents with minimal resources.

Current section

Files

Jump to
staff_ai src staff_ai@task.erl
Raw

src/staff_ai@task.erl

-module(staff_ai@task).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([create/3]).
-export_type([task_status/0, task/0]).
-type task_status() :: ready | in_progress | completed | cancelled | failed.
-type task() :: {task,
binary(),
binary(),
binary(),
task_status(),
gleam@option:option(binary()),
birl:time(),
birl:time(),
gleam@option:option(birl:time()),
gleam@option:option(birl:time()),
gleam@option:option(birl:time())}.
-spec create(binary(), binary(), gleam@option:option(binary())) -> task().
create(Title, Description, Assigned_agent) ->
_assert_subject = ids@uuid:generate_v4(),
{ok, Id} = case _assert_subject of
{ok, _} -> _assert_subject;
_assert_fail ->
erlang:error(#{gleam_error => let_assert,
message => <<"Assertion pattern match failed"/utf8>>,
value => _assert_fail,
module => <<"staff_ai/task"/utf8>>,
function => <<"create"/utf8>>,
line => 61})
end,
Created_at = birl:now(),
{task,
Id,
Title,
Description,
ready,
Assigned_agent,
Created_at,
Created_at,
none,
none,
none}.