Download agents/base.py from bhuvi3/CIOAgent: direct link, hf CLI and curl.
- Browser
- Download file 1.48 kB
-
https://huggingface.co/spaces/bhuvi3/CIOAgent/resolve/main/agents/base.py
- Command line
-
hf download hf://spaces/bhuvi3/CIOAgent/agents/base.py
-
curl -L -o base.py https://huggingface.co/spaces/bhuvi3/CIOAgent/resolve/main/agents/base.py
1.48 kB
| from abc import ABC, abstractmethod | |
| from integrations.anthropic_client import AnthropicClient | |
| class BaseAgent(ABC): | |
| MARKDOWN_INSTRUCTIONS = ( | |
| "CRITICAL FORMATTING RULES:\n" | |
| "1. DATA PRESENTATION:\n" | |
| " - For SMALL datasets (2-3 rows/items) or simple summaries: Use a BULLETED LIST.\n" | |
| " - For LARGE datasets (4+ rows) or complex comparisons: Use a MARKDOWN TABLE.\n" | |
| "2. TABLE RULES (when used):\n" | |
| " - Include a BLANK LINE before and after every table.\n" | |
| " - Mandatory alignment row: MUST match the header column count (e.g., |---|---| for 2 columns).\n" | |
| " - One row per line. Never omit the | separators.\n" | |
| " - STRICTLY START A NEW LINE for each table row. Do not put multiple rows on the same line.\n" | |
| " - Ensure column counts match exactly between header and rows.\n" | |
| " - FORCE newlines between rows. Do not use '||' as a separator.\n" | |
| " - DO NOT use code blocks for tables. Use standard Markdown tables.\n" | |
| "3. Headers: Use ## and ### for sections.\n" | |
| "4. Clarity: Bold all key metrics and final recommendations." | |
| ) | |
| def __init__(self, client: AnthropicClient): | |
| self._client = client | |
| def name(self) -> str: ... | |
| def system_prompt(self) -> str: ... | |
| def analyze(self, metrics: dict, extra_context: str = "") -> str: ... | |