initial a2a-pack
This commit is contained in:
24
a2a_pack/cli/templates/agent.py.tmpl
Normal file
24
a2a_pack/cli/templates/agent.py.tmpl
Normal file
@@ -0,0 +1,24 @@
|
||||
"""{{ 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}"
|
||||
Reference in New Issue
Block a user