from plato.agents import BaseAgent, AgentConfig, Secret, register_agent
from typing import Annotated
class MyAgentConfig(AgentConfig):
model_name: str = "anthropic/claude-sonnet-4"
api_key: Annotated[str, Secret(description="API key")]
@register_agent("my-agent")
class MyAgent(BaseAgent[MyAgentConfig]):
name = "my-agent"
description = "My custom agent"
async def run(self, instruction: str) -> None:
# Access typed configuration
model = self.config.model_name
api_key = self.config.api_key
# Execute task logic
...
# Write trajectory
await self.write_trajectory(trajectory)