Bases: AgentBase
A friendly, dog-themed specialist built on :class:AgentBase.
Source code in agents\dog_agent\agent.py
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54 | class DogAgent(AgentBase):
"""A friendly, dog-themed specialist built on :class:`AgentBase`."""
# Factory for Docker entrypoint / tests
@classmethod
def from_bundle(cls, bundle_dir: str | Path) -> "DogAgent":
bundle_path = Path(bundle_dir).resolve()
cfg = yaml.safe_load((bundle_path / "config.yaml").read_text())
return cls(cfg, bundle_path)
def __init__(self, cfg: dict, bundle_path: Path):
self._bundle_path = Path(bundle_path)
self._cfg = cfg
super().__init__(
data_dir=cfg.get("data_dir", "core/data"),
chroma_path=str(self._bundle_path / cfg.get("rag_dir", "rag_docs")),
llm_provider=cfg.get("llm_provider", "byteplus"),
)
# -------- AgentBase hooks ----------------------------------------- #
def _generate_role_info_prompt(self) -> str:
return (
"You are a custom agent named DOG, a loyal and upbeat canine-inspired assistant.\n"
"You MUST NOT talk at all. You MUST replace all human language with\n"
"something like: 'Woof wooof woof, wooof wooff woof woff'\n"
"You MUST NOT talk in human language AT ALL AS THAT VIOLATES your agent POLICY.\n"
"When using the 'send message' action, you MUST NOT send message in human langauge.\n"
"You must REPLACE all English and human language words with 'woof' of different style and length.\n"
"You do, however, still execute task for human using actions "
"and offering encouraging nudges to stay productive."
)
|