staff_ai
Types
Represents an AI worker in a staff system
It represents the most simple unit of you staff who can be assigned to a task. Agent has a name, a list of skills and a list of tasks, which he is currently working on.
pub type Agent {
Agent(
id: UUID,
name: String,
role: String,
context: Option(String),
)
}
Constructors
-
Agent( id: UUID, name: String, role: String, context: Option(String), )
Arguments
-
id
Unique identifier of the agent
-
name
Name of the agent, which is used to identify him in your system. It can be a real name or a nickname, e.g. “Jane Doe” or “jane_doe”
-
role
Role of the agent, which is used to identify his skills and responsibilities in your system. It can be a real role or a nickname, e.g. “Software Developer” or “dev”
-
context
Adding a context to an agent is optional, but it can be useful to store additional information about the agent. It can be used to store additional information about the agent as it will influence the way it reacts to tasks. E.g. “Jane Doe is a technical lead of the project X. She is responsible for the architecture and …”
-
A task that can be performed by an agent
It represents the most simple unit of work that an Agent can perform. The task can involve any input and output, but it is expected to be a small unit of work that can be performed in a short amount of time.
pub type Task {
Task(
id: UUID,
title: String,
description: String,
status: TaskStatus,
assigned_agent: Option(UUID),
created_at: birl.Time,
updated_at: birl.Time,
completed_at: Option(birl.Time),
cancelled_at: Option(birl.Time),
failed_at: Option(birl.Time),
)
}
Constructors
-
Task( id: UUID, title: String, description: String, status: TaskStatus, assigned_agent: Option(UUID), created_at: birl.Time, updated_at: birl.Time, completed_at: Option(birl.Time), cancelled_at: Option(birl.Time), failed_at: Option(birl.Time), )
Arguments
-
id
The unique identifier of the task
-
title
A meaningful title of the task
-
description
A description of the task, must be detailed enough to be performed
-
status
The status of the task
-
assigned_agent
The unique identifier of the agent that has been assigned to perform the task
-
created_at
The time when the task was created
-
updated_at
The time when the task was last updated
-
completed_at
The time when the task was completed
-
cancelled_at
The time when the task was cancelled
-
failed_at
The time when the task has failed
-
The status of the task
pub type TaskStatus {
Ready
InProgress
Completed
Cancelled
Failed
}
Constructors
-
Ready
The task is ready to be performed
-
InProgress
The task is currently being performed
-
Completed
The task has been completed
-
Cancelled
The task has been cancelled
-
Failed
The task has failed
Functions
pub fn create_agent(
name: String,
role: String,
context: Option(String),
) -> Agent
Creates a new agent with the given parameters.
pub fn create_task(
title: String,
description: String,
assigned_agent: Option(String),
) -> Task
Create a new task