Download agents/performance_analyst.py from bhuvi3/CIOAgent: direct link, hf CLI and curl.
- Browser
- Download file 827 Bytes
-
https://huggingface.co/spaces/bhuvi3/CIOAgent/resolve/main/agents/performance_analyst.py
- Command line
-
hf download hf://spaces/bhuvi3/CIOAgent/agents/performance_analyst.py
-
curl -L -o performance_analyst.py https://huggingface.co/spaces/bhuvi3/CIOAgent/resolve/main/agents/performance_analyst.py
827 Bytes
| import json | |
| from agents.base import BaseAgent | |
| from integrations.anthropic_client import AnthropicClient | |
| class PerformanceAnalyst(BaseAgent): | |
| def __init__(self, client: AnthropicClient): | |
| super().__init__(client) | |
| def name(self) -> str: | |
| return "Performance Analyst" | |
| def system_prompt(self) -> str: | |
| return ( | |
| "You are a quantitative performance analyst. " | |
| f"\n\n{self.MARKDOWN_INSTRUCTIONS}" | |
| ) | |
| def analyze(self, metrics: dict, extra_context: str = "") -> str: | |
| user_content = ( | |
| "Analyze these portfolio performance metrics:\n" | |
| + json.dumps(metrics["performance"], indent=2) | |
| + extra_context | |
| ) | |
| return self._client.ask(self.system_prompt, user_content, temperature=0.3) | |