Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ workspace/
white_collar_agent/external_tools/
white_collar_agent/generated_task_document/
**/__pycache__/
**/rag_docs_actions/
**/rag_docs_taskdocs/
ollama_data/
node_modules
.env
Expand Down
Empty file added agents/dog_agent/__init__.py
Empty file.
61 changes: 61 additions & 0 deletions agents/dog_agent/agent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# -*- coding: utf-8 -*-
"""
DogAgent
========

A dog

"""

from __future__ import annotations

import importlib.util
from importlib import import_module
from pathlib import Path

import yaml

from core.agent_base import AgentBase
from core.logger import logger


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."
)

if __name__ == "__main__":
import asyncio

bundle_dir = Path(__file__).parent
agent = DogAgent.from_bundle(bundle_dir)
asyncio.run(agent.run())
6 changes: 6 additions & 0 deletions agents/dog_agent/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
data_dir: agents/dog_agent/data/
rag_dir: rag_docs
rag_namespace: dog_agent_knowledge

max_tokens: 16000
llm_provider: byteplus
Loading