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.erl
Raw

src/staff_ai.erl

-module(staff_ai).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([create_task/3, create_agent/3]).
-export_type([task_status/0, task/0, agent/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())}.
-type agent() :: {agent,
binary(),
binary(),
binary(),
gleam@option:option(binary())}.
-spec create_task(binary(), binary(), gleam@option:option(binary())) -> task().
create_task(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"/utf8>>,
function => <<"create_task"/utf8>>,
line => 80})
end,
Created_at = birl:now(),
{task,
Id,
Title,
Description,
ready,
Assigned_agent,
Created_at,
Created_at,
none,
none,
none}.
-spec create_agent(binary(), binary(), gleam@option:option(binary())) -> agent().
create_agent(Name, Role, Context) ->
_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"/utf8>>,
function => <<"create_agent"/utf8>>,
line => 125})
end,
{agent, Id, Name, Role, Context}.