| 35 | |
| 36 | |
| 37 | class _TestingAgent(BaseAgent): |
| 38 | |
| 39 | @override |
| 40 | async def _run_async_impl( |
| 41 | self, ctx: InvocationContext |
| 42 | ) -> AsyncGenerator[Event, None]: |
| 43 | yield Event( |
| 44 | author=self.name, |
| 45 | invocation_id=ctx.invocation_id, |
| 46 | content=types.Content( |
| 47 | parts=[types.Part(text=f'Hello, async {self.name}!')] |
| 48 | ), |
| 49 | ) |
| 50 | |
| 51 | @override |
| 52 | async def _run_live_impl( |
| 53 | self, ctx: InvocationContext |
| 54 | ) -> AsyncGenerator[Event, None]: |
| 55 | yield Event( |
| 56 | author=self.name, |
| 57 | invocation_id=ctx.invocation_id, |
| 58 | content=types.Content( |
| 59 | parts=[types.Part(text=f'Hello, live {self.name}!')] |
| 60 | ), |
| 61 | ) |
| 62 | |
| 63 | |
| 64 | class _TestingAgentWithEscalateAction(BaseAgent): |
no outgoing calls