Main entry point for the agent.
()
| 37 | |
| 38 | |
| 39 | async def main(): |
| 40 | """Main entry point for the agent.""" |
| 41 | prompt = 'hello world' |
| 42 | runner = InMemoryRunner( |
| 43 | agent=root_agent, |
| 44 | app_name='test_app_with_plugin', |
| 45 | # [Step 2] Add your plugin here. You can add multiple plugins. |
| 46 | plugins=[CountInvocationPlugin()], |
| 47 | ) |
| 48 | session = await runner.session_service.create_session( |
| 49 | user_id='user', |
| 50 | app_name='test_app_with_plugin', |
| 51 | ) |
| 52 | |
| 53 | async for event in runner.run_async( |
| 54 | user_id='user', |
| 55 | session_id=session.id, |
| 56 | new_message=types.Content( |
| 57 | role='user', parts=[types.Part.from_text(text=prompt)] |
| 58 | ), |
| 59 | ): |
| 60 | print(f'** Got event from {event.author}') |
| 61 | |
| 62 | |
| 63 | if __name__ == '__main__': |
no test coverage detected