Initial commit: VoIdeaAI - voice-first AI idea assistant
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
# Шаблон changelog агента
|
||||
|
||||
Используйте для инициализации changelog нового агента.
|
||||
|
||||
Формат файла: `CHANGELOG/agents/{agent_name}.md`
|
||||
|
||||
```markdown
|
||||
# {agent_name} Changelog
|
||||
<!-- checksum: {sha256_hash} -->
|
||||
|
||||
## 1.0.0 ({date})
|
||||
- Initial version
|
||||
```
|
||||
|
||||
## Пример
|
||||
|
||||
```markdown
|
||||
# doc_agent Changelog
|
||||
<!-- checksum: a1b2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef1234567890 -->
|
||||
|
||||
## 1.2.1 (2026-05-11)
|
||||
- Fixed: update README on file rename
|
||||
- Fixed: handle empty docstrings gracefully
|
||||
|
||||
## 1.2.0 (2026-05-10)
|
||||
- Added: YAML prompt loading support
|
||||
- Added: cross-reference validation
|
||||
|
||||
## 1.1.0 (2026-05-09)
|
||||
- Added: auto-generate README for new modules
|
||||
|
||||
## 1.0.0 (2026-05-01)
|
||||
- Initial version
|
||||
```
|
||||
@@ -0,0 +1,69 @@
|
||||
# Шаблон кода агента
|
||||
|
||||
Используйте этот шаблон для создания нового системного агента.
|
||||
|
||||
```python
|
||||
"""Agent: {name} — {description}."""
|
||||
|
||||
from datetime import datetime, timezone
|
||||
from typing import Any
|
||||
|
||||
from app.agents.base import BaseAgent, AgentResult, AgentTrigger
|
||||
|
||||
|
||||
class {Name}Agent(BaseAgent):
|
||||
"""{Description} agent.
|
||||
|
||||
Triggers: {triggers}
|
||||
"""
|
||||
|
||||
name = "{name}"
|
||||
version = "1.0.0"
|
||||
description = "{description}"
|
||||
triggers = [AgentTrigger.MANUAL]
|
||||
|
||||
async def run(self, context: dict[str, Any] | None = None) -> AgentResult:
|
||||
"""Execute agent task.
|
||||
|
||||
Args:
|
||||
context: Optional context with execution parameters
|
||||
|
||||
Returns:
|
||||
AgentResult with execution outcome
|
||||
"""
|
||||
start = datetime.now(timezone.utc)
|
||||
errors: list[str] = []
|
||||
data: dict[str, Any] = {}
|
||||
|
||||
try:
|
||||
# === AGENT LOGIC HERE ===
|
||||
# 1. Do the work
|
||||
# 2. Collect results
|
||||
# 3. Handle errors
|
||||
pass
|
||||
|
||||
except Exception as e:
|
||||
errors.append(str(e))
|
||||
|
||||
duration = int((datetime.now(timezone.utc) - start).total_seconds() * 1000)
|
||||
|
||||
result = AgentResult(
|
||||
success=len(errors) == 0,
|
||||
message=f"{self.name} completed with {len(errors)} errors",
|
||||
data=data,
|
||||
errors=errors,
|
||||
duration_ms=duration,
|
||||
)
|
||||
|
||||
# Auto-version check
|
||||
new_version = await self._check_version()
|
||||
if new_version:
|
||||
result.data["version_bumped"] = True
|
||||
result.data["new_version"] = new_version
|
||||
|
||||
return result
|
||||
|
||||
async def health_check(self) -> bool:
|
||||
"""Check if agent can execute."""
|
||||
return True
|
||||
```
|
||||
Reference in New Issue
Block a user