-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
42 lines (35 loc) · 1.24 KB
/
__init__.py
File metadata and controls
42 lines (35 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
"""social-alignment plugin for Hermes Agent."""
from __future__ import annotations
import sys
from pathlib import Path
_HERE = Path(__file__).resolve().parent
if str(_HERE) not in sys.path:
sys.path.insert(0, str(_HERE))
from .tools import ( # noqa: E402
ALIGNMENT_CHECK_SCHEMA,
ALIGNMENT_DEFER_SCHEMA,
ALIGNMENT_INIT_SCHEMA,
ALIGNMENT_PROCEED_SCHEMA,
ALIGNMENT_WISDOM_SCHEMA,
handle_alignment_check,
handle_alignment_defer,
handle_alignment_init,
handle_alignment_proceed,
handle_alignment_wisdom,
)
_TOOLS = (
("alignment_init", ALIGNMENT_INIT_SCHEMA, handle_alignment_init, "🧭"),
("alignment_check", ALIGNMENT_CHECK_SCHEMA, handle_alignment_check, "🚦"),
("alignment_proceed", ALIGNMENT_PROCEED_SCHEMA, handle_alignment_proceed, "✅"),
("alignment_defer", ALIGNMENT_DEFER_SCHEMA, handle_alignment_defer, "⏸️"),
("alignment_wisdom", ALIGNMENT_WISDOM_SCHEMA, handle_alignment_wisdom, "🦉"),
)
def register(ctx) -> None:
for name, schema, handler, emoji in _TOOLS:
ctx.register_tool(
name=name,
toolset="alignment",
schema=schema,
handler=handler,
emoji=emoji,
)