Skip to repository content

tenant.openagents/omega

No repository description is available.

OpenAgents Git authority 2026-07-28T04:03:01.623Z Public web read
NIP-34 coordinate30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omega
MaintainersHidden in public view
References2 branches · 1 tag
Read-only clonegit clone https://openagents.com/git/tenant.openagents/omega.git
Browse files

role.rs

31 lines · 728 B · rust
1use serde::{Deserialize, Serialize};
2use std::fmt::{self, Display};
3
4#[derive(Clone, Copy, Serialize, Deserialize, Debug, Eq, PartialEq, Hash)]
5#[serde(rename_all = "lowercase")]
6pub enum Role {
7    User,
8    Assistant,
9    System,
10}
11
12impl Role {
13    pub fn cycle(self) -> Role {
14        match self {
15            Role::User => Role::Assistant,
16            Role::Assistant => Role::System,
17            Role::System => Role::User,
18        }
19    }
20}
21
22impl Display for Role {
23    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> std::fmt::Result {
24        match self {
25            Role::User => write!(f, "user"),
26            Role::Assistant => write!(f, "assistant"),
27            Role::System => write!(f, "system"),
28        }
29    }
30}
31
Served at tenant.openagents/omega Member data and write actions are omitted.