Files
a2a/a2a_pack/cli/templates/agent.py.tmpl
2026-05-08 21:59:51 -03:00

25 lines
617 B
Cheetah

"""{{ name }} agent."""
from __future__ import annotations
from pydantic import BaseModel
from a2a_pack import A2AAgent, NoAuth, RunContext, skill
class {{ class_name }}Config(BaseModel):
pass
class {{ class_name }}(A2AAgent[{{ class_name }}Config, NoAuth]):
name = "{{ name }}"
description = "{{ description }}"
version = "0.1.0"
config_model = {{ class_name }}Config
auth_model = NoAuth
@skill(description="Say hello")
async def hello(self, ctx: RunContext[NoAuth], who: str = "world") -> str:
await ctx.emit_progress(f"greeting {who}")
return f"hello {who}"